include/opencv2/ts/ts_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 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
00133 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
00134 
00135 // The user can define the following macros in the build script to
00136 // control Google Test's behavior.  If the user doesn't define a macro
00137 // in this list, Google Test will define it.
00138 //
00139 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
00140 //                              is/isn't available.
00141 //   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
00142 //                              are enabled.
00143 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
00144 //                              is/isn't available (some systems define
00145 //                              ::string, which is different to std::string).
00146 //   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
00147 //                              is/isn't available (some systems define
00148 //                              ::wstring, which is different to std::wstring).
00149 //   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
00150 //                              expressions are/aren't available.
00151 //   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
00152 //                              is/isn't available.
00153 //   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
00154 //                              enabled.
00155 //   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
00156 //                              std::wstring does/doesn't work (Google Test can
00157 //                              be used where std::wstring is unavailable).
00158 //   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
00159 //                              is/isn't available.
00160 //   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
00161 //                              compiler supports Microsoft's "Structured
00162 //                              Exception Handling".
00163 //   GTEST_HAS_STREAM_REDIRECTION
00164 //                            - Define it to 1/0 to indicate whether the
00165 //                              platform supports I/O stream redirection using
00166 //                              dup() and dup2().
00167 //   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
00168 //                              Test's own tr1 tuple implementation should be
00169 //                              used.  Unused when the user sets
00170 //                              GTEST_HAS_TR1_TUPLE to 0.
00171 //   GTEST_LINKED_AS_SHARED_LIBRARY
00172 //                            - Define to 1 when compiling tests that use
00173 //                              Google Test as a shared library (known as
00174 //                              DLL on Windows).
00175 //   GTEST_CREATE_SHARED_LIBRARY
00176 //                            - Define to 1 when compiling Google Test itself
00177 //                              as a shared library.
00178 
00179 // This header defines the following utilities:
00180 //
00181 // Macros indicating the current platform (defined to 1 if compiled on
00182 // the given platform; otherwise undefined):
00183 //   GTEST_OS_AIX      - IBM AIX
00184 //   GTEST_OS_CYGWIN   - Cygwin
00185 //   GTEST_OS_HPUX     - HP-UX
00186 //   GTEST_OS_LINUX    - Linux
00187 //     GTEST_OS_LINUX_ANDROID - Google Android
00188 //   GTEST_OS_MAC      - Mac OS X
00189 //   GTEST_OS_NACL     - Google Native Client (NaCl)
00190 //   GTEST_OS_OPENBSD  - OpenBSD
00191 //   GTEST_OS_QNX      - QNX
00192 //   GTEST_OS_SOLARIS  - Sun Solaris
00193 //   GTEST_OS_SYMBIAN  - Symbian
00194 //   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
00195 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
00196 //     GTEST_OS_WINDOWS_MINGW    - MinGW
00197 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
00198 //   GTEST_OS_ZOS      - z/OS
00199 //
00200 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
00201 // most stable support.  Since core members of the Google Test project
00202 // don't have access to other platforms, support for them may be less
00203 // stable.  If you notice any problems on your platform, please notify
00204 // googletestframework@googlegroups.com (patches for fixing them are
00205 // even more welcome!).
00206 //
00207 // Note that it is possible that none of the GTEST_OS_* macros are defined.
00208 //
00209 // Macros indicating available Google Test features (defined to 1 if
00210 // the corresponding feature is supported; otherwise undefined):
00211 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
00212 //                            tests)
00213 //   GTEST_HAS_DEATH_TEST   - death tests
00214 //   GTEST_HAS_PARAM_TEST   - value-parameterized tests
00215 //   GTEST_HAS_TYPED_TEST   - typed tests
00216 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
00217 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
00218 //                            GTEST_HAS_POSIX_RE (see above) which users can
00219 //                            define themselves.
00220 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
00221 //                            the above two are mutually exclusive.
00222 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
00223 //
00224 // Macros for basic C++ coding:
00225 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
00226 //   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
00227 //                              variable don't have to be used.
00228 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
00229 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
00230 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
00231 //
00232 // Synchronization:
00233 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
00234 //                  - synchronization primitives.
00235 //   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
00236 //                         synchronization primitives have real implementations
00237 //                         and Google Test is thread-safe; or 0 otherwise.
00238 //
00239 // Template meta programming:
00240 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
00241 //   IteratorTraits - partial implementation of std::iterator_traits, which
00242 //                    is not available in libCstd when compiled with Sun C++.
00243 //
00244 // Smart pointers:
00245 //   scoped_ptr     - as in TR2.
00246 //
00247 // Regular expressions:
00248 //   RE             - a simple regular expression class using the POSIX
00249 //                    Extended Regular Expression syntax on UNIX-like
00250 //                    platforms, or a reduced regular exception syntax on
00251 //                    other platforms, including Windows.
00252 //
00253 // Logging:
00254 //   GTEST_LOG_()   - logs messages at the specified severity level.
00255 //   LogToStderr()  - directs all log messages to stderr.
00256 //   FlushInfoLog() - flushes informational log messages.
00257 //
00258 // Stdout and stderr capturing:
00259 //   CaptureStdout()     - starts capturing stdout.
00260 //   GetCapturedStdout() - stops capturing stdout and returns the captured
00261 //                         string.
00262 //   CaptureStderr()     - starts capturing stderr.
00263 //   GetCapturedStderr() - stops capturing stderr and returns the captured
00264 //                         string.
00265 //
00266 // Integer types:
00267 //   TypeWithSize   - maps an integer to a int type.
00268 //   Int32, UInt32, Int64, UInt64, TimeInMillis
00269 //                  - integers of known sizes.
00270 //   BiggestInt     - the biggest signed integer type.
00271 //
00272 // Command-line utilities:
00273 //   GTEST_FLAG()       - references a flag.
00274 //   GTEST_DECLARE_*()  - declares a flag.
00275 //   GTEST_DEFINE_*()   - defines a flag.
00276 //   GetInjectableArgvs() - returns the command line as a vector of strings.
00277 //
00278 // Environment variable utilities:
00279 //   GetEnv()             - gets the value of an environment variable.
00280 //   BoolFromGTestEnv()   - parses a bool environment variable.
00281 //   Int32FromGTestEnv()  - parses an Int32 environment variable.
00282 //   StringFromGTestEnv() - parses a string environment variable.
00283 
00284 #include <ctype.h>   // for isspace, etc
00285 #include <stddef.h>  // for ptrdiff_t
00286 #include <stdlib.h>
00287 #include <stdio.h>
00288 #include <string.h>
00289 #ifndef _WIN32_WCE
00290 # include <sys/types.h>
00291 # include <sys/stat.h>
00292 #endif  // !_WIN32_WCE
00293 
00294 #include <iostream>  // NOLINT
00295 #include <sstream>  // NOLINT
00296 #include <string>  // NOLINT
00297 
00298 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
00299 #define GTEST_FLAG_PREFIX_ "gtest_"
00300 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
00301 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
00302 #define GTEST_NAME_ "Google Test"
00303 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
00304 
00305 // Determines the version of gcc that is used to compile this.
00306 #ifdef __GNUC__
00307 // 40302 means version 4.3.2.
00308 # define GTEST_GCC_VER_ \
00309     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
00310 #endif  // __GNUC__
00311 
00312 // Determines the platform on which Google Test is compiled.
00313 #define GTEST_OS_CYGWIN 0
00314 #define GTEST_OS_SYMBIAN 0
00315 #define GTEST_OS_WINDOWS 0
00316 #define GTEST_OS_WINDOWS_MOBILE 0
00317 #define GTEST_OS_WINDOWS_MINGW 0
00318 #define GTEST_OS_WINDOWS_DESKTOP 0
00319 #define GTEST_OS_MAC 0
00320 #define GTEST_OS_LINUX 0
00321 #define GTEST_OS_LINUX_ANDROID 0
00322 #define GTEST_OS_ZOS 0
00323 #define GTEST_OS_SOLARIS 0
00324 #define GTEST_OS_AIX 0
00325 #define GTEST_OS_HPUX 0
00326 #define GTEST_OS_NACL 0
00327 #define GTEST_OS_OPENBSD 0
00328 #define GTEST_OS_QNX 0
00329 
00330 #ifdef __CYGWIN__
00331 # undef GTEST_OS_CYGWIN
00332 # define GTEST_OS_CYGWIN 1
00333 #elif defined __SYMBIAN32__
00334 # undef GTEST_OS_SYMBIAN
00335 # define GTEST_OS_SYMBIAN 1
00336 #elif defined _WIN32
00337 # undef GTEST_OS_WINDOWS
00338 # define GTEST_OS_WINDOWS 1
00339 # ifdef _WIN32_WCE
00340 #  undef GTEST_OS_WINDOWS_MOBILE
00341 #  define GTEST_OS_WINDOWS_MOBILE 1
00342 # elif defined(__MINGW__) || defined(__MINGW32__)
00343 #  undef GTEST_OS_WINDOWS_MINGW
00344 #  define GTEST_OS_WINDOWS_MINGW 1
00345 # else
00346 #  undef GTEST_OS_WINDOWS_DESKTOP
00347 #  define GTEST_OS_WINDOWS_DESKTOP 1
00348 # endif  // _WIN32_WCE
00349 #elif defined __APPLE__
00350 # undef GTEST_OS_MAC
00351 # define GTEST_OS_MAC 1
00352 #elif defined __linux__
00353 # undef GTEST_OS_LINUX
00354 # define GTEST_OS_LINUX 1
00355 # ifdef ANDROID
00356 #  undef GTEST_OS_LINUX_ANDROID
00357 #  define GTEST_OS_LINUX_ANDROID 1
00358 # endif  // ANDROID
00359 #elif defined __MVS__
00360 # undef GTEST_OS_ZOS
00361 # define GTEST_OS_ZOS 1
00362 #elif defined(__sun) && defined(__SVR4)
00363 # undef GTEST_OS_SOLARIS
00364 # define GTEST_OS_SOLARIS 1
00365 #elif defined(_AIX)
00366 # undef GTEST_OS_AIX
00367 # define GTEST_OS_AIX 1
00368 #elif defined(__hpux)
00369 # undef GTEST_OS_HPUX
00370 # define GTEST_OS_HPUX 1
00371 #elif defined __native_client__
00372 # undef GTEST_OS_NACL
00373 # define GTEST_OS_NACL 1
00374 #elif defined __OpenBSD__
00375 # undef GTEST_OS_OPENBSD
00376 # define GTEST_OS_OPENBSD 1
00377 #elif defined __QNX__
00378 # undef GTEST_OS_QNX
00379 # define GTEST_OS_QNX 1
00380 #endif  // __CYGWIN__
00381 
00382 // Brings in definitions for functions used in the testing::internal::posix
00383 // namespace (read, write, close, chdir, isatty, stat). We do not currently
00384 // use them on Windows Mobile.
00385 #if !GTEST_OS_WINDOWS
00386 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
00387 // is not the case, we need to include headers that provide the functions
00388 // mentioned above.
00389 # include <unistd.h>
00390 # if !GTEST_OS_NACL
00391 // TODO(vladl@google.com): Remove this condition when Native Client SDK adds
00392 // strings.h (tracked in
00393 // http://code.google.com/p/nativeclient/issues/detail?id=1175).
00394 #  include <strings.h>  // Native Client doesn't provide strings.h.
00395 # endif
00396 #elif !GTEST_OS_WINDOWS_MOBILE
00397 # include <direct.h>
00398 # include <io.h>
00399 #endif
00400 
00401 // Defines this to true iff Google Test can use POSIX regular expressions.
00402 #ifndef GTEST_HAS_POSIX_RE
00403 # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
00404 #endif
00405 
00406 #if GTEST_HAS_POSIX_RE
00407 
00408 // On some platforms, <regex.h> needs someone to define size_t, and
00409 // won't compile otherwise.  We can #include it here as we already
00410 // included <stdlib.h>, which is guaranteed to define size_t through
00411 // <stddef.h>.
00412 # include <regex.h>  // NOLINT
00413 
00414 # define GTEST_USES_POSIX_RE  1
00415 # define GTEST_USES_SIMPLE_RE 0
00416 
00417 #elif GTEST_OS_WINDOWS
00418 
00419 // <regex.h> is not available on Windows.  Use our own simple regex
00420 // implementation instead.
00421 # define GTEST_USES_SIMPLE_RE 1
00422 # define GTEST_USES_POSIX_RE  0
00423 
00424 #else
00425 
00426 // <regex.h> may not be available on this platform.  Use our own
00427 // simple regex implementation instead.
00428 # define GTEST_USES_SIMPLE_RE 1
00429 # define GTEST_USES_POSIX_RE  0
00430 
00431 #endif  // GTEST_HAS_POSIX_RE
00432 
00433 #ifndef GTEST_HAS_EXCEPTIONS
00434 // The user didn't tell us whether exceptions are enabled, so we need
00435 // to figure it out.
00436 # if defined(_MSC_VER) || defined(__BORLANDC__)
00437 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
00438 // macro to enable exceptions, so we'll do the same.
00439 // Assumes that exceptions are enabled by default.
00440 #  ifndef _HAS_EXCEPTIONS
00441 #   define _HAS_EXCEPTIONS 1
00442 #  endif  // _HAS_EXCEPTIONS
00443 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
00444 # elif defined(__GNUC__) && __EXCEPTIONS
00445 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
00446 #  define GTEST_HAS_EXCEPTIONS 1
00447 # elif defined(__SUNPRO_CC)
00448 // Sun Pro CC supports exceptions.  However, there is no compile-time way of
00449 // detecting whether they are enabled or not.  Therefore, we assume that
00450 // they are enabled unless the user tells us otherwise.
00451 #  define GTEST_HAS_EXCEPTIONS 1
00452 # elif defined(__IBMCPP__) && __EXCEPTIONS
00453 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
00454 #  define GTEST_HAS_EXCEPTIONS 1
00455 # elif defined(__HP_aCC)
00456 // Exception handling is in effect by default in HP aCC compiler. It has to
00457 // be turned of by +noeh compiler option if desired.
00458 #  define GTEST_HAS_EXCEPTIONS 1
00459 # else
00460 // For other compilers, we assume exceptions are disabled to be
00461 // conservative.
00462 #  define GTEST_HAS_EXCEPTIONS 0
00463 # endif  // defined(_MSC_VER) || defined(__BORLANDC__)
00464 #endif  // GTEST_HAS_EXCEPTIONS
00465 
00466 #if !defined(GTEST_HAS_STD_STRING)
00467 // Even though we don't use this macro any longer, we keep it in case
00468 // some clients still depend on it.
00469 # define GTEST_HAS_STD_STRING 1
00470 #elif !GTEST_HAS_STD_STRING
00471 // The user told us that ::std::string isn't available.
00472 # error "Google Test cannot be used where ::std::string isn't available."
00473 #endif  // !defined(GTEST_HAS_STD_STRING)
00474 
00475 #ifndef GTEST_HAS_GLOBAL_STRING
00476 // The user didn't tell us whether ::string is available, so we need
00477 // to figure it out.
00478 
00479 # define GTEST_HAS_GLOBAL_STRING 0
00480 
00481 #endif  // GTEST_HAS_GLOBAL_STRING
00482 
00483 #ifndef GTEST_HAS_STD_WSTRING
00484 // The user didn't tell us whether ::std::wstring is available, so we need
00485 // to figure it out.
00486 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
00487 //   is available.
00488 
00489 // Cygwin 1.7 and below doesn't support ::std::wstring.
00490 // Solaris' libc++ doesn't support it either.  Android has
00491 // no support for it at least as recent as Froyo (2.2).
00492 # define GTEST_HAS_STD_WSTRING \
00493     (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
00494 
00495 #endif  // GTEST_HAS_STD_WSTRING
00496 
00497 #ifndef GTEST_HAS_GLOBAL_WSTRING
00498 // The user didn't tell us whether ::wstring is available, so we need
00499 // to figure it out.
00500 # define GTEST_HAS_GLOBAL_WSTRING \
00501     (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
00502 #endif  // GTEST_HAS_GLOBAL_WSTRING
00503 
00504 // Determines whether RTTI is available.
00505 #ifndef GTEST_HAS_RTTI
00506 // The user didn't tell us whether RTTI is enabled, so we need to
00507 // figure it out.
00508 
00509 # ifdef _MSC_VER
00510 
00511 #  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
00512 #   define GTEST_HAS_RTTI 1
00513 #  else
00514 #   define GTEST_HAS_RTTI 0
00515 #  endif
00516 
00517 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
00518 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
00519 
00520 #  ifdef __GXX_RTTI
00521 #   define GTEST_HAS_RTTI 1
00522 #  else
00523 #   define GTEST_HAS_RTTI 0
00524 #  endif  // __GXX_RTTI
00525 
00526 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
00527 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
00528 // first version with C++ support.
00529 # elif defined(__clang__)
00530 
00531 #  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
00532 
00533 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
00534 // both the typeid and dynamic_cast features are present.
00535 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
00536 
00537 #  ifdef __RTTI_ALL__
00538 #   define GTEST_HAS_RTTI 1
00539 #  else
00540 #   define GTEST_HAS_RTTI 0
00541 #  endif
00542 
00543 # else
00544 
00545 // For all other compilers, we assume RTTI is enabled.
00546 #  define GTEST_HAS_RTTI 1
00547 
00548 # endif  // _MSC_VER
00549 
00550 #endif  // GTEST_HAS_RTTI
00551 
00552 // It's this header's responsibility to #include <typeinfo> when RTTI
00553 // is enabled.
00554 #if GTEST_HAS_RTTI
00555 # include <typeinfo>
00556 #endif
00557 
00558 // Determines whether Google Test can use the pthreads library.
00559 #ifndef GTEST_HAS_PTHREAD
00560 // The user didn't tell us explicitly, so we assume pthreads support is
00561 // available on Linux and Mac.
00562 //
00563 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
00564 // to your compiler flags.
00565 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
00566     || GTEST_OS_QNX)
00567 #endif  // GTEST_HAS_PTHREAD
00568 
00569 #if GTEST_HAS_PTHREAD
00570 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
00571 // true.
00572 # include <pthread.h>  // NOLINT
00573 
00574 // For timespec and nanosleep, used below.
00575 # include <time.h>  // NOLINT
00576 #endif
00577 
00578 // Determines whether Google Test can use tr1/tuple.  You can define
00579 // this macro to 0 to prevent Google Test from using tuple (any
00580 // feature depending on tuple with be disabled in this mode).
00581 #ifndef GTEST_HAS_TR1_TUPLE
00582 // The user didn't tell us not to do it, so we assume it's OK.
00583 # define GTEST_HAS_TR1_TUPLE 1
00584 #endif  // GTEST_HAS_TR1_TUPLE
00585 
00586 // Determines whether Google Test's own tr1 tuple implementation
00587 // should be used.
00588 #ifndef GTEST_USE_OWN_TR1_TUPLE
00589 // The user didn't tell us, so we need to figure it out.
00590 
00591 // We use our own TR1 tuple if we aren't sure the user has an
00592 // implementation of it already.  At this time, GCC 4.0.0+ and MSVC
00593 // 2010 are the only mainstream compilers that come with a TR1 tuple
00594 // implementation.  NVIDIA's CUDA NVCC compiler pretends to be GCC by
00595 // defining __GNUC__ and friends, but cannot compile GCC's tuple
00596 // implementation.  MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
00597 // Feature Pack download, which we cannot assume the user has.
00598 // QNX's QCC compiler is a modified GCC but it doesn't support TR1 tuple.
00599 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
00600       && !GTEST_OS_QNX) || _MSC_VER >= 1600
00601 #  define GTEST_USE_OWN_TR1_TUPLE 0
00602 # else
00603 #  define GTEST_USE_OWN_TR1_TUPLE 1
00604 # endif
00605 
00606 #endif  // GTEST_USE_OWN_TR1_TUPLE
00607 
00608 // To avoid conditional compilation everywhere, we make it
00609 // gtest-port.h's responsibility to #include the header implementing
00610 // tr1/tuple.
00611 #if GTEST_HAS_TR1_TUPLE
00612 
00613 # if GTEST_USE_OWN_TR1_TUPLE
00614 // This file was GENERATED by command:
00615 //     pump.py gtest-tuple.h.pump
00616 // DO NOT EDIT BY HAND!!!
00617 
00618 // Copyright 2009 Google Inc.
00619 // All Rights Reserved.
00620 //
00621 // Redistribution and use in source and binary forms, with or without
00622 // modification, are permitted provided that the following conditions are
00623 // met:
00624 //
00625 //     * Redistributions of source code must retain the above copyright
00626 // notice, this list of conditions and the following disclaimer.
00627 //     * Redistributions in binary form must reproduce the above
00628 // copyright notice, this list of conditions and the following disclaimer
00629 // in the documentation and/or other materials provided with the
00630 // distribution.
00631 //     * Neither the name of Google Inc. nor the names of its
00632 // contributors may be used to endorse or promote products derived from
00633 // this software without specific prior written permission.
00634 //
00635 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00636 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00637 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00638 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00639 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00640 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00641 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00642 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00643 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00644 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00645 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00646 //
00647 // Author: wan@google.com (Zhanyong Wan)
00648 
00649 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
00650 
00651 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
00652 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
00653 
00654 #include <utility>  // For ::std::pair.
00655 
00656 // The compiler used in Symbian has a bug that prevents us from declaring the
00657 // tuple template as a friend (it complains that tuple is redefined).  This
00658 // hack bypasses the bug by declaring the members that should otherwise be
00659 // private as public.
00660 // Sun Studio versions < 12 also have the above bug.
00661 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
00662 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
00663 #else
00664 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
00665     template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
00666    private:
00667 #endif
00668 
00669 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
00670 #define GTEST_0_TUPLE_(T) tuple<>
00671 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
00672     void, void, void>
00673 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
00674     void, void, void>
00675 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
00676     void, void, void>
00677 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
00678     void, void, void>
00679 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
00680     void, void, void>
00681 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
00682     void, void, void>
00683 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00684     void, void, void>
00685 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00686     T##7, void, void>
00687 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00688     T##7, T##8, void>
00689 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00690     T##7, T##8, T##9>
00691 
00692 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
00693 #define GTEST_0_TYPENAMES_(T)
00694 #define GTEST_1_TYPENAMES_(T) typename T##0
00695 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
00696 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
00697 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00698     typename T##3
00699 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00700     typename T##3, typename T##4
00701 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00702     typename T##3, typename T##4, typename T##5
00703 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00704     typename T##3, typename T##4, typename T##5, typename T##6
00705 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00706     typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
00707 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00708     typename T##3, typename T##4, typename T##5, typename T##6, \
00709     typename T##7, typename T##8
00710 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00711     typename T##3, typename T##4, typename T##5, typename T##6, \
00712     typename T##7, typename T##8, typename T##9
00713 
00714 // In theory, defining stuff in the ::std namespace is undefined
00715 // behavior.  We can do this as we are playing the role of a standard
00716 // library vendor.
00717 namespace std {
00718 namespace tr1 {
00719 
00720 template <typename T0 = void, typename T1 = void, typename T2 = void,
00721     typename T3 = void, typename T4 = void, typename T5 = void,
00722     typename T6 = void, typename T7 = void, typename T8 = void,
00723     typename T9 = void>
00724 class tuple;
00725 
00726 // Anything in namespace gtest_internal is Google Test's INTERNAL
00727 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
00728 namespace gtest_internal {
00729 
00730 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
00731 template <typename T>
00732 struct ByRef { typedef const T& type; };  // NOLINT
00733 template <typename T>
00734 struct ByRef<T&> { typedef T& type; };  // NOLINT
00735 
00736 // A handy wrapper for ByRef.
00737 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
00738 
00739 // AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
00740 // is the same as tr1::add_reference<T>::type.
00741 template <typename T>
00742 struct AddRef { typedef T& type; };  // NOLINT
00743 template <typename T>
00744 struct AddRef<T&> { typedef T& type; };  // NOLINT
00745 
00746 // A handy wrapper for AddRef.
00747 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
00748 
00749 // A helper for implementing get<k>().
00750 template <int k> class Get;
00751 
00752 // A helper for implementing tuple_element<k, T>.  kIndexValid is true
00753 // iff k < the number of fields in tuple type T.
00754 template <bool kIndexValid, int kIndex, class Tuple>
00755 struct TupleElement;
00756 
00757 template <GTEST_10_TYPENAMES_(T)>
00758 struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> {
00759   typedef T0 type;
00760 };
00761 
00762 template <GTEST_10_TYPENAMES_(T)>
00763 struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> {
00764   typedef T1 type;
00765 };
00766 
00767 template <GTEST_10_TYPENAMES_(T)>
00768 struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> {
00769   typedef T2 type;
00770 };
00771 
00772 template <GTEST_10_TYPENAMES_(T)>
00773 struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> {
00774   typedef T3 type;
00775 };
00776 
00777 template <GTEST_10_TYPENAMES_(T)>
00778 struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> {
00779   typedef T4 type;
00780 };
00781 
00782 template <GTEST_10_TYPENAMES_(T)>
00783 struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> {
00784   typedef T5 type;
00785 };
00786 
00787 template <GTEST_10_TYPENAMES_(T)>
00788 struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> {
00789   typedef T6 type;
00790 };
00791 
00792 template <GTEST_10_TYPENAMES_(T)>
00793 struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> {
00794   typedef T7 type;
00795 };
00796 
00797 template <GTEST_10_TYPENAMES_(T)>
00798 struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> {
00799   typedef T8 type;
00800 };
00801 
00802 template <GTEST_10_TYPENAMES_(T)>
00803 struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> {
00804   typedef T9 type;
00805 };
00806 
00807 }  // namespace gtest_internal
00808 
00809 template <>
00810 class tuple<> {
00811  public:
00812   tuple() {}
00813   tuple(const tuple& /* t */)  {}
00814   tuple& operator=(const tuple& /* t */) { return *this; }
00815 };
00816 
00817 template <GTEST_1_TYPENAMES_(T)>
00818 class GTEST_1_TUPLE_(T) {
00819  public:
00820   template <int k> friend class gtest_internal::Get;
00821 
00822   tuple() : f0_() {}
00823 
00824   explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
00825 
00826   tuple(const tuple& t) : f0_(t.f0_) {}
00827 
00828   template <GTEST_1_TYPENAMES_(U)>
00829   tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
00830 
00831   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00832 
00833   template <GTEST_1_TYPENAMES_(U)>
00834   tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
00835     return CopyFrom(t);
00836   }
00837 
00838   GTEST_DECLARE_TUPLE_AS_FRIEND_
00839 
00840   template <GTEST_1_TYPENAMES_(U)>
00841   tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
00842     f0_ = t.f0_;
00843     return *this;
00844   }
00845 
00846   T0 f0_;
00847 };
00848 
00849 template <GTEST_2_TYPENAMES_(T)>
00850 class GTEST_2_TUPLE_(T) {
00851  public:
00852   template <int k> friend class gtest_internal::Get;
00853 
00854   tuple() : f0_(), f1_() {}
00855 
00856   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
00857       f1_(f1) {}
00858 
00859   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
00860 
00861   template <GTEST_2_TYPENAMES_(U)>
00862   tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
00863   template <typename U0, typename U1>
00864   tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
00865 
00866   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00867 
00868   template <GTEST_2_TYPENAMES_(U)>
00869   tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
00870     return CopyFrom(t);
00871   }
00872   template <typename U0, typename U1>
00873   tuple& operator=(const ::std::pair<U0, U1>& p) {
00874     f0_ = p.first;
00875     f1_ = p.second;
00876     return *this;
00877   }
00878 
00879   GTEST_DECLARE_TUPLE_AS_FRIEND_
00880 
00881   template <GTEST_2_TYPENAMES_(U)>
00882   tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
00883     f0_ = t.f0_;
00884     f1_ = t.f1_;
00885     return *this;
00886   }
00887 
00888   T0 f0_;
00889   T1 f1_;
00890 };
00891 
00892 template <GTEST_3_TYPENAMES_(T)>
00893 class GTEST_3_TUPLE_(T) {
00894  public:
00895   template <int k> friend class gtest_internal::Get;
00896 
00897   tuple() : f0_(), f1_(), f2_() {}
00898 
00899   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00900       GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
00901 
00902   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
00903 
00904   template <GTEST_3_TYPENAMES_(U)>
00905   tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
00906 
00907   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00908 
00909   template <GTEST_3_TYPENAMES_(U)>
00910   tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
00911     return CopyFrom(t);
00912   }
00913 
00914   GTEST_DECLARE_TUPLE_AS_FRIEND_
00915 
00916   template <GTEST_3_TYPENAMES_(U)>
00917   tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
00918     f0_ = t.f0_;
00919     f1_ = t.f1_;
00920     f2_ = t.f2_;
00921     return *this;
00922   }
00923 
00924   T0 f0_;
00925   T1 f1_;
00926   T2 f2_;
00927 };
00928 
00929 template <GTEST_4_TYPENAMES_(T)>
00930 class GTEST_4_TUPLE_(T) {
00931  public:
00932   template <int k> friend class gtest_internal::Get;
00933 
00934   tuple() : f0_(), f1_(), f2_(), f3_() {}
00935 
00936   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00937       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
00938       f3_(f3) {}
00939 
00940   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
00941 
00942   template <GTEST_4_TYPENAMES_(U)>
00943   tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
00944       f3_(t.f3_) {}
00945 
00946   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00947 
00948   template <GTEST_4_TYPENAMES_(U)>
00949   tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
00950     return CopyFrom(t);
00951   }
00952 
00953   GTEST_DECLARE_TUPLE_AS_FRIEND_
00954 
00955   template <GTEST_4_TYPENAMES_(U)>
00956   tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
00957     f0_ = t.f0_;
00958     f1_ = t.f1_;
00959     f2_ = t.f2_;
00960     f3_ = t.f3_;
00961     return *this;
00962   }
00963 
00964   T0 f0_;
00965   T1 f1_;
00966   T2 f2_;
00967   T3 f3_;
00968 };
00969 
00970 template <GTEST_5_TYPENAMES_(T)>
00971 class GTEST_5_TUPLE_(T) {
00972  public:
00973   template <int k> friend class gtest_internal::Get;
00974 
00975   tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
00976 
00977   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00978       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
00979       GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
00980 
00981   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
00982       f4_(t.f4_) {}
00983 
00984   template <GTEST_5_TYPENAMES_(U)>
00985   tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
00986       f3_(t.f3_), f4_(t.f4_) {}
00987 
00988   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00989 
00990   template <GTEST_5_TYPENAMES_(U)>
00991   tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
00992     return CopyFrom(t);
00993   }
00994 
00995   GTEST_DECLARE_TUPLE_AS_FRIEND_
00996 
00997   template <GTEST_5_TYPENAMES_(U)>
00998   tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
00999     f0_ = t.f0_;
01000     f1_ = t.f1_;
01001     f2_ = t.f2_;
01002     f3_ = t.f3_;
01003     f4_ = t.f4_;
01004     return *this;
01005   }
01006 
01007   T0 f0_;
01008   T1 f1_;
01009   T2 f2_;
01010   T3 f3_;
01011   T4 f4_;
01012 };
01013 
01014 template <GTEST_6_TYPENAMES_(T)>
01015 class GTEST_6_TUPLE_(T) {
01016  public:
01017   template <int k> friend class gtest_internal::Get;
01018 
01019   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
01020 
01021   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01022       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01023       GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01024       f5_(f5) {}
01025 
01026   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01027       f4_(t.f4_), f5_(t.f5_) {}
01028 
01029   template <GTEST_6_TYPENAMES_(U)>
01030   tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01031       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
01032 
01033   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01034 
01035   template <GTEST_6_TYPENAMES_(U)>
01036   tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
01037     return CopyFrom(t);
01038   }
01039 
01040   GTEST_DECLARE_TUPLE_AS_FRIEND_
01041 
01042   template <GTEST_6_TYPENAMES_(U)>
01043   tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
01044     f0_ = t.f0_;
01045     f1_ = t.f1_;
01046     f2_ = t.f2_;
01047     f3_ = t.f3_;
01048     f4_ = t.f4_;
01049     f5_ = t.f5_;
01050     return *this;
01051   }
01052 
01053   T0 f0_;
01054   T1 f1_;
01055   T2 f2_;
01056   T3 f3_;
01057   T4 f4_;
01058   T5 f5_;
01059 };
01060 
01061 template <GTEST_7_TYPENAMES_(T)>
01062 class GTEST_7_TUPLE_(T) {
01063  public:
01064   template <int k> friend class gtest_internal::Get;
01065 
01066   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
01067 
01068   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01069       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01070       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
01071       f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
01072 
01073   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01074       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
01075 
01076   template <GTEST_7_TYPENAMES_(U)>
01077   tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01078       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
01079 
01080   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01081 
01082   template <GTEST_7_TYPENAMES_(U)>
01083   tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
01084     return CopyFrom(t);
01085   }
01086 
01087   GTEST_DECLARE_TUPLE_AS_FRIEND_
01088 
01089   template <GTEST_7_TYPENAMES_(U)>
01090   tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
01091     f0_ = t.f0_;
01092     f1_ = t.f1_;
01093     f2_ = t.f2_;
01094     f3_ = t.f3_;
01095     f4_ = t.f4_;
01096     f5_ = t.f5_;
01097     f6_ = t.f6_;
01098     return *this;
01099   }
01100 
01101   T0 f0_;
01102   T1 f1_;
01103   T2 f2_;
01104   T3 f3_;
01105   T4 f4_;
01106   T5 f5_;
01107   T6 f6_;
01108 };
01109 
01110 template <GTEST_8_TYPENAMES_(T)>
01111 class GTEST_8_TUPLE_(T) {
01112  public:
01113   template <int k> friend class gtest_internal::Get;
01114 
01115   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
01116 
01117   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01118       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01119       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
01120       GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01121       f5_(f5), f6_(f6), f7_(f7) {}
01122 
01123   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01124       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
01125 
01126   template <GTEST_8_TYPENAMES_(U)>
01127   tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01128       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
01129 
01130   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01131 
01132   template <GTEST_8_TYPENAMES_(U)>
01133   tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
01134     return CopyFrom(t);
01135   }
01136 
01137   GTEST_DECLARE_TUPLE_AS_FRIEND_
01138 
01139   template <GTEST_8_TYPENAMES_(U)>
01140   tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
01141     f0_ = t.f0_;
01142     f1_ = t.f1_;
01143     f2_ = t.f2_;
01144     f3_ = t.f3_;
01145     f4_ = t.f4_;
01146     f5_ = t.f5_;
01147     f6_ = t.f6_;
01148     f7_ = t.f7_;
01149     return *this;
01150   }
01151 
01152   T0 f0_;
01153   T1 f1_;
01154   T2 f2_;
01155   T3 f3_;
01156   T4 f4_;
01157   T5 f5_;
01158   T6 f6_;
01159   T7 f7_;
01160 };
01161 
01162 template <GTEST_9_TYPENAMES_(T)>
01163 class GTEST_9_TUPLE_(T) {
01164  public:
01165   template <int k> friend class gtest_internal::Get;
01166 
01167   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
01168 
01169   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01170       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01171       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
01172       GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01173       f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
01174 
01175   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01176       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
01177 
01178   template <GTEST_9_TYPENAMES_(U)>
01179   tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01180       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
01181 
01182   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01183 
01184   template <GTEST_9_TYPENAMES_(U)>
01185   tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
01186     return CopyFrom(t);
01187   }
01188 
01189   GTEST_DECLARE_TUPLE_AS_FRIEND_
01190 
01191   template <GTEST_9_TYPENAMES_(U)>
01192   tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
01193     f0_ = t.f0_;
01194     f1_ = t.f1_;
01195     f2_ = t.f2_;
01196     f3_ = t.f3_;
01197     f4_ = t.f4_;
01198     f5_ = t.f5_;
01199     f6_ = t.f6_;
01200     f7_ = t.f7_;
01201     f8_ = t.f8_;
01202     return *this;
01203   }
01204 
01205   T0 f0_;
01206   T1 f1_;
01207   T2 f2_;
01208   T3 f3_;
01209   T4 f4_;
01210   T5 f5_;
01211   T6 f6_;
01212   T7 f7_;
01213   T8 f8_;
01214 };
01215 
01216 template <GTEST_10_TYPENAMES_(T)>
01217 class tuple {
01218  public:
01219   template <int k> friend class gtest_internal::Get;
01220 
01221   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
01222       f9_() {}
01223 
01224   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01225       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01226       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
01227       GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
01228       f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
01229 
01230   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01231       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
01232 
01233   template <GTEST_10_TYPENAMES_(U)>
01234   tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01235       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
01236       f9_(t.f9_) {}
01237 
01238   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01239 
01240   template <GTEST_10_TYPENAMES_(U)>
01241   tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
01242     return CopyFrom(t);
01243   }
01244 
01245   GTEST_DECLARE_TUPLE_AS_FRIEND_
01246 
01247   template <GTEST_10_TYPENAMES_(U)>
01248   tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
01249     f0_ = t.f0_;
01250     f1_ = t.f1_;
01251     f2_ = t.f2_;
01252     f3_ = t.f3_;
01253     f4_ = t.f4_;
01254     f5_ = t.f5_;
01255     f6_ = t.f6_;
01256     f7_ = t.f7_;
01257     f8_ = t.f8_;
01258     f9_ = t.f9_;
01259     return *this;
01260   }
01261 
01262   T0 f0_;
01263   T1 f1_;
01264   T2 f2_;
01265   T3 f3_;
01266   T4 f4_;
01267   T5 f5_;
01268   T6 f6_;
01269   T7 f7_;
01270   T8 f8_;
01271   T9 f9_;
01272 };
01273 
01274 // 6.1.3.2 Tuple creation functions.
01275 
01276 // Known limitations: we don't support passing an
01277 // std::tr1::reference_wrapper<T> to make_tuple().  And we don't
01278 // implement tie().
01279 
01280 inline tuple<> make_tuple() { return tuple<>(); }
01281 
01282 template <GTEST_1_TYPENAMES_(T)>
01283 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
01284   return GTEST_1_TUPLE_(T)(f0);
01285 }
01286 
01287 template <GTEST_2_TYPENAMES_(T)>
01288 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
01289   return GTEST_2_TUPLE_(T)(f0, f1);
01290 }
01291 
01292 template <GTEST_3_TYPENAMES_(T)>
01293 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
01294   return GTEST_3_TUPLE_(T)(f0, f1, f2);
01295 }
01296 
01297 template <GTEST_4_TYPENAMES_(T)>
01298 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01299     const T3& f3) {
01300   return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
01301 }
01302 
01303 template <GTEST_5_TYPENAMES_(T)>
01304 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01305     const T3& f3, const T4& f4) {
01306   return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
01307 }
01308 
01309 template <GTEST_6_TYPENAMES_(T)>
01310 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01311     const T3& f3, const T4& f4, const T5& f5) {
01312   return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
01313 }
01314 
01315 template <GTEST_7_TYPENAMES_(T)>
01316 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01317     const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
01318   return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
01319 }
01320 
01321 template <GTEST_8_TYPENAMES_(T)>
01322 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01323     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
01324   return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
01325 }
01326 
01327 template <GTEST_9_TYPENAMES_(T)>
01328 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01329     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
01330     const T8& f8) {
01331   return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
01332 }
01333 
01334 template <GTEST_10_TYPENAMES_(T)>
01335 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01336     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
01337     const T8& f8, const T9& f9) {
01338   return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
01339 }
01340 
01341 // 6.1.3.3 Tuple helper classes.
01342 
01343 template <typename Tuple> struct tuple_size;
01344 
01345 template <GTEST_0_TYPENAMES_(T)>
01346 struct tuple_size<GTEST_0_TUPLE_(T)> {
01347   static const int value = 0;
01348 };
01349 
01350 template <GTEST_1_TYPENAMES_(T)>
01351 struct tuple_size<GTEST_1_TUPLE_(T)> {
01352   static const int value = 1;
01353 };
01354 
01355 template <GTEST_2_TYPENAMES_(T)>
01356 struct tuple_size<GTEST_2_TUPLE_(T)> {
01357   static const int value = 2;
01358 };
01359 
01360 template <GTEST_3_TYPENAMES_(T)>
01361 struct tuple_size<GTEST_3_TUPLE_(T)> {
01362   static const int value = 3;
01363 };
01364 
01365 template <GTEST_4_TYPENAMES_(T)>
01366 struct tuple_size<GTEST_4_TUPLE_(T)> {
01367   static const int value = 4;
01368 };
01369 
01370 template <GTEST_5_TYPENAMES_(T)>
01371 struct tuple_size<GTEST_5_TUPLE_(T)> {
01372   static const int value = 5;
01373 };
01374 
01375 template <GTEST_6_TYPENAMES_(T)>
01376 struct tuple_size<GTEST_6_TUPLE_(T)> {
01377   static const int value = 6;
01378 };
01379 
01380 template <GTEST_7_TYPENAMES_(T)>
01381 struct tuple_size<GTEST_7_TUPLE_(T)> {
01382   static const int value = 7;
01383 };
01384 
01385 template <GTEST_8_TYPENAMES_(T)>
01386 struct tuple_size<GTEST_8_TUPLE_(T)> {
01387   static const int value = 8;
01388 };
01389 
01390 template <GTEST_9_TYPENAMES_(T)>
01391 struct tuple_size<GTEST_9_TUPLE_(T)> {
01392   static const int value = 9;
01393 };
01394 
01395 template <GTEST_10_TYPENAMES_(T)>
01396 struct tuple_size<GTEST_10_TUPLE_(T)> {
01397   static const int value = 10;
01398 };
01399 
01400 template <int k, class Tuple>
01401 struct tuple_element {
01402   typedef typename gtest_internal::TupleElement<
01403       k < (tuple_size<Tuple>::value), k, Tuple>::type type;
01404 };
01405 
01406 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
01407 
01408 // 6.1.3.4 Element access.
01409 
01410 namespace gtest_internal {
01411 
01412 template <>
01413 class Get<0> {
01414  public:
01415   template <class Tuple>
01416   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
01417   Field(Tuple& t) { return t.f0_; }  // NOLINT
01418 
01419   template <class Tuple>
01420   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
01421   ConstField(const Tuple& t) { return t.f0_; }
01422 };
01423 
01424 template <>
01425 class Get<1> {
01426  public:
01427   template <class Tuple>
01428   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
01429   Field(Tuple& t) { return t.f1_; }  // NOLINT
01430 
01431   template <class Tuple>
01432   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
01433   ConstField(const Tuple& t) { return t.f1_; }
01434 };
01435 
01436 template <>
01437 class Get<2> {
01438  public:
01439   template <class Tuple>
01440   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
01441   Field(Tuple& t) { return t.f2_; }  // NOLINT
01442 
01443   template <class Tuple>
01444   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
01445   ConstField(const Tuple& t) { return t.f2_; }
01446 };
01447 
01448 template <>
01449 class Get<3> {
01450  public:
01451   template <class Tuple>
01452   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
01453   Field(Tuple& t) { return t.f3_; }  // NOLINT
01454 
01455   template <class Tuple>
01456   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
01457   ConstField(const Tuple& t) { return t.f3_; }
01458 };
01459 
01460 template <>
01461 class Get<4> {
01462  public:
01463   template <class Tuple>
01464   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
01465   Field(Tuple& t) { return t.f4_; }  // NOLINT
01466 
01467   template <class Tuple>
01468   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
01469   ConstField(const Tuple& t) { return t.f4_; }
01470 };
01471 
01472 template <>
01473 class Get<5> {
01474  public:
01475   template <class Tuple>
01476   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
01477   Field(Tuple& t) { return t.f5_; }  // NOLINT
01478 
01479   template <class Tuple>
01480   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
01481   ConstField(const Tuple& t) { return t.f5_; }
01482 };
01483 
01484 template <>
01485 class Get<6> {
01486  public:
01487   template <class Tuple>
01488   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
01489   Field(Tuple& t) { return t.f6_; }  // NOLINT
01490 
01491   template <class Tuple>
01492   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
01493   ConstField(const Tuple& t) { return t.f6_; }
01494 };
01495 
01496 template <>
01497 class Get<7> {
01498  public:
01499   template <class Tuple>
01500   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
01501   Field(Tuple& t) { return t.f7_; }  // NOLINT
01502 
01503   template <class Tuple>
01504   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
01505   ConstField(const Tuple& t) { return t.f7_; }
01506 };
01507 
01508 template <>
01509 class Get<8> {
01510  public:
01511   template <class Tuple>
01512   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
01513   Field(Tuple& t) { return t.f8_; }  // NOLINT
01514 
01515   template <class Tuple>
01516   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
01517   ConstField(const Tuple& t) { return t.f8_; }
01518 };
01519 
01520 template <>
01521 class Get<9> {
01522  public:
01523   template <class Tuple>
01524   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
01525   Field(Tuple& t) { return t.f9_; }  // NOLINT
01526 
01527   template <class Tuple>
01528   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
01529   ConstField(const Tuple& t) { return t.f9_; }
01530 };
01531 
01532 }  // namespace gtest_internal
01533 
01534 template <int k, GTEST_10_TYPENAMES_(T)>
01535 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
01536 get(GTEST_10_TUPLE_(T)& t) {
01537   return gtest_internal::Get<k>::Field(t);
01538 }
01539 
01540 template <int k, GTEST_10_TYPENAMES_(T)>
01541 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
01542 get(const GTEST_10_TUPLE_(T)& t) {
01543   return gtest_internal::Get<k>::ConstField(t);
01544 }
01545 
01546 // 6.1.3.5 Relational operators
01547 
01548 // We only implement == and !=, as we don't have a need for the rest yet.
01549 
01550 namespace gtest_internal {
01551 
01552 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
01553 // first k fields of t1 equals the first k fields of t2.
01554 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
01555 // k1 != k2.
01556 template <int kSize1, int kSize2>
01557 struct SameSizeTuplePrefixComparator;
01558 
01559 template <>
01560 struct SameSizeTuplePrefixComparator<0, 0> {
01561   template <class Tuple1, class Tuple2>
01562   static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
01563     return true;
01564   }
01565 };
01566 
01567 template <int k>
01568 struct SameSizeTuplePrefixComparator<k, k> {
01569   template <class Tuple1, class Tuple2>
01570   static bool Eq(const Tuple1& t1, const Tuple2& t2) {
01571     return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
01572         ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
01573   }
01574 };
01575 
01576 }  // namespace gtest_internal
01577 
01578 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
01579 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
01580                        const GTEST_10_TUPLE_(U)& u) {
01581   return gtest_internal::SameSizeTuplePrefixComparator<
01582       tuple_size<GTEST_10_TUPLE_(T)>::value,
01583       tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
01584 }
01585 
01586 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
01587 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
01588                        const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
01589 
01590 // 6.1.4 Pairs.
01591 // Unimplemented.
01592 
01593 }  // namespace tr1
01594 }  // namespace std
01595 
01596 #undef GTEST_0_TUPLE_
01597 #undef GTEST_1_TUPLE_
01598 #undef GTEST_2_TUPLE_
01599 #undef GTEST_3_TUPLE_
01600 #undef GTEST_4_TUPLE_
01601 #undef GTEST_5_TUPLE_
01602 #undef GTEST_6_TUPLE_
01603 #undef GTEST_7_TUPLE_
01604 #undef GTEST_8_TUPLE_
01605 #undef GTEST_9_TUPLE_
01606 #undef GTEST_10_TUPLE_
01607 
01608 #undef GTEST_0_TYPENAMES_
01609 #undef GTEST_1_TYPENAMES_
01610 #undef GTEST_2_TYPENAMES_
01611 #undef GTEST_3_TYPENAMES_
01612 #undef GTEST_4_TYPENAMES_
01613 #undef GTEST_5_TYPENAMES_
01614 #undef GTEST_6_TYPENAMES_
01615 #undef GTEST_7_TYPENAMES_
01616 #undef GTEST_8_TYPENAMES_
01617 #undef GTEST_9_TYPENAMES_
01618 #undef GTEST_10_TYPENAMES_
01619 
01620 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
01621 #undef GTEST_BY_REF_
01622 #undef GTEST_ADD_REF_
01623 #undef GTEST_TUPLE_ELEMENT_
01624 
01625 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
01626 # elif GTEST_OS_SYMBIAN
01627 
01628 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
01629 // use STLport's tuple implementation, which unfortunately doesn't
01630 // work as the copy of STLport distributed with Symbian is incomplete.
01631 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
01632 // use its own tuple implementation.
01633 #  ifdef BOOST_HAS_TR1_TUPLE
01634 #   undef BOOST_HAS_TR1_TUPLE
01635 #  endif  // BOOST_HAS_TR1_TUPLE
01636 
01637 // This prevents <boost/tr1/detail/config.hpp>, which defines
01638 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
01639 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
01640 #  include <tuple>
01641 
01642 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
01643 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
01644 // not conform to the TR1 spec, which requires the header to be <tuple>.
01645 
01646 #  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
01647 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
01648 // which is #included by <tr1/tuple>, to not compile when RTTI is
01649 // disabled.  _TR1_FUNCTIONAL is the header guard for
01650 // <tr1/functional>.  Hence the following #define is a hack to prevent
01651 // <tr1/functional> from being included.
01652 #   define _TR1_FUNCTIONAL 1
01653 #   include <tr1/tuple>
01654 #   undef _TR1_FUNCTIONAL  // Allows the user to #include
01655                         // <tr1/functional> if he chooses to.
01656 #  else
01657 #  if defined (__cplusplus) && __cplusplus > 199711L
01658 #   include <tuple>
01659 namespace std {
01660     namespace tr1 {
01661         using std::tuple;
01662         using std::tuple_element;
01663         using std::get;
01664         using std::tuple_size;
01665         using std::make_tuple;
01666     }
01667 }
01668 #  else
01669 #   include <tr1/tuple>  // NOLINT
01670 #  endif
01671 
01672 #  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
01673 
01674 # else
01675 // If the compiler is not GCC 4.0+, we assume the user is using a
01676 // spec-conforming TR1 implementation.
01677 #  include <tuple>  // NOLINT
01678 # endif  // GTEST_USE_OWN_TR1_TUPLE
01679 
01680 #endif  // GTEST_HAS_TR1_TUPLE
01681 
01682 // Determines whether clone(2) is supported.
01683 // Usually it will only be available on Linux, excluding
01684 // Linux on the Itanium architecture.
01685 // Also see http://linux.die.net/man/2/clone.
01686 #ifndef GTEST_HAS_CLONE
01687 // The user didn't tell us, so we need to figure it out.
01688 
01689 # if GTEST_OS_LINUX && !defined(__ia64__)
01690 #  define GTEST_HAS_CLONE 1
01691 # else
01692 #  define GTEST_HAS_CLONE 0
01693 # endif  // GTEST_OS_LINUX && !defined(__ia64__)
01694 
01695 #endif  // GTEST_HAS_CLONE
01696 
01697 // Determines whether to support stream redirection. This is used to test
01698 // output correctness and to implement death tests.
01699 #ifndef GTEST_HAS_STREAM_REDIRECTION
01700 // By default, we assume that stream redirection is supported on all
01701 // platforms except known mobile ones.
01702 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
01703 #  define GTEST_HAS_STREAM_REDIRECTION 0
01704 # else
01705 #  define GTEST_HAS_STREAM_REDIRECTION 1
01706 # endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
01707 #endif  // GTEST_HAS_STREAM_REDIRECTION
01708 
01709 // Determines whether to support death tests.
01710 // Google Test does not support death tests for VC 7.1 and earlier as
01711 // abort() in a VC 7.1 application compiled as GUI in debug config
01712 // pops up a dialog window that cannot be suppressed programmatically.
01713 #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
01714      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
01715      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
01716      GTEST_OS_OPENBSD || GTEST_OS_QNX)
01717 # define GTEST_HAS_DEATH_TEST 1
01718 # include <vector>  // NOLINT
01719 #else
01720 # define GTEST_HAS_DEATH_TEST 0
01721 #endif
01722 
01723 // We don't support MSVC 7.1 with exceptions disabled now.  Therefore
01724 // all the compilers we care about are adequate for supporting
01725 // value-parameterized tests.
01726 #define GTEST_HAS_PARAM_TEST 1
01727 
01728 // Determines whether to support type-driven tests.
01729 
01730 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
01731 // Sun Pro CC, IBM Visual Age, and HP aCC support.
01732 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
01733     defined(__IBMCPP__) || defined(__HP_aCC)
01734 # define GTEST_HAS_TYPED_TEST 1
01735 # define GTEST_HAS_TYPED_TEST_P 1
01736 #endif
01737 
01738 // Determines whether to support Combine(). This only makes sense when
01739 // value-parameterized tests are enabled.  The implementation doesn't
01740 // work on Sun Studio since it doesn't understand templated conversion
01741 // operators.
01742 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
01743 # define GTEST_HAS_COMBINE 1
01744 #endif
01745 
01746 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
01747 #define GTEST_WIDE_STRING_USES_UTF16_ \
01748     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
01749 
01750 // Determines whether test results can be streamed to a socket.
01751 #if GTEST_OS_LINUX
01752 # define GTEST_CAN_STREAM_RESULTS_ 1
01753 #else
01754 # define GTEST_CAN_STREAM_RESULTS_ 0
01755 #endif
01756 
01757 // Defines some utility macros.
01758 
01759 // The GNU compiler emits a warning if nested "if" statements are followed by
01760 // an "else" statement and braces are not used to explicitly disambiguate the
01761 // "else" binding.  This leads to problems with code like:
01762 //
01763 //   if (gate)
01764 //     ASSERT_*(condition) << "Some message";
01765 //
01766 // The "switch (0) case 0:" idiom is used to suppress this.
01767 #ifdef __INTEL_COMPILER
01768 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
01769 #else
01770 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
01771 #endif
01772 
01773 // Use this annotation at the end of a struct/class definition to
01774 // prevent the compiler from optimizing away instances that are never
01775 // used.  This is useful when all interesting logic happens inside the
01776 // c'tor and / or d'tor.  Example:
01777 //
01778 //   struct Foo {
01779 //     Foo() { ... }
01780 //   } GTEST_ATTRIBUTE_UNUSED_;
01781 //
01782 // Also use it after a variable or parameter declaration to tell the
01783 // compiler the variable/parameter does not have to be used.
01784 #if defined(__GNUC__) && !defined(COMPILER_ICC)
01785 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
01786 #else
01787 # define GTEST_ATTRIBUTE_UNUSED_
01788 #endif
01789 
01790 // A macro to disallow operator=
01791 // This should be used in the private: declarations for a class.
01792 #define GTEST_DISALLOW_ASSIGN_(type)\
01793   void operator=(type const &)
01794 
01795 // A macro to disallow copy constructor and operator=
01796 // This should be used in the private: declarations for a class.
01797 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
01798   type(type const &);\
01799   GTEST_DISALLOW_ASSIGN_(type)
01800 
01801 // Tell the compiler to warn about unused return values for functions declared
01802 // with this macro.  The macro should be used on function declarations
01803 // following the argument list:
01804 //
01805 //   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
01806 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
01807 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
01808 #else
01809 # define GTEST_MUST_USE_RESULT_
01810 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
01811 
01812 // Determine whether the compiler supports Microsoft's Structured Exception
01813 // Handling.  This is supported by several Windows compilers but generally
01814 // does not exist on any other system.
01815 #ifndef GTEST_HAS_SEH
01816 // The user didn't tell us, so we need to figure it out.
01817 
01818 # if defined(_MSC_VER) || defined(__BORLANDC__)
01819 // These two compilers are known to support SEH.
01820 #  define GTEST_HAS_SEH 1
01821 # else
01822 // Assume no SEH.
01823 #  define GTEST_HAS_SEH 0
01824 # endif
01825 
01826 #endif  // GTEST_HAS_SEH
01827 
01828 #ifdef _MSC_VER
01829 
01830 # if GTEST_LINKED_AS_SHARED_LIBRARY
01831 #  define GTEST_API_ __declspec(dllimport)
01832 # elif GTEST_CREATE_SHARED_LIBRARY
01833 #  define GTEST_API_ __declspec(dllexport)
01834 # endif
01835 
01836 #endif  // _MSC_VER
01837 
01838 #ifndef GTEST_API_
01839 # define GTEST_API_
01840 #endif
01841 
01842 #ifdef __GNUC__
01843 // Ask the compiler to never inline a given function.
01844 # define GTEST_NO_INLINE_ __attribute__((noinline))
01845 #else
01846 # define GTEST_NO_INLINE_
01847 #endif
01848 
01849 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
01850 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
01851 # define GTEST_HAS_CXXABI_H_ 1
01852 #else
01853 # define GTEST_HAS_CXXABI_H_ 0
01854 #endif
01855 
01856 namespace testing {
01857 
01858 class Message;
01859 
01860 namespace internal {
01861 
01862 class String;
01863 
01864 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
01865 // expression is true. For example, you could use it to verify the
01866 // size of a static array:
01867 //
01868 //   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
01869 //                         content_type_names_incorrect_size);
01870 //
01871 // or to make sure a struct is smaller than a certain size:
01872 //
01873 //   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
01874 //
01875 // The second argument to the macro is the name of the variable. If
01876 // the expression is false, most compilers will issue a warning/error
01877 // containing the name of the variable.
01878 
01879 template <bool>
01880 struct CompileAssert {
01881 };
01882 
01883 #define GTEST_COMPILE_ASSERT_(expr, msg) \
01884   typedef ::testing::internal::CompileAssert<(bool(expr))> \
01885       msg[bool(expr) ? 1 : -1]
01886 
01887 // Implementation details of GTEST_COMPILE_ASSERT_:
01888 //
01889 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
01890 //   elements (and thus is invalid) when the expression is false.
01891 //
01892 // - The simpler definition
01893 //
01894 //    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
01895 //
01896 //   does not work, as gcc supports variable-length arrays whose sizes
01897 //   are determined at run-time (this is gcc's extension and not part
01898 //   of the C++ standard).  As a result, gcc fails to reject the
01899 //   following code with the simple definition:
01900 //
01901 //     int foo;
01902 //     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
01903 //                                      // not a compile-time constant.
01904 //
01905 // - By using the type CompileAssert<(bool(expr))>, we ensures that
01906 //   expr is a compile-time constant.  (Template arguments must be
01907 //   determined at compile-time.)
01908 //
01909 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
01910 //   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
01911 //
01912 //     CompileAssert<bool(expr)>
01913 //
01914 //   instead, these compilers will refuse to compile
01915 //
01916 //     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
01917 //
01918 //   (They seem to think the ">" in "5 > 0" marks the end of the
01919 //   template argument list.)
01920 //
01921 // - The array size is (bool(expr) ? 1 : -1), instead of simply
01922 //
01923 //     ((expr) ? 1 : -1).
01924 //
01925 //   This is to avoid running into a bug in MS VC 7.1, which
01926 //   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
01927 
01928 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
01929 //
01930 // This template is declared, but intentionally undefined.
01931 template <typename T1, typename T2>
01932 struct StaticAssertTypeEqHelper;
01933 
01934 template <typename T>
01935 struct StaticAssertTypeEqHelper<T, T> {};
01936 
01937 #if GTEST_HAS_GLOBAL_STRING
01938 typedef ::string string;
01939 #else
01940 typedef ::std::string string;
01941 #endif  // GTEST_HAS_GLOBAL_STRING
01942 
01943 #if GTEST_HAS_GLOBAL_WSTRING
01944 typedef ::wstring wstring;
01945 #elif GTEST_HAS_STD_WSTRING
01946 typedef ::std::wstring wstring;
01947 #endif  // GTEST_HAS_GLOBAL_WSTRING
01948 
01949 // A helper for suppressing warnings on constant condition.  It just
01950 // returns 'condition'.
01951 GTEST_API_ bool IsTrue(bool condition);
01952 
01953 // Defines scoped_ptr.
01954 
01955 // This implementation of scoped_ptr is PARTIAL - it only contains
01956 // enough stuff to satisfy Google Test's need.
01957 template <typename T>
01958 class scoped_ptr {
01959  public:
01960   typedef T element_type;
01961 
01962   explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
01963   ~scoped_ptr() { reset(); }
01964 
01965   T& operator*() const { return *ptr_; }
01966   T* operator->() const { return ptr_; }
01967   T* get() const { return ptr_; }
01968 
01969   T* release() {
01970     T* const ptr = ptr_;
01971     ptr_ = NULL;
01972     return ptr;
01973   }
01974 
01975   void reset(T* p = NULL) {
01976     if (p != ptr_) {
01977       if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
01978         delete ptr_;
01979       }
01980       ptr_ = p;
01981     }
01982   }
01983 
01984  private:
01985   T* ptr_;
01986 
01987   GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
01988 };
01989 
01990 // Defines RE.
01991 
01992 // A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
01993 // Regular Expression syntax.
01994 class GTEST_API_ RE {
01995  public:
01996   // A copy constructor is required by the Standard to initialize object
01997   // references from r-values.
01998   RE(const RE& other) { Init(other.pattern()); }
01999 
02000   // Constructs an RE from a string.
02001   RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
02002 
02003 #if GTEST_HAS_GLOBAL_STRING
02004 
02005   RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
02006 
02007 #endif  // GTEST_HAS_GLOBAL_STRING
02008 
02009   RE(const char* regex) { Init(regex); }  // NOLINT
02010   ~RE();
02011 
02012   // Returns the string representation of the regex.
02013   const char* pattern() const { return pattern_; }
02014 
02015   // FullMatch(str, re) returns true iff regular expression re matches
02016   // the entire str.
02017   // PartialMatch(str, re) returns true iff regular expression re
02018   // matches a substring of str (including str itself).
02019   //
02020   // TODO(wan@google.com): make FullMatch() and PartialMatch() work
02021   // when str contains NUL characters.
02022   static bool FullMatch(const ::std::string& str, const RE& re) {
02023     return FullMatch(str.c_str(), re);
02024   }
02025   static bool PartialMatch(const ::std::string& str, const RE& re) {
02026     return PartialMatch(str.c_str(), re);
02027   }
02028 
02029 #if GTEST_HAS_GLOBAL_STRING
02030 
02031   static bool FullMatch(const ::string& str, const RE& re) {
02032     return FullMatch(str.c_str(), re);
02033   }
02034   static bool PartialMatch(const ::string& str, const RE& re) {
02035     return PartialMatch(str.c_str(), re);
02036   }
02037 
02038 #endif  // GTEST_HAS_GLOBAL_STRING
02039 
02040   static bool FullMatch(const char* str, const RE& re);
02041   static bool PartialMatch(const char* str, const RE& re);
02042 
02043  private:
02044   void Init(const char* regex);
02045 
02046   // We use a const char* instead of a string, as Google Test may be used
02047   // where string is not available.  We also do not use Google Test's own
02048   // String type here, in order to simplify dependencies between the
02049   // files.
02050   const char* pattern_;
02051   bool is_valid_;
02052 
02053 #if GTEST_USES_POSIX_RE
02054 
02055   regex_t full_regex_;     // For FullMatch().
02056   regex_t partial_regex_;  // For PartialMatch().
02057 
02058 #else  // GTEST_USES_SIMPLE_RE
02059 
02060   const char* full_pattern_;  // For FullMatch();
02061 
02062 #endif
02063 
02064   GTEST_DISALLOW_ASSIGN_(RE);
02065 };
02066 
02067 // Formats a source file path and a line number as they would appear
02068 // in an error message from the compiler used to compile this code.
02069 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
02070 
02071 // Formats a file location for compiler-independent XML output.
02072 // Although this function is not platform dependent, we put it next to
02073 // FormatFileLocation in order to contrast the two functions.
02074 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
02075                                                                int line);
02076 
02077 // Defines logging utilities:
02078 //   GTEST_LOG_(severity) - logs messages at the specified severity level. The
02079 //                          message itself is streamed into the macro.
02080 //   LogToStderr()  - directs all log messages to stderr.
02081 //   FlushInfoLog() - flushes informational log messages.
02082 
02083 enum GTestLogSeverity {
02084   GTEST_INFO,
02085   GTEST_WARNING,
02086   GTEST_ERROR,
02087   GTEST_FATAL
02088 };
02089 
02090 // Formats log entry severity, provides a stream object for streaming the
02091 // log message, and terminates the message with a newline when going out of
02092 // scope.
02093 class GTEST_API_ GTestLog {
02094  public:
02095   GTestLog(GTestLogSeverity severity, const char* file, int line);
02096 
02097   // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
02098   ~GTestLog();
02099 
02100   ::std::ostream& GetStream() { return ::std::cerr; }
02101 
02102  private:
02103   const GTestLogSeverity severity_;
02104 
02105   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
02106 };
02107 
02108 #define GTEST_LOG_(severity) \
02109     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
02110                                   __FILE__, __LINE__).GetStream()
02111 
02112 inline void LogToStderr() {}
02113 inline void FlushInfoLog() { fflush(NULL); }
02114 
02115 // INTERNAL IMPLEMENTATION - DO NOT USE.
02116 //
02117 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
02118 // is not satisfied.
02119 //  Synopsys:
02120 //    GTEST_CHECK_(boolean_condition);
02121 //     or
02122 //    GTEST_CHECK_(boolean_condition) << "Additional message";
02123 //
02124 //    This checks the condition and if the condition is not satisfied
02125 //    it prints message about the condition violation, including the
02126 //    condition itself, plus additional message streamed into it, if any,
02127 //    and then it aborts the program. It aborts the program irrespective of
02128 //    whether it is built in the debug mode or not.
02129 #define GTEST_CHECK_(condition) \
02130     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
02131     if (::testing::internal::IsTrue(condition)) \
02132       ; \
02133     else \
02134       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
02135 
02136 // An all-mode assert to verify that the given POSIX-style function
02137 // call returns 0 (indicating success).  Known limitation: this
02138 // doesn't expand to a balanced 'if' statement, so enclose the macro
02139 // in {} if you need to use it as the only statement in an 'if'
02140 // branch.
02141 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
02142   if (const int gtest_error = (posix_call)) \
02143     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
02144                       << gtest_error
02145 
02146 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
02147 //
02148 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
02149 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
02150 // const Foo*).  When you use ImplicitCast_, the compiler checks that
02151 // the cast is safe.  Such explicit ImplicitCast_s are necessary in
02152 // surprisingly many situations where C++ demands an exact type match
02153 // instead of an argument type convertable to a target type.
02154 //
02155 // The syntax for using ImplicitCast_ is the same as for static_cast:
02156 //
02157 //   ImplicitCast_<ToType>(expr)
02158 //
02159 // ImplicitCast_ would have been part of the C++ standard library,
02160 // but the proposal was submitted too late.  It will probably make
02161 // its way into the language in the future.
02162 //
02163 // This relatively ugly name is intentional. It prevents clashes with
02164 // similar functions users may have (e.g., implicit_cast). The internal
02165 // namespace alone is not enough because the function can be found by ADL.
02166 template<typename To>
02167 inline To ImplicitCast_(To x) { return x; }
02168 
02169 // When you upcast (that is, cast a pointer from type Foo to type
02170 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
02171 // always succeed.  When you downcast (that is, cast a pointer from
02172 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
02173 // how do you know the pointer is really of type SubclassOfFoo?  It
02174 // could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
02175 // when you downcast, you should use this macro.  In debug mode, we
02176 // use dynamic_cast<> to double-check the downcast is legal (we die
02177 // if it's not).  In normal mode, we do the efficient static_cast<>
02178 // instead.  Thus, it's important to test in debug mode to make sure
02179 // the cast is legal!
02180 //    This is the only place in the code we should use dynamic_cast<>.
02181 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
02182 // do RTTI (eg code like this:
02183 //    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
02184 //    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
02185 // You should design the code some other way not to need this.
02186 //
02187 // This relatively ugly name is intentional. It prevents clashes with
02188 // similar functions users may have (e.g., down_cast). The internal
02189 // namespace alone is not enough because the function can be found by ADL.
02190 template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
02191 inline To DownCast_(From* f) {  // so we only accept pointers
02192   // Ensures that To is a sub-type of From *.  This test is here only
02193   // for compile-time type checking, and has no overhead in an
02194   // optimized build at run-time, as it will be optimized away
02195   // completely.
02196   if (false) {
02197     const To to = NULL;
02198     ::testing::internal::ImplicitCast_<From*>(to);
02199   }
02200 
02201 #if GTEST_HAS_RTTI
02202   // RTTI: debug mode only!
02203   GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
02204 #endif
02205   return static_cast<To>(f);
02206 }
02207 
02208 // Downcasts the pointer of type Base to Derived.
02209 // Derived must be a subclass of Base. The parameter MUST
02210 // point to a class of type Derived, not any subclass of it.
02211 // When RTTI is available, the function performs a runtime
02212 // check to enforce this.
02213 template <class Derived, class Base>
02214 Derived* CheckedDowncastToActualType(Base* base) {
02215 #if GTEST_HAS_RTTI
02216   GTEST_CHECK_(typeid(*base) == typeid(Derived));
02217   return dynamic_cast<Derived*>(base);  // NOLINT
02218 #else
02219   return static_cast<Derived*>(base);  // Poor man's downcast.
02220 #endif
02221 }
02222 
02223 #if GTEST_HAS_STREAM_REDIRECTION
02224 
02225 // Defines the stderr capturer:
02226 //   CaptureStdout     - starts capturing stdout.
02227 //   GetCapturedStdout - stops capturing stdout and returns the captured string.
02228 //   CaptureStderr     - starts capturing stderr.
02229 //   GetCapturedStderr - stops capturing stderr and returns the captured string.
02230 //
02231 GTEST_API_ void CaptureStdout();
02232 GTEST_API_ String GetCapturedStdout();
02233 GTEST_API_ void CaptureStderr();
02234 GTEST_API_ String GetCapturedStderr();
02235 
02236 #endif  // GTEST_HAS_STREAM_REDIRECTION
02237 
02238 
02239 #if GTEST_HAS_DEATH_TEST
02240 
02241 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
02242 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
02243                              new_argvs);
02244 
02245 // A copy of all command line arguments.  Set by InitGoogleTest().
02246 extern ::std::vector<testing::internal::string> g_argvs;
02247 
02248 #endif  // GTEST_HAS_DEATH_TEST
02249 
02250 // Defines synchronization primitives.
02251 
02252 #if GTEST_HAS_PTHREAD
02253 
02254 // Sleeps for (roughly) n milli-seconds.  This function is only for
02255 // testing Google Test's own constructs.  Don't use it in user tests,
02256 // either directly or indirectly.
02257 inline void SleepMilliseconds(int n) {
02258   const timespec time = {
02259     0,                  // 0 seconds.
02260     n * 1000L * 1000L,  // And n ms.
02261   };
02262   nanosleep(&time, NULL);
02263 }
02264 
02265 // Allows a controller thread to pause execution of newly created
02266 // threads until notified.  Instances of this class must be created
02267 // and destroyed in the controller thread.
02268 //
02269 // This class is only for testing Google Test's own constructs. Do not
02270 // use it in user tests, either directly or indirectly.
02271 class Notification {
02272  public:
02273   Notification() : notified_(false) {
02274     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
02275   }
02276   ~Notification() {
02277     pthread_mutex_destroy(&mutex_);
02278   }
02279 
02280   // Notifies all threads created with this notification to start. Must
02281   // be called from the controller thread.
02282   void Notify() {
02283     pthread_mutex_lock(&mutex_);
02284     notified_ = true;
02285     pthread_mutex_unlock(&mutex_);
02286   }
02287 
02288   // Blocks until the controller thread notifies. Must be called from a test
02289   // thread.
02290   void WaitForNotification() {
02291     for (;;) {
02292       pthread_mutex_lock(&mutex_);
02293       const bool notified = notified_;
02294       pthread_mutex_unlock(&mutex_);
02295       if (notified)
02296         break;
02297       SleepMilliseconds(10);
02298     }
02299   }
02300 
02301  private:
02302   pthread_mutex_t mutex_;
02303   bool notified_;
02304 
02305   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
02306 };
02307 
02308 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
02309 // Consequently, it cannot select a correct instantiation of ThreadWithParam
02310 // in order to call its Run(). Introducing ThreadWithParamBase as a
02311 // non-templated base class for ThreadWithParam allows us to bypass this
02312 // problem.
02313 class ThreadWithParamBase {
02314  public:
02315   virtual ~ThreadWithParamBase() {}
02316   virtual void Run() = 0;
02317 };
02318 
02319 // pthread_create() accepts a pointer to a function type with the C linkage.
02320 // According to the Standard (7.5/1), function types with different linkages
02321 // are different even if they are otherwise identical.  Some compilers (for
02322 // example, SunStudio) treat them as different types.  Since class methods
02323 // cannot be defined with C-linkage we need to define a free C-function to
02324 // pass into pthread_create().
02325 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
02326   static_cast<ThreadWithParamBase*>(thread)->Run();
02327   return NULL;
02328 }
02329 
02330 // Helper class for testing Google Test's multi-threading constructs.
02331 // To use it, write:
02332 //
02333 //   void ThreadFunc(int param) { /* Do things with param */ }
02334 //   Notification thread_can_start;
02335 //   ...
02336 //   // The thread_can_start parameter is optional; you can supply NULL.
02337 //   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
02338 //   thread_can_start.Notify();
02339 //
02340 // These classes are only for testing Google Test's own constructs. Do
02341 // not use them in user tests, either directly or indirectly.
02342 template <typename T>
02343 class ThreadWithParam : public ThreadWithParamBase {
02344  public:
02345   typedef void (*UserThreadFunc)(T);
02346 
02347   ThreadWithParam(
02348       UserThreadFunc func, T param, Notification* thread_can_start)
02349       : func_(func),
02350         param_(param),
02351         thread_can_start_(thread_can_start),
02352         finished_(false) {
02353     ThreadWithParamBase* const base = this;
02354     // The thread can be created only after all fields except thread_
02355     // have been initialized.
02356     GTEST_CHECK_POSIX_SUCCESS_(
02357         pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
02358   }
02359   ~ThreadWithParam() { Join(); }
02360 
02361   void Join() {
02362     if (!finished_) {
02363       GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
02364       finished_ = true;
02365     }
02366   }
02367 
02368   virtual void Run() {
02369     if (thread_can_start_ != NULL)
02370       thread_can_start_->WaitForNotification();
02371     func_(param_);
02372   }
02373 
02374  private:
02375   const UserThreadFunc func_;  // User-supplied thread function.
02376   const T param_;  // User-supplied parameter to the thread function.
02377   // When non-NULL, used to block execution until the controller thread
02378   // notifies.
02379   Notification* const thread_can_start_;
02380   bool finished_;  // true iff we know that the thread function has finished.
02381   pthread_t thread_;  // The native thread object.
02382 
02383   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
02384 };
02385 
02386 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
02387 // are used in conjunction with class MutexLock:
02388 //
02389 //   Mutex mutex;
02390 //   ...
02391 //   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
02392 //                            // of the current scope.
02393 //
02394 // MutexBase implements behavior for both statically and dynamically
02395 // allocated mutexes.  Do not use MutexBase directly.  Instead, write
02396 // the following to define a static mutex:
02397 //
02398 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
02399 //
02400 // You can forward declare a static mutex like this:
02401 //
02402 //   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
02403 //
02404 // To create a dynamic mutex, just define an object of type Mutex.
02405 class MutexBase {
02406  public:
02407   // Acquires this mutex.
02408   void Lock() {
02409     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
02410     owner_ = pthread_self();
02411     has_owner_ = true;
02412   }
02413 
02414   // Releases this mutex.
02415   void Unlock() {
02416     // Since the lock is being released the owner_ field should no longer be
02417     // considered valid. We don't protect writing to has_owner_ here, as it's
02418     // the caller's responsibility to ensure that the current thread holds the
02419     // mutex when this is called.
02420     has_owner_ = false;
02421     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
02422   }
02423 
02424   // Does nothing if the current thread holds the mutex. Otherwise, crashes
02425   // with high probability.
02426   void AssertHeld() const {
02427     GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
02428         << "The current thread is not holding the mutex @" << this;
02429   }
02430 
02431   // A static mutex may be used before main() is entered.  It may even
02432   // be used before the dynamic initialization stage.  Therefore we
02433   // must be able to initialize a static mutex object at link time.
02434   // This means MutexBase has to be a POD and its member variables
02435   // have to be public.
02436  public:
02437   pthread_mutex_t mutex_;  // The underlying pthread mutex.
02438   // has_owner_ indicates whether the owner_ field below contains a valid thread
02439   // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
02440   // accesses to the owner_ field should be protected by a check of this field.
02441   // An alternative might be to memset() owner_ to all zeros, but there's no
02442   // guarantee that a zero'd pthread_t is necessarily invalid or even different
02443   // from pthread_self().
02444   bool has_owner_;
02445   pthread_t owner_;  // The thread holding the mutex.
02446 };
02447 
02448 // Forward-declares a static mutex.
02449 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
02450     extern ::testing::internal::MutexBase mutex
02451 
02452 // Defines and statically (i.e. at link time) initializes a static mutex.
02453 // The initialization list here does not explicitly initialize each field,
02454 // instead relying on default initialization for the unspecified fields. In
02455 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
02456 // This allows initialization to work whether pthread_t is a scalar or struct.
02457 // The flag -Wmissing-field-initializers must not be specified for this to work.
02458 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
02459     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
02460 
02461 // The Mutex class can only be used for mutexes created at runtime. It
02462 // shares its API with MutexBase otherwise.
02463 class Mutex : public MutexBase {
02464  public:
02465   Mutex() {
02466     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
02467     has_owner_ = false;
02468   }
02469   ~Mutex() {
02470     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
02471   }
02472 
02473  private:
02474   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
02475 };
02476 
02477 // We cannot name this class MutexLock as the ctor declaration would
02478 // conflict with a macro named MutexLock, which is defined on some
02479 // platforms.  Hence the typedef trick below.
02480 class GTestMutexLock {
02481  public:
02482   explicit GTestMutexLock(MutexBase* mutex)
02483       : mutex_(mutex) { mutex_->Lock(); }
02484 
02485   ~GTestMutexLock() { mutex_->Unlock(); }
02486 
02487  private:
02488   MutexBase* const mutex_;
02489 
02490   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
02491 };
02492 
02493 typedef GTestMutexLock MutexLock;
02494 
02495 // Helpers for ThreadLocal.
02496 
02497 // pthread_key_create() requires DeleteThreadLocalValue() to have
02498 // C-linkage.  Therefore it cannot be templatized to access
02499 // ThreadLocal<T>.  Hence the need for class
02500 // ThreadLocalValueHolderBase.
02501 class ThreadLocalValueHolderBase {
02502  public:
02503   virtual ~ThreadLocalValueHolderBase() {}
02504 };
02505 
02506 // Called by pthread to delete thread-local data stored by
02507 // pthread_setspecific().
02508 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
02509   delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
02510 }
02511 
02512 // Implements thread-local storage on pthreads-based systems.
02513 //
02514 //   // Thread 1
02515 //   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
02516 //
02517 //   // Thread 2
02518 //   tl.set(150);  // Changes the value for thread 2 only.
02519 //   EXPECT_EQ(150, tl.get());
02520 //
02521 //   // Thread 1
02522 //   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
02523 //   tl.set(200);
02524 //   EXPECT_EQ(200, tl.get());
02525 //
02526 // The template type argument T must have a public copy constructor.
02527 // In addition, the default ThreadLocal constructor requires T to have
02528 // a public default constructor.
02529 //
02530 // An object managed for a thread by a ThreadLocal instance is deleted
02531 // when the thread exits.  Or, if the ThreadLocal instance dies in
02532 // that thread, when the ThreadLocal dies.  It's the user's
02533 // responsibility to ensure that all other threads using a ThreadLocal
02534 // have exited when it dies, or the per-thread objects for those
02535 // threads will not be deleted.
02536 //
02537 // Google Test only uses global ThreadLocal objects.  That means they
02538 // will die after main() has returned.  Therefore, no per-thread
02539 // object managed by Google Test will be leaked as long as all threads
02540 // using Google Test have exited when main() returns.
02541 template <typename T>
02542 class ThreadLocal {
02543  public:
02544   ThreadLocal() : key_(CreateKey()),
02545                   default_() {}
02546   explicit ThreadLocal(const T& value) : key_(CreateKey()),
02547                                          default_(value) {}
02548 
02549   ~ThreadLocal() {
02550     // Destroys the managed object for the current thread, if any.
02551     DeleteThreadLocalValue(pthread_getspecific(key_));
02552 
02553     // Releases resources associated with the key.  This will *not*
02554     // delete managed objects for other threads.
02555     GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
02556   }
02557 
02558   T* pointer() { return GetOrCreateValue(); }
02559   const T* pointer() const { return GetOrCreateValue(); }
02560   const T& get() const { return *pointer(); }
02561   void set(const T& value) { *pointer() = value; }
02562 
02563  private:
02564   // Holds a value of type T.
02565   class ValueHolder : public ThreadLocalValueHolderBase {
02566    public:
02567     explicit ValueHolder(const T& value) : value_(value) {}
02568 
02569     T* pointer() { return &value_; }
02570 
02571    private:
02572     T value_;
02573     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
02574   };
02575 
02576   static pthread_key_t CreateKey() {
02577     pthread_key_t key;
02578     // When a thread exits, DeleteThreadLocalValue() will be called on
02579     // the object managed for that thread.
02580     GTEST_CHECK_POSIX_SUCCESS_(
02581         pthread_key_create(&key, &DeleteThreadLocalValue));
02582     return key;
02583   }
02584 
02585   T* GetOrCreateValue() const {
02586     ThreadLocalValueHolderBase* const holder =
02587         static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
02588     if (holder != NULL) {
02589       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
02590     }
02591 
02592     ValueHolder* const new_holder = new ValueHolder(default_);
02593     ThreadLocalValueHolderBase* const holder_base = new_holder;
02594     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
02595     return new_holder->pointer();
02596   }
02597 
02598   // A key pthreads uses for looking up per-thread values.
02599   const pthread_key_t key_;
02600   const T default_;  // The default value for each thread.
02601 
02602   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
02603 };
02604 
02605 # define GTEST_IS_THREADSAFE 1
02606 
02607 #else  // GTEST_HAS_PTHREAD
02608 
02609 // A dummy implementation of synchronization primitives (mutex, lock,
02610 // and thread-local variable).  Necessary for compiling Google Test where
02611 // mutex is not supported - using Google Test in multiple threads is not
02612 // supported on such platforms.
02613 
02614 class Mutex {
02615  public:
02616   Mutex() {}
02617   void Lock() {}
02618   void Unlock() {}
02619   void AssertHeld() const {}
02620 };
02621 
02622 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
02623   extern ::testing::internal::Mutex mutex
02624 
02625 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
02626 
02627 class GTestMutexLock {
02628  public:
02629   explicit GTestMutexLock(Mutex*) {}  // NOLINT
02630 };
02631 
02632 typedef GTestMutexLock MutexLock;
02633 
02634 template <typename T>
02635 class ThreadLocal {
02636  public:
02637   ThreadLocal() : value_() {}
02638   explicit ThreadLocal(const T& value) : value_(value) {}
02639   T* pointer() { return &value_; }
02640   const T* pointer() const { return &value_; }
02641   const T& get() const { return value_; }
02642   void set(const T& value) { value_ = value; }
02643  private:
02644   T value_;
02645 };
02646 
02647 // The above synchronization primitives have dummy implementations.
02648 // Therefore Google Test is not thread-safe.
02649 # define GTEST_IS_THREADSAFE 0
02650 
02651 #endif  // GTEST_HAS_PTHREAD
02652 
02653 // Returns the number of threads running in the process, or 0 to indicate that
02654 // we cannot detect it.
02655 GTEST_API_ size_t GetThreadCount();
02656 
02657 // Passing non-POD classes through ellipsis (...) crashes the ARM
02658 // compiler and generates a warning in Sun Studio.  The Nokia Symbian
02659 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
02660 // for objects passed through ellipsis (...), failing for uncopyable
02661 // objects.  We define this to ensure that only POD is passed through
02662 // ellipsis on these systems.
02663 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
02664 // We lose support for NULL detection where the compiler doesn't like
02665 // passing non-POD classes through ellipsis (...).
02666 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
02667 #else
02668 # define GTEST_CAN_COMPARE_NULL 1
02669 #endif
02670 
02671 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
02672 // const T& and const T* in a function template.  These compilers
02673 // _can_ decide between class template specializations for T and T*,
02674 // so a tr1::type_traits-like is_pointer works.
02675 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
02676 # define GTEST_NEEDS_IS_POINTER_ 1
02677 #endif
02678 
02679 template <bool bool_value>
02680 struct bool_constant {
02681   typedef bool_constant<bool_value> type;
02682   static const bool value = bool_value;
02683 };
02684 template <bool bool_value> const bool bool_constant<bool_value>::value;
02685 
02686 typedef bool_constant<false> false_type;
02687 typedef bool_constant<true> true_type;
02688 
02689 template <typename T>
02690 struct is_pointer : public false_type {};
02691 
02692 template <typename T>
02693 struct is_pointer<T*> : public true_type {};
02694 
02695 template <typename Iterator>
02696 struct IteratorTraits {
02697   typedef typename Iterator::value_type value_type;
02698 };
02699 
02700 template <typename T>
02701 struct IteratorTraits<T*> {
02702   typedef T value_type;
02703 };
02704 
02705 template <typename T>
02706 struct IteratorTraits<const T*> {
02707   typedef T value_type;
02708 };
02709 
02710 #if GTEST_OS_WINDOWS
02711 # define GTEST_PATH_SEP_ "\\"
02712 # define GTEST_HAS_ALT_PATH_SEP_ 1
02713 // The biggest signed integer type the compiler supports.
02714 typedef __int64 BiggestInt;
02715 #else
02716 # define GTEST_PATH_SEP_ "/"
02717 # define GTEST_HAS_ALT_PATH_SEP_ 0
02718 typedef long long BiggestInt;  // NOLINT
02719 #endif  // GTEST_OS_WINDOWS
02720 
02721 // Utilities for char.
02722 
02723 // isspace(int ch) and friends accept an unsigned char or EOF.  char
02724 // may be signed, depending on the compiler (or compiler flags).
02725 // Therefore we need to cast a char to unsigned char before calling
02726 // isspace(), etc.
02727 
02728 inline bool IsAlpha(char ch) {
02729   return isalpha(static_cast<unsigned char>(ch)) != 0;
02730 }
02731 inline bool IsAlNum(char ch) {
02732   return isalnum(static_cast<unsigned char>(ch)) != 0;
02733 }
02734 inline bool IsDigit(char ch) {
02735   return isdigit(static_cast<unsigned char>(ch)) != 0;
02736 }
02737 inline bool IsLower(char ch) {
02738   return islower(static_cast<unsigned char>(ch)) != 0;
02739 }
02740 inline bool IsSpace(char ch) {
02741   return isspace(static_cast<unsigned char>(ch)) != 0;
02742 }
02743 inline bool IsUpper(char ch) {
02744   return isupper(static_cast<unsigned char>(ch)) != 0;
02745 }
02746 inline bool IsXDigit(char ch) {
02747   return isxdigit(static_cast<unsigned char>(ch)) != 0;
02748 }
02749 inline bool IsXDigit(wchar_t ch) {
02750   const unsigned char low_byte = static_cast<unsigned char>(ch);
02751   return ch == low_byte && isxdigit(low_byte) != 0;
02752 }
02753 
02754 inline char ToLower(char ch) {
02755   return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
02756 }
02757 inline char ToUpper(char ch) {
02758   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
02759 }
02760 
02761 // The testing::internal::posix namespace holds wrappers for common
02762 // POSIX functions.  These wrappers hide the differences between
02763 // Windows/MSVC and POSIX systems.  Since some compilers define these
02764 // standard functions as macros, the wrapper cannot have the same name
02765 // as the wrapped function.
02766 
02767 namespace posix {
02768 
02769 // Functions with a different name on Windows.
02770 
02771 #if GTEST_OS_WINDOWS
02772 
02773 typedef struct _stat StatStruct;
02774 
02775 # ifdef __BORLANDC__
02776 inline int IsATTY(int fd) { return isatty(fd); }
02777 inline int StrCaseCmp(const char* s1, const char* s2) {
02778   return stricmp(s1, s2);
02779 }
02780 inline char* StrDup(const char* src) { return strdup(src); }
02781 # else  // !__BORLANDC__
02782 #  if GTEST_OS_WINDOWS_MOBILE
02783 inline int IsATTY(int /* fd */) { return 0; }
02784 #  else
02785 inline int IsATTY(int fd) { return _isatty(fd); }
02786 #  endif  // GTEST_OS_WINDOWS_MOBILE
02787 inline int StrCaseCmp(const char* s1, const char* s2) {
02788   return _stricmp(s1, s2);
02789 }
02790 inline char* StrDup(const char* src) { return _strdup(src); }
02791 # endif  // __BORLANDC__
02792 
02793 # if GTEST_OS_WINDOWS_MOBILE
02794 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
02795 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
02796 // time and thus not defined there.
02797 # else
02798 inline int FileNo(FILE* file) { return _fileno(file); }
02799 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
02800 inline int RmDir(const char* dir) { return _rmdir(dir); }
02801 inline bool IsDir(const StatStruct& st) {
02802   return (_S_IFDIR & st.st_mode) != 0;
02803 }
02804 # endif  // GTEST_OS_WINDOWS_MOBILE
02805 
02806 #else
02807 
02808 typedef struct stat StatStruct;
02809 
02810 inline int FileNo(FILE* file) { return fileno(file); }
02811 inline int IsATTY(int fd) { return isatty(fd); }
02812 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
02813 inline int StrCaseCmp(const char* s1, const char* s2) {
02814   return strcasecmp(s1, s2);
02815 }
02816 inline char* StrDup(const char* src) { return strdup(src); }
02817 inline int RmDir(const char* dir) { return rmdir(dir); }
02818 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
02819 
02820 #endif  // GTEST_OS_WINDOWS
02821 
02822 // Functions deprecated by MSVC 8.0.
02823 
02824 #ifdef _MSC_VER
02825 // Temporarily disable warning 4996 (deprecated function).
02826 # pragma warning(push)
02827 # pragma warning(disable:4996)
02828 #endif
02829 
02830 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
02831   return strncpy(dest, src, n);
02832 }
02833 
02834 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
02835 // StrError() aren't needed on Windows CE at this time and thus not
02836 // defined there.
02837 
02838 #if !GTEST_OS_WINDOWS_MOBILE
02839 inline int ChDir(const char* dir) { return chdir(dir); }
02840 #endif
02841 inline FILE* FOpen(const char* path, const char* mode) {
02842   return fopen(path, mode);
02843 }
02844 #if !GTEST_OS_WINDOWS_MOBILE
02845 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
02846   return freopen(path, mode, stream);
02847 }
02848 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
02849 #endif
02850 inline int FClose(FILE* fp) { return fclose(fp); }
02851 #if !GTEST_OS_WINDOWS_MOBILE
02852 inline int Read(int fd, void* buf, unsigned int count) {
02853   return static_cast<int>(read(fd, buf, count));
02854 }
02855 inline int Write(int fd, const void* buf, unsigned int count) {
02856   return static_cast<int>(write(fd, buf, count));
02857 }
02858 inline int Close(int fd) { return close(fd); }
02859 inline const char* StrError(int errnum) { return strerror(errnum); }
02860 #endif
02861 inline const char* GetEnv(const char* name) {
02862 #if GTEST_OS_WINDOWS_MOBILE
02863   // We are on Windows CE, which has no environment variables.
02864   return NULL;
02865 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
02866   // Environment variables which we programmatically clear will be set to the
02867   // empty string rather than unset (NULL).  Handle that case.
02868   const char* const env = getenv(name);
02869   return (env != NULL && env[0] != '\0') ? env : NULL;
02870 #else
02871   return getenv(name);
02872 #endif
02873 }
02874 
02875 #ifdef _MSC_VER
02876 # pragma warning(pop)  // Restores the warning state.
02877 #endif
02878 
02879 #if GTEST_OS_WINDOWS_MOBILE
02880 // Windows CE has no C library. The abort() function is used in
02881 // several places in Google Test. This implementation provides a reasonable
02882 // imitation of standard behaviour.
02883 void Abort();
02884 #else
02885 inline void Abort() { abort(); }
02886 #endif  // GTEST_OS_WINDOWS_MOBILE
02887 
02888 }  // namespace posix
02889 
02890 // MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
02891 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
02892 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
02893 // function in order to achieve that.  We use macro definition here because
02894 // snprintf is a variadic function.
02895 #if defined(_MSC_VER) && _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
02896 // MSVC 2005 and above support variadic macros.
02897 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
02898      _snprintf_s(buffer, size, size, format, __VA_ARGS__)
02899 #elif defined(_MSC_VER)
02900 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
02901 // complain about _snprintf.
02902 # define GTEST_SNPRINTF_ _snprintf
02903 #else
02904 # define GTEST_SNPRINTF_ snprintf
02905 #endif
02906 
02907 // The maximum number a BiggestInt can represent.  This definition
02908 // works no matter BiggestInt is represented in one's complement or
02909 // two's complement.
02910 //
02911 // We cannot rely on numeric_limits in STL, as __int64 and long long
02912 // are not part of standard C++ and numeric_limits doesn't need to be
02913 // defined for them.
02914 const BiggestInt kMaxBiggestInt =
02915     ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
02916 
02917 // This template class serves as a compile-time function from size to
02918 // type.  It maps a size in bytes to a primitive type with that
02919 // size. e.g.
02920 //
02921 //   TypeWithSize<4>::UInt
02922 //
02923 // is typedef-ed to be unsigned int (unsigned integer made up of 4
02924 // bytes).
02925 //
02926 // Such functionality should belong to STL, but I cannot find it
02927 // there.
02928 //
02929 // Google Test uses this class in the implementation of floating-point
02930 // comparison.
02931 //
02932 // For now it only handles UInt (unsigned int) as that's all Google Test
02933 // needs.  Other types can be easily added in the future if need
02934 // arises.
02935 template <size_t size>
02936 class TypeWithSize {
02937  public:
02938   // This prevents the user from using TypeWithSize<N> with incorrect
02939   // values of N.
02940   typedef void UInt;
02941 };
02942 
02943 // The specialization for size 4.
02944 template <>
02945 class TypeWithSize<4> {
02946  public:
02947   // unsigned int has size 4 in both gcc and MSVC.
02948   //
02949   // As base/basictypes.h doesn't compile on Windows, we cannot use
02950   // uint32, uint64, and etc here.
02951   typedef int Int;
02952   typedef unsigned int UInt;
02953 };
02954 
02955 // The specialization for size 8.
02956 template <>
02957 class TypeWithSize<8> {
02958  public:
02959 #if GTEST_OS_WINDOWS
02960   typedef __int64 Int;
02961   typedef unsigned __int64 UInt;
02962 #else
02963   typedef long long Int;  // NOLINT
02964   typedef unsigned long long UInt;  // NOLINT
02965 #endif  // GTEST_OS_WINDOWS
02966 };
02967 
02968 // Integer types of known sizes.
02969 typedef TypeWithSize<4>::Int Int32;
02970 typedef TypeWithSize<4>::UInt UInt32;
02971 typedef TypeWithSize<8>::Int Int64;
02972 typedef TypeWithSize<8>::UInt UInt64;
02973 typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
02974 
02975 // Utilities for command line flags and environment variables.
02976 
02977 // Macro for referencing flags.
02978 #define GTEST_FLAG(name) FLAGS_gtest_##name
02979 
02980 // Macros for declaring flags.
02981 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
02982 #define GTEST_DECLARE_int32_(name) \
02983     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
02984 #define GTEST_DECLARE_string_(name) \
02985     GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
02986 
02987 // Macros for defining flags.
02988 #define GTEST_DEFINE_bool_(name, default_val, doc) \
02989     GTEST_API_ bool GTEST_FLAG(name) = (default_val)
02990 #define GTEST_DEFINE_int32_(name, default_val, doc) \
02991     GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
02992 #define GTEST_DEFINE_string_(name, default_val, doc) \
02993     GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
02994 
02995 // Thread annotations
02996 #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
02997 #define GTEST_LOCK_EXCLUDED_(locks)
02998 
02999 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
03000 // to *value and returns true; otherwise leaves *value unchanged and returns
03001 // false.
03002 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
03003 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
03004 // function.
03005 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
03006 
03007 // Parses a bool/Int32/string from the environment variable
03008 // corresponding to the given Google Test flag.
03009 bool BoolFromGTestEnv(const char* flag, bool default_val);
03010 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
03011 const char* StringFromGTestEnv(const char* flag, const char* default_val);
03012 
03013 }  // namespace internal
03014 }  // namespace testing
03015 
03016 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
03017 
03018 #if GTEST_OS_LINUX
03019 # include <stdlib.h>
03020 # include <sys/types.h>
03021 # include <sys/wait.h>
03022 # include <unistd.h>
03023 #endif  // GTEST_OS_LINUX
03024 
03025 #include <ctype.h>
03026 #include <string.h>
03027 #include <iomanip>
03028 #include <limits>
03029 #include <set>
03030 
03031 // Copyright 2005, Google Inc.
03032 // All rights reserved.
03033 //
03034 // Redistribution and use in source and binary forms, with or without
03035 // modification, are permitted provided that the following conditions are
03036 // met:
03037 //
03038 //     * Redistributions of source code must retain the above copyright
03039 // notice, this list of conditions and the following disclaimer.
03040 //     * Redistributions in binary form must reproduce the above
03041 // copyright notice, this list of conditions and the following disclaimer
03042 // in the documentation and/or other materials provided with the
03043 // distribution.
03044 //     * Neither the name of Google Inc. nor the names of its
03045 // contributors may be used to endorse or promote products derived from
03046 // this software without specific prior written permission.
03047 //
03048 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03049 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03050 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03051 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03052 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03053 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03054 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03055 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03056 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03057 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03058 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03059 //
03060 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
03061 //
03062 // The Google C++ Testing Framework (Google Test)
03063 //
03064 // This header file declares the String class and functions used internally by
03065 // Google Test.  They are subject to change without notice. They should not used
03066 // by code external to Google Test.
03067 //
03068 // This header file is #included by <gtest/internal/gtest-internal.h>.
03069 // It should not be #included by other files.
03070 
03071 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03072 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03073 
03074 #ifdef __BORLANDC__
03075 // string.h is not guaranteed to provide strcpy on C++ Builder.
03076 # include <mem.h>
03077 #endif
03078 
03079 #include <string.h>
03080 #include <string>
03081 
03082 
03083 namespace testing {
03084 namespace internal {
03085 
03086 // String - a UTF-8 string class.
03087 //
03088 // For historic reasons, we don't use std::string.
03089 //
03090 // TODO(wan@google.com): replace this class with std::string or
03091 // implement it in terms of the latter.
03092 //
03093 // Note that String can represent both NULL and the empty string,
03094 // while std::string cannot represent NULL.
03095 //
03096 // NULL and the empty string are considered different.  NULL is less
03097 // than anything (including the empty string) except itself.
03098 //
03099 // This class only provides minimum functionality necessary for
03100 // implementing Google Test.  We do not intend to implement a full-fledged
03101 // string class here.
03102 //
03103 // Since the purpose of this class is to provide a substitute for
03104 // std::string on platforms where it cannot be used, we define a copy
03105 // constructor and assignment operators such that we don't need
03106 // conditional compilation in a lot of places.
03107 //
03108 // In order to make the representation efficient, the d'tor of String
03109 // is not virtual.  Therefore DO NOT INHERIT FROM String.
03110 class GTEST_API_ String {
03111  public:
03112   // Static utility methods
03113 
03114   // Clones a 0-terminated C string, allocating memory using new.  The
03115   // caller is responsible for deleting the return value using
03116   // delete[].  Returns the cloned string, or NULL if the input is
03117   // NULL.
03118   //
03119   // This is different from strdup() in string.h, which allocates
03120   // memory using malloc().
03121   static const char* CloneCString(const char* c_str);
03122 
03123 #if GTEST_OS_WINDOWS_MOBILE
03124   // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
03125   // able to pass strings to Win32 APIs on CE we need to convert them
03126   // to 'Unicode', UTF-16.
03127 
03128   // Creates a UTF-16 wide string from the given ANSI string, allocating
03129   // memory using new. The caller is responsible for deleting the return
03130   // value using delete[]. Returns the wide string, or NULL if the
03131   // input is NULL.
03132   //
03133   // The wide string is created using the ANSI codepage (CP_ACP) to
03134   // match the behaviour of the ANSI versions of Win32 calls and the
03135   // C runtime.
03136   static LPCWSTR AnsiToUtf16(const char* c_str);
03137 
03138   // Creates an ANSI string from the given wide string, allocating
03139   // memory using new. The caller is responsible for deleting the return
03140   // value using delete[]. Returns the ANSI string, or NULL if the
03141   // input is NULL.
03142   //
03143   // The returned string is created using the ANSI codepage (CP_ACP) to
03144   // match the behaviour of the ANSI versions of Win32 calls and the
03145   // C runtime.
03146   static const char* Utf16ToAnsi(LPCWSTR utf16_str);
03147 #endif
03148 
03149   // Compares two C strings.  Returns true iff they have the same content.
03150   //
03151   // Unlike strcmp(), this function can handle NULL argument(s).  A
03152   // NULL C string is considered different to any non-NULL C string,
03153   // including the empty string.
03154   static bool CStringEquals(const char* lhs, const char* rhs);
03155 
03156   // Converts a wide C string to a String using the UTF-8 encoding.
03157   // NULL will be converted to "(null)".  If an error occurred during
03158   // the conversion, "(failed to convert from wide string)" is
03159   // returned.
03160   static String ShowWideCString(const wchar_t* wide_c_str);
03161 
03162   // Compares two wide C strings.  Returns true iff they have the same
03163   // content.
03164   //
03165   // Unlike wcscmp(), this function can handle NULL argument(s).  A
03166   // NULL C string is considered different to any non-NULL C string,
03167   // including the empty string.
03168   static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
03169 
03170   // Compares two C strings, ignoring case.  Returns true iff they
03171   // have the same content.
03172   //
03173   // Unlike strcasecmp(), this function can handle NULL argument(s).
03174   // A NULL C string is considered different to any non-NULL C string,
03175   // including the empty string.
03176   static bool CaseInsensitiveCStringEquals(const char* lhs,
03177                                            const char* rhs);
03178 
03179   // Compares two wide C strings, ignoring case.  Returns true iff they
03180   // have the same content.
03181   //
03182   // Unlike wcscasecmp(), this function can handle NULL argument(s).
03183   // A NULL C string is considered different to any non-NULL wide C string,
03184   // including the empty string.
03185   // NB: The implementations on different platforms slightly differ.
03186   // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
03187   // environment variable. On GNU platform this method uses wcscasecmp
03188   // which compares according to LC_CTYPE category of the current locale.
03189   // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
03190   // current locale.
03191   static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
03192                                                const wchar_t* rhs);
03193 
03194   // Formats a list of arguments to a String, using the same format
03195   // spec string as for printf.
03196   //
03197   // We do not use the StringPrintf class as it is not universally
03198   // available.
03199   //
03200   // The result is limited to 4096 characters (including the tailing
03201   // 0).  If 4096 characters are not enough to format the input,
03202   // "<buffer exceeded>" is returned.
03203   static String Format(const char* format, ...);
03204 
03205   // C'tors
03206 
03207   // The default c'tor constructs a NULL string.
03208   String() : c_str_(NULL), length_(0) {}
03209 
03210   // Constructs a String by cloning a 0-terminated C string.
03211   String(const char* a_c_str) {  // NOLINT
03212     if (a_c_str == NULL) {
03213       c_str_ = NULL;
03214       length_ = 0;
03215     } else {
03216       ConstructNonNull(a_c_str, strlen(a_c_str));
03217     }
03218   }
03219 
03220   // Constructs a String by copying a given number of chars from a
03221   // buffer.  E.g. String("hello", 3) creates the string "hel",
03222   // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
03223   // and String(NULL, 1) results in access violation.
03224   String(const char* buffer, size_t a_length) {
03225     ConstructNonNull(buffer, a_length);
03226   }
03227 
03228   // The copy c'tor creates a new copy of the string.  The two
03229   // String objects do not share content.
03230   String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
03231 
03232   // D'tor.  String is intended to be a final class, so the d'tor
03233   // doesn't need to be virtual.
03234   ~String() { delete[] c_str_; }
03235 
03236   // Allows a String to be implicitly converted to an ::std::string or
03237   // ::string, and vice versa.  Converting a String containing a NULL
03238   // pointer to ::std::string or ::string is undefined behavior.
03239   // Converting a ::std::string or ::string containing an embedded NUL
03240   // character to a String will result in the prefix up to the first
03241   // NUL character.
03242   String(const ::std::string& str) {  // NOLINT
03243     ConstructNonNull(str.c_str(), str.length());
03244   }
03245 
03246   operator ::std::string() const { return ::std::string(c_str(), length()); }
03247 
03248 #if GTEST_HAS_GLOBAL_STRING
03249   String(const ::string& str) {  // NOLINT
03250     ConstructNonNull(str.c_str(), str.length());
03251   }
03252 
03253   operator ::string() const { return ::string(c_str(), length()); }
03254 #endif  // GTEST_HAS_GLOBAL_STRING
03255 
03256   // Returns true iff this is an empty string (i.e. "").
03257   bool empty() const { return (c_str() != NULL) && (length() == 0); }
03258 
03259   // Compares this with another String.
03260   // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
03261   // if this is greater than rhs.
03262   int Compare(const String& rhs) const;
03263 
03264   // Returns true iff this String equals the given C string.  A NULL
03265   // string and a non-NULL string are considered not equal.
03266   bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
03267 
03268   // Returns true iff this String is less than the given String.  A
03269   // NULL string is considered less than "".
03270   bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
03271 
03272   // Returns true iff this String doesn't equal the given C string.  A NULL
03273   // string and a non-NULL string are considered not equal.
03274   bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
03275 
03276   // Returns true iff this String ends with the given suffix.  *Any*
03277   // String is considered to end with a NULL or empty suffix.
03278   bool EndsWith(const char* suffix) const;
03279 
03280   // Returns true iff this String ends with the given suffix, not considering
03281   // case. Any String is considered to end with a NULL or empty suffix.
03282   bool EndsWithCaseInsensitive(const char* suffix) const;
03283 
03284   // Returns the length of the encapsulated string, or 0 if the
03285   // string is NULL.
03286   size_t length() const { return length_; }
03287 
03288   // Gets the 0-terminated C string this String object represents.
03289   // The String object still owns the string.  Therefore the caller
03290   // should NOT delete the return value.
03291   const char* c_str() const { return c_str_; }
03292 
03293   // Assigns a C string to this object.  Self-assignment works.
03294   const String& operator=(const char* a_c_str) {
03295     return *this = String(a_c_str);
03296   }
03297 
03298   // Assigns a String object to this object.  Self-assignment works.
03299   const String& operator=(const String& rhs) {
03300     if (this != &rhs) {
03301       delete[] c_str_;
03302       if (rhs.c_str() == NULL) {
03303         c_str_ = NULL;
03304         length_ = 0;
03305       } else {
03306         ConstructNonNull(rhs.c_str(), rhs.length());
03307       }
03308     }
03309 
03310     return *this;
03311   }
03312 
03313  private:
03314   // Constructs a non-NULL String from the given content.  This
03315   // function can only be called when c_str_ has not been allocated.
03316   // ConstructNonNull(NULL, 0) results in an empty string ("").
03317   // ConstructNonNull(NULL, non_zero) is undefined behavior.
03318   void ConstructNonNull(const char* buffer, size_t a_length) {
03319     char* const str = new char[a_length + 1];
03320     memcpy(str, buffer, a_length);
03321     str[a_length] = '\0';
03322     c_str_ = str;
03323     length_ = a_length;
03324   }
03325 
03326   const char* c_str_;
03327   size_t length_;
03328 };  // class String
03329 
03330 // Streams a String to an ostream.  Each '\0' character in the String
03331 // is replaced with "\\0".
03332 inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
03333   if (str.c_str() == NULL) {
03334     os << "(null)";
03335   } else {
03336     const char* const c_str = str.c_str();
03337     for (size_t i = 0; i != str.length(); i++) {
03338       if (c_str[i] == '\0') {
03339         os << "\\0";
03340       } else {
03341         os << c_str[i];
03342       }
03343     }
03344   }
03345   return os;
03346 }
03347 
03348 // Gets the content of the stringstream's buffer as a String.  Each '\0'
03349 // character in the buffer is replaced with "\\0".
03350 GTEST_API_ String StringStreamToString(::std::stringstream* stream);
03351 
03352 // Converts a streamable value to a String.  A NULL pointer is
03353 // converted to "(null)".  When the input value is a ::string,
03354 // ::std::string, ::wstring, or ::std::wstring object, each NUL
03355 // character in it is replaced with "\\0".
03356 
03357 // Declared here but defined in gtest.h, so that it has access
03358 // to the definition of the Message class, required by the ARM
03359 // compiler.
03360 template <typename T>
03361 String StreamableToString(const T& streamable);
03362 
03363 }  // namespace internal
03364 }  // namespace testing
03365 
03366 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03367 // Copyright 2008, Google Inc.
03368 // All rights reserved.
03369 //
03370 // Redistribution and use in source and binary forms, with or without
03371 // modification, are permitted provided that the following conditions are
03372 // met:
03373 //
03374 //     * Redistributions of source code must retain the above copyright
03375 // notice, this list of conditions and the following disclaimer.
03376 //     * Redistributions in binary form must reproduce the above
03377 // copyright notice, this list of conditions and the following disclaimer
03378 // in the documentation and/or other materials provided with the
03379 // distribution.
03380 //     * Neither the name of Google Inc. nor the names of its
03381 // contributors may be used to endorse or promote products derived from
03382 // this software without specific prior written permission.
03383 //
03384 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03385 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03386 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03387 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03388 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03389 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03390 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03391 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03392 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03393 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03394 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03395 //
03396 // Author: keith.ray@gmail.com (Keith Ray)
03397 //
03398 // Google Test filepath utilities
03399 //
03400 // This header file declares classes and functions used internally by
03401 // Google Test.  They are subject to change without notice.
03402 //
03403 // This file is #included in <gtest/internal/gtest-internal.h>.
03404 // Do not include this header file separately!
03405 
03406 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03407 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03408 
03409 
03410 namespace testing {
03411 namespace internal {
03412 
03413 // FilePath - a class for file and directory pathname manipulation which
03414 // handles platform-specific conventions (like the pathname separator).
03415 // Used for helper functions for naming files in a directory for xml output.
03416 // Except for Set methods, all methods are const or static, which provides an
03417 // "immutable value object" -- useful for peace of mind.
03418 // A FilePath with a value ending in a path separator ("like/this/") represents
03419 // a directory, otherwise it is assumed to represent a file. In either case,
03420 // it may or may not represent an actual file or directory in the file system.
03421 // Names are NOT checked for syntax correctness -- no checking for illegal
03422 // characters, malformed paths, etc.
03423 
03424 class GTEST_API_ FilePath {
03425  public:
03426   FilePath() : pathname_("") { }
03427   FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
03428 
03429   explicit FilePath(const char* pathname) : pathname_(pathname) {
03430     Normalize();
03431   }
03432 
03433   explicit FilePath(const String& pathname) : pathname_(pathname) {
03434     Normalize();
03435   }
03436 
03437   FilePath& operator=(const FilePath& rhs) {
03438     Set(rhs);
03439     return *this;
03440   }
03441 
03442   void Set(const FilePath& rhs) {
03443     pathname_ = rhs.pathname_;
03444   }
03445 
03446   String ToString() const { return pathname_; }
03447   const char* c_str() const { return pathname_.c_str(); }
03448 
03449   // Returns the current working directory, or "" if unsuccessful.
03450   static FilePath GetCurrentDir();
03451 
03452   // Given directory = "dir", base_name = "test", number = 0,
03453   // extension = "xml", returns "dir/test.xml". If number is greater
03454   // than zero (e.g., 12), returns "dir/test_12.xml".
03455   // On Windows platform, uses \ as the separator rather than /.
03456   static FilePath MakeFileName(const FilePath& directory,
03457                                const FilePath& base_name,
03458                                int number,
03459                                const char* extension);
03460 
03461   // Given directory = "dir", relative_path = "test.xml",
03462   // returns "dir/test.xml".
03463   // On Windows, uses \ as the separator rather than /.
03464   static FilePath ConcatPaths(const FilePath& directory,
03465                               const FilePath& relative_path);
03466 
03467   // Returns a pathname for a file that does not currently exist. The pathname
03468   // will be directory/base_name.extension or
03469   // directory/base_name_<number>.extension if directory/base_name.extension
03470   // already exists. The number will be incremented until a pathname is found
03471   // that does not already exist.
03472   // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
03473   // There could be a race condition if two or more processes are calling this
03474   // function at the same time -- they could both pick the same filename.
03475   static FilePath GenerateUniqueFileName(const FilePath& directory,
03476                                          const FilePath& base_name,
03477                                          const char* extension);
03478 
03479   // Returns true iff the path is NULL or "".
03480   bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
03481 
03482   // If input name has a trailing separator character, removes it and returns
03483   // the name, otherwise return the name string unmodified.
03484   // On Windows platform, uses \ as the separator, other platforms use /.
03485   FilePath RemoveTrailingPathSeparator() const;
03486 
03487   // Returns a copy of the FilePath with the directory part removed.
03488   // Example: FilePath("path/to/file").RemoveDirectoryName() returns
03489   // FilePath("file"). If there is no directory part ("just_a_file"), it returns
03490   // the FilePath unmodified. If there is no file part ("just_a_dir/") it
03491   // returns an empty FilePath ("").
03492   // On Windows platform, '\' is the path separator, otherwise it is '/'.
03493   FilePath RemoveDirectoryName() const;
03494 
03495   // RemoveFileName returns the directory path with the filename removed.
03496   // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
03497   // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
03498   // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
03499   // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
03500   // On Windows platform, '\' is the path separator, otherwise it is '/'.
03501   FilePath RemoveFileName() const;
03502 
03503   // Returns a copy of the FilePath with the case-insensitive extension removed.
03504   // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
03505   // FilePath("dir/file"). If a case-insensitive extension is not
03506   // found, returns a copy of the original FilePath.
03507   FilePath RemoveExtension(const char* extension) const;
03508 
03509   // Creates directories so that path exists. Returns true if successful or if
03510   // the directories already exist; returns false if unable to create
03511   // directories for any reason. Will also return false if the FilePath does
03512   // not represent a directory (that is, it doesn't end with a path separator).
03513   bool CreateDirectoriesRecursively() const;
03514 
03515   // Create the directory so that path exists. Returns true if successful or
03516   // if the directory already exists; returns false if unable to create the
03517   // directory for any reason, including if the parent directory does not
03518   // exist. Not named "CreateDirectory" because that's a macro on Windows.
03519   bool CreateFolder() const;
03520 
03521   // Returns true if FilePath describes something in the file-system,
03522   // either a file, directory, or whatever, and that something exists.
03523   bool FileOrDirectoryExists() const;
03524 
03525   // Returns true if pathname describes a directory in the file-system
03526   // that exists.
03527   bool DirectoryExists() const;
03528 
03529   // Returns true if FilePath ends with a path separator, which indicates that
03530   // it is intended to represent a directory. Returns false otherwise.
03531   // This does NOT check that a directory (or file) actually exists.
03532   bool IsDirectory() const;
03533 
03534   // Returns true if pathname describes a root directory. (Windows has one
03535   // root directory per disk drive.)
03536   bool IsRootDirectory() const;
03537 
03538   // Returns true if pathname describes an absolute path.
03539   bool IsAbsolutePath() const;
03540 
03541  private:
03542   // Replaces multiple consecutive separators with a single separator.
03543   // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
03544   // redundancies that might be in a pathname involving "." or "..".
03545   //
03546   // A pathname with multiple consecutive separators may occur either through
03547   // user error or as a result of some scripts or APIs that generate a pathname
03548   // with a trailing separator. On other platforms the same API or script
03549   // may NOT generate a pathname with a trailing "/". Then elsewhere that
03550   // pathname may have another "/" and pathname components added to it,
03551   // without checking for the separator already being there.
03552   // The script language and operating system may allow paths like "foo//bar"
03553   // but some of the functions in FilePath will not handle that correctly. In
03554   // particular, RemoveTrailingPathSeparator() only removes one separator, and
03555   // it is called in CreateDirectoriesRecursively() assuming that it will change
03556   // a pathname from directory syntax (trailing separator) to filename syntax.
03557   //
03558   // On Windows this method also replaces the alternate path separator '/' with
03559   // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
03560   // "bar\\foo".
03561 
03562   void Normalize();
03563 
03564   // Returns a pointer to the last occurence of a valid path separator in
03565   // the FilePath. On Windows, for example, both '/' and '\' are valid path
03566   // separators. Returns NULL if no path separator was found.
03567   const char* FindLastPathSeparator() const;
03568 
03569   String pathname_;
03570 };  // class FilePath
03571 
03572 }  // namespace internal
03573 }  // namespace testing
03574 
03575 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03576 // This file was GENERATED by command:
03577 //     pump.py gtest-type-util.h.pump
03578 // DO NOT EDIT BY HAND!!!
03579 
03580 // Copyright 2008 Google Inc.
03581 // All Rights Reserved.
03582 //
03583 // Redistribution and use in source and binary forms, with or without
03584 // modification, are permitted provided that the following conditions are
03585 // met:
03586 //
03587 //     * Redistributions of source code must retain the above copyright
03588 // notice, this list of conditions and the following disclaimer.
03589 //     * Redistributions in binary form must reproduce the above
03590 // copyright notice, this list of conditions and the following disclaimer
03591 // in the documentation and/or other materials provided with the
03592 // distribution.
03593 //     * Neither the name of Google Inc. nor the names of its
03594 // contributors may be used to endorse or promote products derived from
03595 // this software without specific prior written permission.
03596 //
03597 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03598 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03599 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03600 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03601 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03602 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03603 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03604 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03605 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03606 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03607 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03608 //
03609 // Author: wan@google.com (Zhanyong Wan)
03610 
03611 // Type utilities needed for implementing typed and type-parameterized
03612 // tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
03613 //
03614 // Currently we support at most 50 types in a list, and at most 50
03615 // type-parameterized tests in one type-parameterized test case.
03616 // Please contact googletestframework@googlegroups.com if you need
03617 // more.
03618 
03619 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
03620 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
03621 
03622 
03623 // #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
03624 // libstdc++ (which is where cxxabi.h comes from).
03625 # if GTEST_HAS_CXXABI_H_
03626 #  include <cxxabi.h>
03627 # elif defined(__HP_aCC)
03628 #  include <acxx_demangle.h>
03629 # endif  // GTEST_HASH_CXXABI_H_
03630 
03631 namespace testing {
03632 namespace internal {
03633 
03634 // GetTypeName<T>() returns a human-readable name of type T.
03635 // NB: This function is also used in Google Mock, so don't move it inside of
03636 // the typed-test-only section below.
03637 template <typename T>
03638 String GetTypeName() {
03639 # if GTEST_HAS_RTTI
03640 
03641   const char* const name = typeid(T).name();
03642 #  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
03643   int status = 0;
03644   // gcc's implementation of typeid(T).name() mangles the type name,
03645   // so we have to demangle it.
03646 #   if GTEST_HAS_CXXABI_H_
03647   using abi::__cxa_demangle;
03648 #   endif  // GTEST_HAS_CXXABI_H_
03649   char* const readable_name = __cxa_demangle(name, 0, 0, &status);
03650   const String name_str(status == 0 ? readable_name : name);
03651   free(readable_name);
03652   return name_str;
03653 #  else
03654   return name;
03655 #  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
03656 
03657 # else
03658 
03659   return "<type>";
03660 
03661 # endif  // GTEST_HAS_RTTI
03662 }
03663 
03664 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
03665 
03666 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
03667 // type.  This can be used as a compile-time assertion to ensure that
03668 // two types are equal.
03669 
03670 template <typename T1, typename T2>
03671 struct AssertTypeEq;
03672 
03673 template <typename T>
03674 struct AssertTypeEq<T, T> {
03675   typedef bool type;
03676 };
03677 
03678 // A unique type used as the default value for the arguments of class
03679 // template Types.  This allows us to simulate variadic templates
03680 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
03681 // support directly.
03682 struct None {};
03683 
03684 // The following family of struct and struct templates are used to
03685 // represent type lists.  In particular, TypesN<T1, T2, ..., TN>
03686 // represents a type list with N types (T1, T2, ..., and TN) in it.
03687 // Except for Types0, every struct in the family has two member types:
03688 // Head for the first type in the list, and Tail for the rest of the
03689 // list.
03690 
03691 // The empty type list.
03692 struct Types0 {};
03693 
03694 // Type lists of length 1, 2, 3, and so on.
03695 
03696 template <typename T1>
03697 struct Types1 {
03698   typedef T1 Head;
03699   typedef Types0 Tail;
03700 };
03701 template <typename T1, typename T2>
03702 struct Types2 {
03703   typedef T1 Head;
03704   typedef Types1<T2> Tail;
03705 };
03706 
03707 template <typename T1, typename T2, typename T3>
03708 struct Types3 {
03709   typedef T1 Head;
03710   typedef Types2<T2, T3> Tail;
03711 };
03712 
03713 template <typename T1, typename T2, typename T3, typename T4>
03714 struct Types4 {
03715   typedef T1 Head;
03716   typedef Types3<T2, T3, T4> Tail;
03717 };
03718 
03719 template <typename T1, typename T2, typename T3, typename T4, typename T5>
03720 struct Types5 {
03721   typedef T1 Head;
03722   typedef Types4<T2, T3, T4, T5> Tail;
03723 };
03724 
03725 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03726     typename T6>
03727 struct Types6 {
03728   typedef T1 Head;
03729   typedef Types5<T2, T3, T4, T5, T6> Tail;
03730 };
03731 
03732 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03733     typename T6, typename T7>
03734 struct Types7 {
03735   typedef T1 Head;
03736   typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
03737 };
03738 
03739 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03740     typename T6, typename T7, typename T8>
03741 struct Types8 {
03742   typedef T1 Head;
03743   typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
03744 };
03745 
03746 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03747     typename T6, typename T7, typename T8, typename T9>
03748 struct Types9 {
03749   typedef T1 Head;
03750   typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
03751 };
03752 
03753 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03754     typename T6, typename T7, typename T8, typename T9, typename T10>
03755 struct Types10 {
03756   typedef T1 Head;
03757   typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
03758 };
03759 
03760 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03761     typename T6, typename T7, typename T8, typename T9, typename T10,
03762     typename T11>
03763 struct Types11 {
03764   typedef T1 Head;
03765   typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
03766 };
03767 
03768 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03769     typename T6, typename T7, typename T8, typename T9, typename T10,
03770     typename T11, typename T12>
03771 struct Types12 {
03772   typedef T1 Head;
03773   typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
03774 };
03775 
03776 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03777     typename T6, typename T7, typename T8, typename T9, typename T10,
03778     typename T11, typename T12, typename T13>
03779 struct Types13 {
03780   typedef T1 Head;
03781   typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
03782 };
03783 
03784 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03785     typename T6, typename T7, typename T8, typename T9, typename T10,
03786     typename T11, typename T12, typename T13, typename T14>
03787 struct Types14 {
03788   typedef T1 Head;
03789   typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
03790 };
03791 
03792 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03793     typename T6, typename T7, typename T8, typename T9, typename T10,
03794     typename T11, typename T12, typename T13, typename T14, typename T15>
03795 struct Types15 {
03796   typedef T1 Head;
03797   typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
03798       T15> Tail;
03799 };
03800 
03801 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03802     typename T6, typename T7, typename T8, typename T9, typename T10,
03803     typename T11, typename T12, typename T13, typename T14, typename T15,
03804     typename T16>
03805 struct Types16 {
03806   typedef T1 Head;
03807   typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03808       T16> Tail;
03809 };
03810 
03811 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03812     typename T6, typename T7, typename T8, typename T9, typename T10,
03813     typename T11, typename T12, typename T13, typename T14, typename T15,
03814     typename T16, typename T17>
03815 struct Types17 {
03816   typedef T1 Head;
03817   typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03818       T16, T17> Tail;
03819 };
03820 
03821 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03822     typename T6, typename T7, typename T8, typename T9, typename T10,
03823     typename T11, typename T12, typename T13, typename T14, typename T15,
03824     typename T16, typename T17, typename T18>
03825 struct Types18 {
03826   typedef T1 Head;
03827   typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03828       T16, T17, T18> Tail;
03829 };
03830 
03831 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03832     typename T6, typename T7, typename T8, typename T9, typename T10,
03833     typename T11, typename T12, typename T13, typename T14, typename T15,
03834     typename T16, typename T17, typename T18, typename T19>
03835 struct Types19 {
03836   typedef T1 Head;
03837   typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03838       T16, T17, T18, T19> Tail;
03839 };
03840 
03841 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03842     typename T6, typename T7, typename T8, typename T9, typename T10,
03843     typename T11, typename T12, typename T13, typename T14, typename T15,
03844     typename T16, typename T17, typename T18, typename T19, typename T20>
03845 struct Types20 {
03846   typedef T1 Head;
03847   typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03848       T16, T17, T18, T19, T20> Tail;
03849 };
03850 
03851 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03852     typename T6, typename T7, typename T8, typename T9, typename T10,
03853     typename T11, typename T12, typename T13, typename T14, typename T15,
03854     typename T16, typename T17, typename T18, typename T19, typename T20,
03855     typename T21>
03856 struct Types21 {
03857   typedef T1 Head;
03858   typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03859       T16, T17, T18, T19, T20, T21> Tail;
03860 };
03861 
03862 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03863     typename T6, typename T7, typename T8, typename T9, typename T10,
03864     typename T11, typename T12, typename T13, typename T14, typename T15,
03865     typename T16, typename T17, typename T18, typename T19, typename T20,
03866     typename T21, typename T22>
03867 struct Types22 {
03868   typedef T1 Head;
03869   typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03870       T16, T17, T18, T19, T20, T21, T22> Tail;
03871 };
03872 
03873 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03874     typename T6, typename T7, typename T8, typename T9, typename T10,
03875     typename T11, typename T12, typename T13, typename T14, typename T15,
03876     typename T16, typename T17, typename T18, typename T19, typename T20,
03877     typename T21, typename T22, typename T23>
03878 struct Types23 {
03879   typedef T1 Head;
03880   typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03881       T16, T17, T18, T19, T20, T21, T22, T23> Tail;
03882 };
03883 
03884 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03885     typename T6, typename T7, typename T8, typename T9, typename T10,
03886     typename T11, typename T12, typename T13, typename T14, typename T15,
03887     typename T16, typename T17, typename T18, typename T19, typename T20,
03888     typename T21, typename T22, typename T23, typename T24>
03889 struct Types24 {
03890   typedef T1 Head;
03891   typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03892       T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
03893 };
03894 
03895 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03896     typename T6, typename T7, typename T8, typename T9, typename T10,
03897     typename T11, typename T12, typename T13, typename T14, typename T15,
03898     typename T16, typename T17, typename T18, typename T19, typename T20,
03899     typename T21, typename T22, typename T23, typename T24, typename T25>
03900 struct Types25 {
03901   typedef T1 Head;
03902   typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03903       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
03904 };
03905 
03906 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03907     typename T6, typename T7, typename T8, typename T9, typename T10,
03908     typename T11, typename T12, typename T13, typename T14, typename T15,
03909     typename T16, typename T17, typename T18, typename T19, typename T20,
03910     typename T21, typename T22, typename T23, typename T24, typename T25,
03911     typename T26>
03912 struct Types26 {
03913   typedef T1 Head;
03914   typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03915       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
03916 };
03917 
03918 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03919     typename T6, typename T7, typename T8, typename T9, typename T10,
03920     typename T11, typename T12, typename T13, typename T14, typename T15,
03921     typename T16, typename T17, typename T18, typename T19, typename T20,
03922     typename T21, typename T22, typename T23, typename T24, typename T25,
03923     typename T26, typename T27>
03924 struct Types27 {
03925   typedef T1 Head;
03926   typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03927       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
03928 };
03929 
03930 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03931     typename T6, typename T7, typename T8, typename T9, typename T10,
03932     typename T11, typename T12, typename T13, typename T14, typename T15,
03933     typename T16, typename T17, typename T18, typename T19, typename T20,
03934     typename T21, typename T22, typename T23, typename T24, typename T25,
03935     typename T26, typename T27, typename T28>
03936 struct Types28 {
03937   typedef T1 Head;
03938   typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03939       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
03940 };
03941 
03942 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03943     typename T6, typename T7, typename T8, typename T9, typename T10,
03944     typename T11, typename T12, typename T13, typename T14, typename T15,
03945     typename T16, typename T17, typename T18, typename T19, typename T20,
03946     typename T21, typename T22, typename T23, typename T24, typename T25,
03947     typename T26, typename T27, typename T28, typename T29>
03948 struct Types29 {
03949   typedef T1 Head;
03950   typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03951       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
03952       T29> Tail;
03953 };
03954 
03955 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03956     typename T6, typename T7, typename T8, typename T9, typename T10,
03957     typename T11, typename T12, typename T13, typename T14, typename T15,
03958     typename T16, typename T17, typename T18, typename T19, typename T20,
03959     typename T21, typename T22, typename T23, typename T24, typename T25,
03960     typename T26, typename T27, typename T28, typename T29, typename T30>
03961 struct Types30 {
03962   typedef T1 Head;
03963   typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03964       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
03965       T30> Tail;
03966 };
03967 
03968 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03969     typename T6, typename T7, typename T8, typename T9, typename T10,
03970     typename T11, typename T12, typename T13, typename T14, typename T15,
03971     typename T16, typename T17, typename T18, typename T19, typename T20,
03972     typename T21, typename T22, typename T23, typename T24, typename T25,
03973     typename T26, typename T27, typename T28, typename T29, typename T30,
03974     typename T31>
03975 struct Types31 {
03976   typedef T1 Head;
03977   typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03978       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
03979       T30, T31> Tail;
03980 };
03981 
03982 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03983     typename T6, typename T7, typename T8, typename T9, typename T10,
03984     typename T11, typename T12, typename T13, typename T14, typename T15,
03985     typename T16, typename T17, typename T18, typename T19, typename T20,
03986     typename T21, typename T22, typename T23, typename T24, typename T25,
03987     typename T26, typename T27, typename T28, typename T29, typename T30,
03988     typename T31, typename T32>
03989 struct Types32 {
03990   typedef T1 Head;
03991   typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03992       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
03993       T30, T31, T32> Tail;
03994 };
03995 
03996 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03997     typename T6, typename T7, typename T8, typename T9, typename T10,
03998     typename T11, typename T12, typename T13, typename T14, typename T15,
03999     typename T16, typename T17, typename T18, typename T19, typename T20,
04000     typename T21, typename T22, typename T23, typename T24, typename T25,
04001     typename T26, typename T27, typename T28, typename T29, typename T30,
04002     typename T31, typename T32, typename T33>
04003 struct Types33 {
04004   typedef T1 Head;
04005   typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04006       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04007       T30, T31, T32, T33> Tail;
04008 };
04009 
04010 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04011     typename T6, typename T7, typename T8, typename T9, typename T10,
04012     typename T11, typename T12, typename T13, typename T14, typename T15,
04013     typename T16, typename T17, typename T18, typename T19, typename T20,
04014     typename T21, typename T22, typename T23, typename T24, typename T25,
04015     typename T26, typename T27, typename T28, typename T29, typename T30,
04016     typename T31, typename T32, typename T33, typename T34>
04017 struct Types34 {
04018   typedef T1 Head;
04019   typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04020       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04021       T30, T31, T32, T33, T34> 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, typename T27, typename T28, typename T29, typename T30,
04030     typename T31, typename T32, typename T33, typename T34, typename T35>
04031 struct Types35 {
04032   typedef T1 Head;
04033   typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04034       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04035       T30, T31, T32, T33, T34, T35> Tail;
04036 };
04037 
04038 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04039     typename T6, typename T7, typename T8, typename T9, typename T10,
04040     typename T11, typename T12, typename T13, typename T14, typename T15,
04041     typename T16, typename T17, typename T18, typename T19, typename T20,
04042     typename T21, typename T22, typename T23, typename T24, typename T25,
04043     typename T26, typename T27, typename T28, typename T29, typename T30,
04044     typename T31, typename T32, typename T33, typename T34, typename T35,
04045     typename T36>
04046 struct Types36 {
04047   typedef T1 Head;
04048   typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04049       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04050       T30, T31, T32, T33, T34, T35, T36> Tail;
04051 };
04052 
04053 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04054     typename T6, typename T7, typename T8, typename T9, typename T10,
04055     typename T11, typename T12, typename T13, typename T14, typename T15,
04056     typename T16, typename T17, typename T18, typename T19, typename T20,
04057     typename T21, typename T22, typename T23, typename T24, typename T25,
04058     typename T26, typename T27, typename T28, typename T29, typename T30,
04059     typename T31, typename T32, typename T33, typename T34, typename T35,
04060     typename T36, typename T37>
04061 struct Types37 {
04062   typedef T1 Head;
04063   typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04064       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04065       T30, T31, T32, T33, T34, T35, T36, T37> Tail;
04066 };
04067 
04068 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04069     typename T6, typename T7, typename T8, typename T9, typename T10,
04070     typename T11, typename T12, typename T13, typename T14, typename T15,
04071     typename T16, typename T17, typename T18, typename T19, typename T20,
04072     typename T21, typename T22, typename T23, typename T24, typename T25,
04073     typename T26, typename T27, typename T28, typename T29, typename T30,
04074     typename T31, typename T32, typename T33, typename T34, typename T35,
04075     typename T36, typename T37, typename T38>
04076 struct Types38 {
04077   typedef T1 Head;
04078   typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04079       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04080       T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
04081 };
04082 
04083 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04084     typename T6, typename T7, typename T8, typename T9, typename T10,
04085     typename T11, typename T12, typename T13, typename T14, typename T15,
04086     typename T16, typename T17, typename T18, typename T19, typename T20,
04087     typename T21, typename T22, typename T23, typename T24, typename T25,
04088     typename T26, typename T27, typename T28, typename T29, typename T30,
04089     typename T31, typename T32, typename T33, typename T34, typename T35,
04090     typename T36, typename T37, typename T38, typename T39>
04091 struct Types39 {
04092   typedef T1 Head;
04093   typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04094       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04095       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
04096 };
04097 
04098 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04099     typename T6, typename T7, typename T8, typename T9, typename T10,
04100     typename T11, typename T12, typename T13, typename T14, typename T15,
04101     typename T16, typename T17, typename T18, typename T19, typename T20,
04102     typename T21, typename T22, typename T23, typename T24, typename T25,
04103     typename T26, typename T27, typename T28, typename T29, typename T30,
04104     typename T31, typename T32, typename T33, typename T34, typename T35,
04105     typename T36, typename T37, typename T38, typename T39, typename T40>
04106 struct Types40 {
04107   typedef T1 Head;
04108   typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04109       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04110       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
04111 };
04112 
04113 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04114     typename T6, typename T7, typename T8, typename T9, typename T10,
04115     typename T11, typename T12, typename T13, typename T14, typename T15,
04116     typename T16, typename T17, typename T18, typename T19, typename T20,
04117     typename T21, typename T22, typename T23, typename T24, typename T25,
04118     typename T26, typename T27, typename T28, typename T29, typename T30,
04119     typename T31, typename T32, typename T33, typename T34, typename T35,
04120     typename T36, typename T37, typename T38, typename T39, typename T40,
04121     typename T41>
04122 struct Types41 {
04123   typedef T1 Head;
04124   typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04125       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04126       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
04127 };
04128 
04129 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04130     typename T6, typename T7, typename T8, typename T9, typename T10,
04131     typename T11, typename T12, typename T13, typename T14, typename T15,
04132     typename T16, typename T17, typename T18, typename T19, typename T20,
04133     typename T21, typename T22, typename T23, typename T24, typename T25,
04134     typename T26, typename T27, typename T28, typename T29, typename T30,
04135     typename T31, typename T32, typename T33, typename T34, typename T35,
04136     typename T36, typename T37, typename T38, typename T39, typename T40,
04137     typename T41, typename T42>
04138 struct Types42 {
04139   typedef T1 Head;
04140   typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04141       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04142       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
04143 };
04144 
04145 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04146     typename T6, typename T7, typename T8, typename T9, typename T10,
04147     typename T11, typename T12, typename T13, typename T14, typename T15,
04148     typename T16, typename T17, typename T18, typename T19, typename T20,
04149     typename T21, typename T22, typename T23, typename T24, typename T25,
04150     typename T26, typename T27, typename T28, typename T29, typename T30,
04151     typename T31, typename T32, typename T33, typename T34, typename T35,
04152     typename T36, typename T37, typename T38, typename T39, typename T40,
04153     typename T41, typename T42, typename T43>
04154 struct Types43 {
04155   typedef T1 Head;
04156   typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04157       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04158       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
04159       T43> Tail;
04160 };
04161 
04162 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04163     typename T6, typename T7, typename T8, typename T9, typename T10,
04164     typename T11, typename T12, typename T13, typename T14, typename T15,
04165     typename T16, typename T17, typename T18, typename T19, typename T20,
04166     typename T21, typename T22, typename T23, typename T24, typename T25,
04167     typename T26, typename T27, typename T28, typename T29, typename T30,
04168     typename T31, typename T32, typename T33, typename T34, typename T35,
04169     typename T36, typename T37, typename T38, typename T39, typename T40,
04170     typename T41, typename T42, typename T43, typename T44>
04171 struct Types44 {
04172   typedef T1 Head;
04173   typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04174       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04175       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04176       T44> Tail;
04177 };
04178 
04179 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04180     typename T6, typename T7, typename T8, typename T9, typename T10,
04181     typename T11, typename T12, typename T13, typename T14, typename T15,
04182     typename T16, typename T17, typename T18, typename T19, typename T20,
04183     typename T21, typename T22, typename T23, typename T24, typename T25,
04184     typename T26, typename T27, typename T28, typename T29, typename T30,
04185     typename T31, typename T32, typename T33, typename T34, typename T35,
04186     typename T36, typename T37, typename T38, typename T39, typename T40,
04187     typename T41, typename T42, typename T43, typename T44, typename T45>
04188 struct Types45 {
04189   typedef T1 Head;
04190   typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04191       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04192       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04193       T44, T45> Tail;
04194 };
04195 
04196 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04197     typename T6, typename T7, typename T8, typename T9, typename T10,
04198     typename T11, typename T12, typename T13, typename T14, typename T15,
04199     typename T16, typename T17, typename T18, typename T19, typename T20,
04200     typename T21, typename T22, typename T23, typename T24, typename T25,
04201     typename T26, typename T27, typename T28, typename T29, typename T30,
04202     typename T31, typename T32, typename T33, typename T34, typename T35,
04203     typename T36, typename T37, typename T38, typename T39, typename T40,
04204     typename T41, typename T42, typename T43, typename T44, typename T45,
04205     typename T46>
04206 struct Types46 {
04207   typedef T1 Head;
04208   typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04209       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04210       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04211       T44, T45, T46> Tail;
04212 };
04213 
04214 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04215     typename T6, typename T7, typename T8, typename T9, typename T10,
04216     typename T11, typename T12, typename T13, typename T14, typename T15,
04217     typename T16, typename T17, typename T18, typename T19, typename T20,
04218     typename T21, typename T22, typename T23, typename T24, typename T25,
04219     typename T26, typename T27, typename T28, typename T29, typename T30,
04220     typename T31, typename T32, typename T33, typename T34, typename T35,
04221     typename T36, typename T37, typename T38, typename T39, typename T40,
04222     typename T41, typename T42, typename T43, typename T44, typename T45,
04223     typename T46, typename T47>
04224 struct Types47 {
04225   typedef T1 Head;
04226   typedef Types46<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, T41, T42, T43,
04229       T44, T45, T46, T47> Tail;
04230 };
04231 
04232 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04233     typename T6, typename T7, typename T8, typename T9, typename T10,
04234     typename T11, typename T12, typename T13, typename T14, typename T15,
04235     typename T16, typename T17, typename T18, typename T19, typename T20,
04236     typename T21, typename T22, typename T23, typename T24, typename T25,
04237     typename T26, typename T27, typename T28, typename T29, typename T30,
04238     typename T31, typename T32, typename T33, typename T34, typename T35,
04239     typename T36, typename T37, typename T38, typename T39, typename T40,
04240     typename T41, typename T42, typename T43, typename T44, typename T45,
04241     typename T46, typename T47, typename T48>
04242 struct Types48 {
04243   typedef T1 Head;
04244   typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04245       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04246       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04247       T44, T45, T46, T47, T48> Tail;
04248 };
04249 
04250 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04251     typename T6, typename T7, typename T8, typename T9, typename T10,
04252     typename T11, typename T12, typename T13, typename T14, typename T15,
04253     typename T16, typename T17, typename T18, typename T19, typename T20,
04254     typename T21, typename T22, typename T23, typename T24, typename T25,
04255     typename T26, typename T27, typename T28, typename T29, typename T30,
04256     typename T31, typename T32, typename T33, typename T34, typename T35,
04257     typename T36, typename T37, typename T38, typename T39, typename T40,
04258     typename T41, typename T42, typename T43, typename T44, typename T45,
04259     typename T46, typename T47, typename T48, typename T49>
04260 struct Types49 {
04261   typedef T1 Head;
04262   typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04263       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04264       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04265       T44, T45, T46, T47, T48, T49> Tail;
04266 };
04267 
04268 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04269     typename T6, typename T7, typename T8, typename T9, typename T10,
04270     typename T11, typename T12, typename T13, typename T14, typename T15,
04271     typename T16, typename T17, typename T18, typename T19, typename T20,
04272     typename T21, typename T22, typename T23, typename T24, typename T25,
04273     typename T26, typename T27, typename T28, typename T29, typename T30,
04274     typename T31, typename T32, typename T33, typename T34, typename T35,
04275     typename T36, typename T37, typename T38, typename T39, typename T40,
04276     typename T41, typename T42, typename T43, typename T44, typename T45,
04277     typename T46, typename T47, typename T48, typename T49, typename T50>
04278 struct Types50 {
04279   typedef T1 Head;
04280   typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04281       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04282       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04283       T44, T45, T46, T47, T48, T49, T50> Tail;
04284 };
04285 
04286 
04287 }  // namespace internal
04288 
04289 // We don't want to require the users to write TypesN<...> directly,
04290 // as that would require them to count the length.  Types<...> is much
04291 // easier to write, but generates horrible messages when there is a
04292 // compiler error, as gcc insists on printing out each template
04293 // argument, even if it has the default value (this means Types<int>
04294 // will appear as Types<int, None, None, ..., None> in the compiler
04295 // errors).
04296 //
04297 // Our solution is to combine the best part of the two approaches: a
04298 // user would write Types<T1, ..., TN>, and Google Test will translate
04299 // that to TypesN<T1, ..., TN> internally to make error messages
04300 // readable.  The translation is done by the 'type' member of the
04301 // Types template.
04302 template <typename T1 = internal::None, typename T2 = internal::None,
04303     typename T3 = internal::None, typename T4 = internal::None,
04304     typename T5 = internal::None, typename T6 = internal::None,
04305     typename T7 = internal::None, typename T8 = internal::None,
04306     typename T9 = internal::None, typename T10 = internal::None,
04307     typename T11 = internal::None, typename T12 = internal::None,
04308     typename T13 = internal::None, typename T14 = internal::None,
04309     typename T15 = internal::None, typename T16 = internal::None,
04310     typename T17 = internal::None, typename T18 = internal::None,
04311     typename T19 = internal::None, typename T20 = internal::None,
04312     typename T21 = internal::None, typename T22 = internal::None,
04313     typename T23 = internal::None, typename T24 = internal::None,
04314     typename T25 = internal::None, typename T26 = internal::None,
04315     typename T27 = internal::None, typename T28 = internal::None,
04316     typename T29 = internal::None, typename T30 = internal::None,
04317     typename T31 = internal::None, typename T32 = internal::None,
04318     typename T33 = internal::None, typename T34 = internal::None,
04319     typename T35 = internal::None, typename T36 = internal::None,
04320     typename T37 = internal::None, typename T38 = internal::None,
04321     typename T39 = internal::None, typename T40 = internal::None,
04322     typename T41 = internal::None, typename T42 = internal::None,
04323     typename T43 = internal::None, typename T44 = internal::None,
04324     typename T45 = internal::None, typename T46 = internal::None,
04325     typename T47 = internal::None, typename T48 = internal::None,
04326     typename T49 = internal::None, typename T50 = internal::None>
04327 struct Types {
04328   typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04329       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04330       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
04331       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
04332 };
04333 
04334 template <>
04335 struct Types<internal::None, internal::None, internal::None, internal::None,
04336     internal::None, internal::None, internal::None, internal::None,
04337     internal::None, internal::None, internal::None, internal::None,
04338     internal::None, internal::None, internal::None, internal::None,
04339     internal::None, internal::None, internal::None, internal::None,
04340     internal::None, internal::None, internal::None, internal::None,
04341     internal::None, internal::None, internal::None, internal::None,
04342     internal::None, internal::None, internal::None, internal::None,
04343     internal::None, internal::None, internal::None, internal::None,
04344     internal::None, internal::None, internal::None, internal::None,
04345     internal::None, internal::None, internal::None, internal::None,
04346     internal::None, internal::None, internal::None, internal::None,
04347     internal::None, internal::None> {
04348   typedef internal::Types0 type;
04349 };
04350 template <typename T1>
04351 struct Types<T1, internal::None, internal::None, internal::None,
04352     internal::None, internal::None, internal::None, internal::None,
04353     internal::None, internal::None, internal::None, internal::None,
04354     internal::None, internal::None, internal::None, internal::None,
04355     internal::None, internal::None, internal::None, internal::None,
04356     internal::None, internal::None, internal::None, internal::None,
04357     internal::None, internal::None, internal::None, internal::None,
04358     internal::None, internal::None, internal::None, internal::None,
04359     internal::None, internal::None, internal::None, internal::None,
04360     internal::None, internal::None, internal::None, internal::None,
04361     internal::None, internal::None, internal::None, internal::None,
04362     internal::None, internal::None, internal::None, internal::None,
04363     internal::None, internal::None> {
04364   typedef internal::Types1<T1> type;
04365 };
04366 template <typename T1, typename T2>
04367 struct Types<T1, T2, internal::None, internal::None, internal::None,
04368     internal::None, internal::None, internal::None, internal::None,
04369     internal::None, internal::None, internal::None, internal::None,
04370     internal::None, internal::None, internal::None, internal::None,
04371     internal::None, internal::None, internal::None, internal::None,
04372     internal::None, internal::None, internal::None, internal::None,
04373     internal::None, internal::None, internal::None, internal::None,
04374     internal::None, internal::None, internal::None, internal::None,
04375     internal::None, internal::None, internal::None, internal::None,
04376     internal::None, internal::None, internal::None, internal::None,
04377     internal::None, internal::None, internal::None, internal::None,
04378     internal::None, internal::None, internal::None, internal::None,
04379     internal::None> {
04380   typedef internal::Types2<T1, T2> type;
04381 };
04382 template <typename T1, typename T2, typename T3>
04383 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
04384     internal::None, internal::None, internal::None, internal::None,
04385     internal::None, internal::None, internal::None, internal::None,
04386     internal::None, internal::None, internal::None, internal::None,
04387     internal::None, internal::None, internal::None, internal::None,
04388     internal::None, internal::None, internal::None, internal::None,
04389     internal::None, internal::None, internal::None, internal::None,
04390     internal::None, internal::None, internal::None, internal::None,
04391     internal::None, internal::None, internal::None, internal::None,
04392     internal::None, internal::None, internal::None, internal::None,
04393     internal::None, internal::None, internal::None, internal::None,
04394     internal::None, internal::None, internal::None, internal::None> {
04395   typedef internal::Types3<T1, T2, T3> type;
04396 };
04397 template <typename T1, typename T2, typename T3, typename T4>
04398 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
04399     internal::None, internal::None, internal::None, internal::None,
04400     internal::None, internal::None, internal::None, internal::None,
04401     internal::None, internal::None, internal::None, internal::None,
04402     internal::None, internal::None, internal::None, internal::None,
04403     internal::None, internal::None, internal::None, internal::None,
04404     internal::None, internal::None, internal::None, internal::None,
04405     internal::None, internal::None, internal::None, internal::None,
04406     internal::None, internal::None, internal::None, internal::None,
04407     internal::None, internal::None, internal::None, internal::None,
04408     internal::None, internal::None, internal::None, internal::None,
04409     internal::None, internal::None, internal::None> {
04410   typedef internal::Types4<T1, T2, T3, T4> type;
04411 };
04412 template <typename T1, typename T2, typename T3, typename T4, typename T5>
04413 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
04414     internal::None, internal::None, internal::None, internal::None,
04415     internal::None, internal::None, internal::None, internal::None,
04416     internal::None, internal::None, internal::None, internal::None,
04417     internal::None, internal::None, internal::None, internal::None,
04418     internal::None, internal::None, internal::None, internal::None,
04419     internal::None, internal::None, internal::None, internal::None,
04420     internal::None, internal::None, internal::None, internal::None,
04421     internal::None, internal::None, internal::None, internal::None,
04422     internal::None, internal::None, internal::None, internal::None,
04423     internal::None, internal::None, internal::None, internal::None,
04424     internal::None, internal::None, internal::None> {
04425   typedef internal::Types5<T1, T2, T3, T4, T5> type;
04426 };
04427 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04428     typename T6>
04429 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
04430     internal::None, internal::None, internal::None, internal::None,
04431     internal::None, internal::None, internal::None, internal::None,
04432     internal::None, internal::None, internal::None, internal::None,
04433     internal::None, internal::None, internal::None, internal::None,
04434     internal::None, internal::None, internal::None, internal::None,
04435     internal::None, internal::None, internal::None, internal::None,
04436     internal::None, internal::None, internal::None, internal::None,
04437     internal::None, internal::None, internal::None, internal::None,
04438     internal::None, internal::None, internal::None, internal::None,
04439     internal::None, internal::None, internal::None, internal::None,
04440     internal::None, internal::None> {
04441   typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
04442 };
04443 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04444     typename T6, typename T7>
04445 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
04446     internal::None, internal::None, internal::None, internal::None,
04447     internal::None, internal::None, internal::None, internal::None,
04448     internal::None, internal::None, internal::None, internal::None,
04449     internal::None, internal::None, internal::None, internal::None,
04450     internal::None, internal::None, internal::None, internal::None,
04451     internal::None, internal::None, internal::None, internal::None,
04452     internal::None, internal::None, internal::None, internal::None,
04453     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> {
04457   typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
04458 };
04459 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04460     typename T6, typename T7, typename T8>
04461 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, 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, internal::None, internal::None,
04466     internal::None, internal::None, internal::None, internal::None,
04467     internal::None, internal::None, internal::None, internal::None,
04468     internal::None, internal::None, internal::None, internal::None,
04469     internal::None, 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   typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
04473 };
04474 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04475     typename T6, typename T7, typename T8, typename T9>
04476 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, 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, internal::None, internal::None,
04482     internal::None, internal::None, internal::None, internal::None,
04483     internal::None, internal::None, internal::None, internal::None,
04484     internal::None, internal::None, internal::None, internal::None,
04485     internal::None, internal::None, internal::None, internal::None,
04486     internal::None, internal::None, internal::None, internal::None> {
04487   typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
04488 };
04489 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04490     typename T6, typename T7, typename T8, typename T9, typename T10>
04491 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 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, internal::None, internal::None, internal::None,
04498     internal::None, internal::None, internal::None, internal::None,
04499     internal::None, internal::None, internal::None, internal::None,
04500     internal::None, internal::None, internal::None, internal::None,
04501     internal::None, internal::None, internal::None> {
04502   typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
04503 };
04504 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04505     typename T6, typename T7, typename T8, typename T9, typename T10,
04506     typename T11>
04507 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 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     internal::None, internal::None, internal::None, internal::None,
04514     internal::None, internal::None, internal::None, internal::None,
04515     internal::None, internal::None, internal::None, internal::None,
04516     internal::None, internal::None, internal::None, internal::None,
04517     internal::None, internal::None> {
04518   typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
04519 };
04520 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04521     typename T6, typename T7, typename T8, typename T9, typename T10,
04522     typename T11, typename T12>
04523 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 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, internal::None,
04528     internal::None, internal::None, internal::None, internal::None,
04529     internal::None, internal::None, internal::None, internal::None,
04530     internal::None, internal::None, internal::None, internal::None,
04531     internal::None, internal::None, internal::None, internal::None,
04532     internal::None, internal::None, internal::None, internal::None,
04533     internal::None> {
04534   typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
04535       T12> type;
04536 };
04537 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04538     typename T6, typename T7, typename T8, typename T9, typename T10,
04539     typename T11, typename T12, typename T13>
04540 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
04541     internal::None, internal::None, internal::None, internal::None,
04542     internal::None, internal::None, internal::None, internal::None,
04543     internal::None, internal::None, internal::None, internal::None,
04544     internal::None, internal::None, internal::None, internal::None,
04545     internal::None, internal::None, internal::None, internal::None,
04546     internal::None, internal::None, internal::None, internal::None,
04547     internal::None, internal::None, 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> {
04551   typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04552       T13> type;
04553 };
04554 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04555     typename T6, typename T7, typename T8, typename T9, typename T10,
04556     typename T11, typename T12, typename T13, typename T14>
04557 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
04558     internal::None, internal::None, internal::None, internal::None,
04559     internal::None, internal::None, internal::None, internal::None,
04560     internal::None, internal::None, internal::None, internal::None,
04561     internal::None, internal::None, internal::None, internal::None,
04562     internal::None, internal::None, internal::None, internal::None,
04563     internal::None, internal::None, 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   typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04568       T13, T14> type;
04569 };
04570 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04571     typename T6, typename T7, typename T8, typename T9, typename T10,
04572     typename T11, typename T12, typename T13, typename T14, typename T15>
04573 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04574     internal::None, internal::None, internal::None, internal::None,
04575     internal::None, internal::None, internal::None, internal::None,
04576     internal::None, internal::None, internal::None, internal::None,
04577     internal::None, internal::None, internal::None, internal::None,
04578     internal::None, internal::None, internal::None, internal::None,
04579     internal::None, internal::None, 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> {
04583   typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04584       T13, T14, T15> type;
04585 };
04586 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04587     typename T6, typename T7, typename T8, typename T9, typename T10,
04588     typename T11, typename T12, typename T13, typename T14, typename T15,
04589     typename T16>
04590 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04591     T16, internal::None, internal::None, internal::None, internal::None,
04592     internal::None, internal::None, internal::None, internal::None,
04593     internal::None, internal::None, internal::None, internal::None,
04594     internal::None, internal::None, internal::None, 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> {
04600   typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04601       T13, T14, T15, T16> type;
04602 };
04603 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04604     typename T6, typename T7, typename T8, typename T9, typename T10,
04605     typename T11, typename T12, typename T13, typename T14, typename T15,
04606     typename T16, typename T17>
04607 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04608     T16, T17, internal::None, internal::None, internal::None, internal::None,
04609     internal::None, internal::None, internal::None, 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> {
04617   typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04618       T13, T14, T15, T16, T17> type;
04619 };
04620 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04621     typename T6, typename T7, typename T8, typename T9, typename T10,
04622     typename T11, typename T12, typename T13, typename T14, typename T15,
04623     typename T16, typename T17, typename T18>
04624 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04625     T16, T17, T18, internal::None, internal::None, 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> {
04634   typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04635       T13, T14, T15, T16, T17, T18> type;
04636 };
04637 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04638     typename T6, typename T7, typename T8, typename T9, typename T10,
04639     typename T11, typename T12, typename T13, typename T14, typename T15,
04640     typename T16, typename T17, typename T18, typename T19>
04641 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04642     T16, T17, T18, T19, 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   typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04651       T13, T14, T15, T16, T17, T18, T19> type;
04652 };
04653 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04654     typename T6, typename T7, typename T8, typename T9, typename T10,
04655     typename T11, typename T12, typename T13, typename T14, typename T15,
04656     typename T16, typename T17, typename T18, typename T19, typename T20>
04657 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04658     T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
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> {
04666   typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04667       T13, T14, T15, T16, T17, T18, T19, T20> type;
04668 };
04669 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04670     typename T6, typename T7, typename T8, typename T9, typename T10,
04671     typename T11, typename T12, typename T13, typename T14, typename T15,
04672     typename T16, typename T17, typename T18, typename T19, typename T20,
04673     typename T21>
04674 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04675     T16, T17, T18, T19, T20, T21, internal::None, internal::None,
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> {
04683   typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04684       T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
04685 };
04686 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04687     typename T6, typename T7, typename T8, typename T9, typename T10,
04688     typename T11, typename T12, typename T13, typename T14, typename T15,
04689     typename T16, typename T17, typename T18, typename T19, typename T20,
04690     typename T21, typename T22>
04691 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04692     T16, T17, T18, T19, T20, T21, T22, 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> {
04700   typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04701       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
04702 };
04703 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04704     typename T6, typename T7, typename T8, typename T9, typename T10,
04705     typename T11, typename T12, typename T13, typename T14, typename T15,
04706     typename T16, typename T17, typename T18, typename T19, typename T20,
04707     typename T21, typename T22, typename T23>
04708 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04709     T16, T17, T18, T19, T20, T21, T22, T23, 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> {
04717   typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04718       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
04719 };
04720 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04721     typename T6, typename T7, typename T8, typename T9, typename T10,
04722     typename T11, typename T12, typename T13, typename T14, typename T15,
04723     typename T16, typename T17, typename T18, typename T19, typename T20,
04724     typename T21, typename T22, typename T23, typename T24>
04725 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04726     T16, T17, T18, T19, T20, T21, T22, T23, T24, 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> {
04734   typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04735       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
04736 };
04737 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04738     typename T6, typename T7, typename T8, typename T9, typename T10,
04739     typename T11, typename T12, typename T13, typename T14, typename T15,
04740     typename T16, typename T17, typename T18, typename T19, typename T20,
04741     typename T21, typename T22, typename T23, typename T24, typename T25>
04742 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04743     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, 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   typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04751       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
04752 };
04753 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04754     typename T6, typename T7, typename T8, typename T9, typename T10,
04755     typename T11, typename T12, typename T13, typename T14, typename T15,
04756     typename T16, typename T17, typename T18, typename T19, typename T20,
04757     typename T21, typename T22, typename T23, typename T24, typename T25,
04758     typename T26>
04759 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04760     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, 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> {
04767   typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04768       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
04769       T26> 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     typename T21, typename T22, typename T23, typename T24, typename T25,
04776     typename T26, typename T27>
04777 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04778     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, 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, internal::None,
04784     internal::None, internal::None> {
04785   typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04786       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04787       T27> type;
04788 };
04789 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04790     typename T6, typename T7, typename T8, typename T9, typename T10,
04791     typename T11, typename T12, typename T13, typename T14, typename T15,
04792     typename T16, typename T17, typename T18, typename T19, typename T20,
04793     typename T21, typename T22, typename T23, typename T24, typename T25,
04794     typename T26, typename T27, typename T28>
04795 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04796     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
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, internal::None,
04801     internal::None, internal::None, internal::None, internal::None,
04802     internal::None, internal::None> {
04803   typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04804       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04805       T27, T28> type;
04806 };
04807 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04808     typename T6, typename T7, typename T8, typename T9, typename T10,
04809     typename T11, typename T12, typename T13, typename T14, typename T15,
04810     typename T16, typename T17, typename T18, typename T19, typename T20,
04811     typename T21, typename T22, typename T23, typename T24, typename T25,
04812     typename T26, typename T27, typename T28, typename T29>
04813 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04814     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04815     internal::None, internal::None, internal::None, internal::None,
04816     internal::None, internal::None, internal::None, internal::None,
04817     internal::None, internal::None, internal::None, internal::None,
04818     internal::None, internal::None, internal::None, internal::None,
04819     internal::None, internal::None, internal::None, internal::None,
04820     internal::None> {
04821   typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04822       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04823       T27, T28, T29> type;
04824 };
04825 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04826     typename T6, typename T7, typename T8, typename T9, typename T10,
04827     typename T11, typename T12, typename T13, typename T14, typename T15,
04828     typename T16, typename T17, typename T18, typename T19, typename T20,
04829     typename T21, typename T22, typename T23, typename T24, typename T25,
04830     typename T26, typename T27, typename T28, typename T29, typename T30>
04831 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04832     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04833     internal::None, internal::None, internal::None, internal::None,
04834     internal::None, internal::None, internal::None, internal::None,
04835     internal::None, internal::None, internal::None, internal::None,
04836     internal::None, internal::None, internal::None, internal::None,
04837     internal::None, internal::None, internal::None, internal::None> {
04838   typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04839       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04840       T27, T28, T29, T30> type;
04841 };
04842 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04843     typename T6, typename T7, typename T8, typename T9, typename T10,
04844     typename T11, typename T12, typename T13, typename T14, typename T15,
04845     typename T16, typename T17, typename T18, typename T19, typename T20,
04846     typename T21, typename T22, typename T23, typename T24, typename T25,
04847     typename T26, typename T27, typename T28, typename T29, typename T30,
04848     typename T31>
04849 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04850     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04851     T31, internal::None, internal::None, internal::None, internal::None,
04852     internal::None, internal::None, internal::None, internal::None,
04853     internal::None, internal::None, internal::None, internal::None,
04854     internal::None, internal::None, internal::None, internal::None,
04855     internal::None, internal::None, internal::None> {
04856   typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04857       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04858       T27, T28, T29, T30, T31> type;
04859 };
04860 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04861     typename T6, typename T7, typename T8, typename T9, typename T10,
04862     typename T11, typename T12, typename T13, typename T14, typename T15,
04863     typename T16, typename T17, typename T18, typename T19, typename T20,
04864     typename T21, typename T22, typename T23, typename T24, typename T25,
04865     typename T26, typename T27, typename T28, typename T29, typename T30,
04866     typename T31, typename T32>
04867 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04868     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04869     T31, T32, internal::None, internal::None, internal::None, internal::None,
04870     internal::None, internal::None, internal::None, internal::None,
04871     internal::None, internal::None, internal::None, internal::None,
04872     internal::None, internal::None, internal::None, internal::None,
04873     internal::None, internal::None> {
04874   typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04875       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04876       T27, T28, T29, T30, T31, T32> type;
04877 };
04878 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04879     typename T6, typename T7, typename T8, typename T9, typename T10,
04880     typename T11, typename T12, typename T13, typename T14, typename T15,
04881     typename T16, typename T17, typename T18, typename T19, typename T20,
04882     typename T21, typename T22, typename T23, typename T24, typename T25,
04883     typename T26, typename T27, typename T28, typename T29, typename T30,
04884     typename T31, typename T32, typename T33>
04885 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04886     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04887     T31, T32, T33, internal::None, internal::None, internal::None,
04888     internal::None, internal::None, internal::None, internal::None,
04889     internal::None, internal::None, internal::None, internal::None,
04890     internal::None, internal::None, internal::None, internal::None,
04891     internal::None, internal::None> {
04892   typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04893       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04894       T27, T28, T29, T30, T31, T32, T33> type;
04895 };
04896 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04897     typename T6, typename T7, typename T8, typename T9, typename T10,
04898     typename T11, typename T12, typename T13, typename T14, typename T15,
04899     typename T16, typename T17, typename T18, typename T19, typename T20,
04900     typename T21, typename T22, typename T23, typename T24, typename T25,
04901     typename T26, typename T27, typename T28, typename T29, typename T30,
04902     typename T31, typename T32, typename T33, typename T34>
04903 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04904     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04905     T31, T32, T33, T34, internal::None, internal::None, internal::None,
04906     internal::None, internal::None, internal::None, internal::None,
04907     internal::None, internal::None, internal::None, internal::None,
04908     internal::None, internal::None, internal::None, internal::None,
04909     internal::None> {
04910   typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04911       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04912       T27, T28, T29, T30, T31, T32, T33, T34> type;
04913 };
04914 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04915     typename T6, typename T7, typename T8, typename T9, typename T10,
04916     typename T11, typename T12, typename T13, typename T14, typename T15,
04917     typename T16, typename T17, typename T18, typename T19, typename T20,
04918     typename T21, typename T22, typename T23, typename T24, typename T25,
04919     typename T26, typename T27, typename T28, typename T29, typename T30,
04920     typename T31, typename T32, typename T33, typename T34, typename T35>
04921 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04922     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04923     T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
04924     internal::None, internal::None, internal::None, internal::None,
04925     internal::None, internal::None, internal::None, internal::None,
04926     internal::None, internal::None, internal::None, internal::None> {
04927   typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04928       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04929       T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
04930 };
04931 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04932     typename T6, typename T7, typename T8, typename T9, typename T10,
04933     typename T11, typename T12, typename T13, typename T14, typename T15,
04934     typename T16, typename T17, typename T18, typename T19, typename T20,
04935     typename T21, typename T22, typename T23, typename T24, typename T25,
04936     typename T26, typename T27, typename T28, typename T29, typename T30,
04937     typename T31, typename T32, typename T33, typename T34, typename T35,
04938     typename T36>
04939 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04940     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04941     T31, T32, T33, T34, T35, T36, internal::None, internal::None,
04942     internal::None, internal::None, internal::None, internal::None,
04943     internal::None, internal::None, internal::None, internal::None,
04944     internal::None, internal::None, internal::None, internal::None> {
04945   typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04946       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04947       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
04948 };
04949 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04950     typename T6, typename T7, typename T8, typename T9, typename T10,
04951     typename T11, typename T12, typename T13, typename T14, typename T15,
04952     typename T16, typename T17, typename T18, typename T19, typename T20,
04953     typename T21, typename T22, typename T23, typename T24, typename T25,
04954     typename T26, typename T27, typename T28, typename T29, typename T30,
04955     typename T31, typename T32, typename T33, typename T34, typename T35,
04956     typename T36, typename T37>
04957 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04958     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04959     T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
04960     internal::None, internal::None, internal::None, internal::None,
04961     internal::None, internal::None, internal::None, internal::None,
04962     internal::None, internal::None, internal::None> {
04963   typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04964       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04965       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
04966 };
04967 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04968     typename T6, typename T7, typename T8, typename T9, typename T10,
04969     typename T11, typename T12, typename T13, typename T14, typename T15,
04970     typename T16, typename T17, typename T18, typename T19, typename T20,
04971     typename T21, typename T22, typename T23, typename T24, typename T25,
04972     typename T26, typename T27, typename T28, typename T29, typename T30,
04973     typename T31, typename T32, typename T33, typename T34, typename T35,
04974     typename T36, typename T37, typename T38>
04975 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04976     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04977     T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
04978     internal::None, internal::None, internal::None, internal::None,
04979     internal::None, internal::None, internal::None, internal::None,
04980     internal::None, internal::None> {
04981   typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04982       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04983       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
04984 };
04985 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04986     typename T6, typename T7, typename T8, typename T9, typename T10,
04987     typename T11, typename T12, typename T13, typename T14, typename T15,
04988     typename T16, typename T17, typename T18, typename T19, typename T20,
04989     typename T21, typename T22, typename T23, typename T24, typename T25,
04990     typename T26, typename T27, typename T28, typename T29, typename T30,
04991     typename T31, typename T32, typename T33, typename T34, typename T35,
04992     typename T36, typename T37, typename T38, typename T39>
04993 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04994     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04995     T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
04996     internal::None, internal::None, internal::None, internal::None,
04997     internal::None, internal::None, internal::None, internal::None,
04998     internal::None, internal::None> {
04999   typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05000       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05001       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
05002 };
05003 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05004     typename T6, typename T7, typename T8, typename T9, typename T10,
05005     typename T11, typename T12, typename T13, typename T14, typename T15,
05006     typename T16, typename T17, typename T18, typename T19, typename T20,
05007     typename T21, typename T22, typename T23, typename T24, typename T25,
05008     typename T26, typename T27, typename T28, typename T29, typename T30,
05009     typename T31, typename T32, typename T33, typename T34, typename T35,
05010     typename T36, typename T37, typename T38, typename T39, typename T40>
05011 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05012     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05013     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
05014     internal::None, internal::None, internal::None, internal::None,
05015     internal::None, internal::None, internal::None, internal::None,
05016     internal::None> {
05017   typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05018       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05019       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
05020       T40> type;
05021 };
05022 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05023     typename T6, typename T7, typename T8, typename T9, typename T10,
05024     typename T11, typename T12, typename T13, typename T14, typename T15,
05025     typename T16, typename T17, typename T18, typename T19, typename T20,
05026     typename T21, typename T22, typename T23, typename T24, typename T25,
05027     typename T26, typename T27, typename T28, typename T29, typename T30,
05028     typename T31, typename T32, typename T33, typename T34, typename T35,
05029     typename T36, typename T37, typename T38, typename T39, typename T40,
05030     typename T41>
05031 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05032     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05033     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
05034     internal::None, internal::None, internal::None, internal::None,
05035     internal::None, internal::None, internal::None, internal::None> {
05036   typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05037       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05038       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05039       T41> type;
05040 };
05041 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05042     typename T6, typename T7, typename T8, typename T9, typename T10,
05043     typename T11, typename T12, typename T13, typename T14, typename T15,
05044     typename T16, typename T17, typename T18, typename T19, typename T20,
05045     typename T21, typename T22, typename T23, typename T24, typename T25,
05046     typename T26, typename T27, typename T28, typename T29, typename T30,
05047     typename T31, typename T32, typename T33, typename T34, typename T35,
05048     typename T36, typename T37, typename T38, typename T39, typename T40,
05049     typename T41, typename T42>
05050 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05051     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05052     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
05053     internal::None, internal::None, internal::None, internal::None,
05054     internal::None, internal::None, internal::None> {
05055   typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05056       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05057       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05058       T41, T42> type;
05059 };
05060 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05061     typename T6, typename T7, typename T8, typename T9, typename T10,
05062     typename T11, typename T12, typename T13, typename T14, typename T15,
05063     typename T16, typename T17, typename T18, typename T19, typename T20,
05064     typename T21, typename T22, typename T23, typename T24, typename T25,
05065     typename T26, typename T27, typename T28, typename T29, typename T30,
05066     typename T31, typename T32, typename T33, typename T34, typename T35,
05067     typename T36, typename T37, typename T38, typename T39, typename T40,
05068     typename T41, typename T42, typename T43>
05069 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05070     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05071     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
05072     internal::None, internal::None, internal::None, internal::None,
05073     internal::None, internal::None, internal::None> {
05074   typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05075       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05076       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05077       T41, T42, T43> type;
05078 };
05079 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05080     typename T6, typename T7, typename T8, typename T9, typename T10,
05081     typename T11, typename T12, typename T13, typename T14, typename T15,
05082     typename T16, typename T17, typename T18, typename T19, typename T20,
05083     typename T21, typename T22, typename T23, typename T24, typename T25,
05084     typename T26, typename T27, typename T28, typename T29, typename T30,
05085     typename T31, typename T32, typename T33, typename T34, typename T35,
05086     typename T36, typename T37, typename T38, typename T39, typename T40,
05087     typename T41, typename T42, typename T43, typename T44>
05088 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05089     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05090     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
05091     internal::None, internal::None, internal::None, internal::None,
05092     internal::None, internal::None> {
05093   typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05094       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05095       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05096       T41, T42, T43, T44> type;
05097 };
05098 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05099     typename T6, typename T7, typename T8, typename T9, typename T10,
05100     typename T11, typename T12, typename T13, typename T14, typename T15,
05101     typename T16, typename T17, typename T18, typename T19, typename T20,
05102     typename T21, typename T22, typename T23, typename T24, typename T25,
05103     typename T26, typename T27, typename T28, typename T29, typename T30,
05104     typename T31, typename T32, typename T33, typename T34, typename T35,
05105     typename T36, typename T37, typename T38, typename T39, typename T40,
05106     typename T41, typename T42, typename T43, typename T44, typename T45>
05107 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05108     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05109     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05110     internal::None, internal::None, internal::None, internal::None,
05111     internal::None> {
05112   typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05113       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05114       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05115       T41, T42, T43, T44, T45> type;
05116 };
05117 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05118     typename T6, typename T7, typename T8, typename T9, typename T10,
05119     typename T11, typename T12, typename T13, typename T14, typename T15,
05120     typename T16, typename T17, typename T18, typename T19, typename T20,
05121     typename T21, typename T22, typename T23, typename T24, typename T25,
05122     typename T26, typename T27, typename T28, typename T29, typename T30,
05123     typename T31, typename T32, typename T33, typename T34, typename T35,
05124     typename T36, typename T37, typename T38, typename T39, typename T40,
05125     typename T41, typename T42, typename T43, typename T44, typename T45,
05126     typename T46>
05127 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05128     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05129     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05130     T46, internal::None, internal::None, internal::None, internal::None> {
05131   typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05132       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05133       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05134       T41, T42, T43, T44, T45, T46> type;
05135 };
05136 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05137     typename T6, typename T7, typename T8, typename T9, typename T10,
05138     typename T11, typename T12, typename T13, typename T14, typename T15,
05139     typename T16, typename T17, typename T18, typename T19, typename T20,
05140     typename T21, typename T22, typename T23, typename T24, typename T25,
05141     typename T26, typename T27, typename T28, typename T29, typename T30,
05142     typename T31, typename T32, typename T33, typename T34, typename T35,
05143     typename T36, typename T37, typename T38, typename T39, typename T40,
05144     typename T41, typename T42, typename T43, typename T44, typename T45,
05145     typename T46, typename T47>
05146 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05147     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05148     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05149     T46, T47, internal::None, internal::None, internal::None> {
05150   typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05151       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05152       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05153       T41, T42, T43, T44, T45, T46, T47> type;
05154 };
05155 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05156     typename T6, typename T7, typename T8, typename T9, typename T10,
05157     typename T11, typename T12, typename T13, typename T14, typename T15,
05158     typename T16, typename T17, typename T18, typename T19, typename T20,
05159     typename T21, typename T22, typename T23, typename T24, typename T25,
05160     typename T26, typename T27, typename T28, typename T29, typename T30,
05161     typename T31, typename T32, typename T33, typename T34, typename T35,
05162     typename T36, typename T37, typename T38, typename T39, typename T40,
05163     typename T41, typename T42, typename T43, typename T44, typename T45,
05164     typename T46, typename T47, typename T48>
05165 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05166     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05167     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05168     T46, T47, T48, internal::None, internal::None> {
05169   typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05170       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05171       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05172       T41, T42, T43, T44, T45, T46, T47, T48> type;
05173 };
05174 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05175     typename T6, typename T7, typename T8, typename T9, typename T10,
05176     typename T11, typename T12, typename T13, typename T14, typename T15,
05177     typename T16, typename T17, typename T18, typename T19, typename T20,
05178     typename T21, typename T22, typename T23, typename T24, typename T25,
05179     typename T26, typename T27, typename T28, typename T29, typename T30,
05180     typename T31, typename T32, typename T33, typename T34, typename T35,
05181     typename T36, typename T37, typename T38, typename T39, typename T40,
05182     typename T41, typename T42, typename T43, typename T44, typename T45,
05183     typename T46, typename T47, typename T48, typename T49>
05184 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05185     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05186     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05187     T46, T47, T48, T49, internal::None> {
05188   typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05189       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05190       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05191       T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
05192 };
05193 
05194 namespace internal {
05195 
05196 # define GTEST_TEMPLATE_ template <typename T> class
05197 
05198 // The template "selector" struct TemplateSel<Tmpl> is used to
05199 // represent Tmpl, which must be a class template with one type
05200 // parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
05201 // as the type Tmpl<T>.  This allows us to actually instantiate the
05202 // template "selected" by TemplateSel<Tmpl>.
05203 //
05204 // This trick is necessary for simulating typedef for class templates,
05205 // which C++ doesn't support directly.
05206 template <GTEST_TEMPLATE_ Tmpl>
05207 struct TemplateSel {
05208   template <typename T>
05209   struct Bind {
05210     typedef Tmpl<T> type;
05211   };
05212 };
05213 
05214 # define GTEST_BIND_(TmplSel, T) \
05215   TmplSel::template Bind<T>::type
05216 
05217 // A unique struct template used as the default value for the
05218 // arguments of class template Templates.  This allows us to simulate
05219 // variadic templates (e.g. Templates<int>, Templates<int, double>,
05220 // and etc), which C++ doesn't support directly.
05221 template <typename T>
05222 struct NoneT {};
05223 
05224 // The following family of struct and struct templates are used to
05225 // represent template lists.  In particular, TemplatesN<T1, T2, ...,
05226 // TN> represents a list of N templates (T1, T2, ..., and TN).  Except
05227 // for Templates0, every struct in the family has two member types:
05228 // Head for the selector of the first template in the list, and Tail
05229 // for the rest of the list.
05230 
05231 // The empty template list.
05232 struct Templates0 {};
05233 
05234 // Template lists of length 1, 2, 3, and so on.
05235 
05236 template <GTEST_TEMPLATE_ T1>
05237 struct Templates1 {
05238   typedef TemplateSel<T1> Head;
05239   typedef Templates0 Tail;
05240 };
05241 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
05242 struct Templates2 {
05243   typedef TemplateSel<T1> Head;
05244   typedef Templates1<T2> Tail;
05245 };
05246 
05247 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
05248 struct Templates3 {
05249   typedef TemplateSel<T1> Head;
05250   typedef Templates2<T2, T3> Tail;
05251 };
05252 
05253 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05254     GTEST_TEMPLATE_ T4>
05255 struct Templates4 {
05256   typedef TemplateSel<T1> Head;
05257   typedef Templates3<T2, T3, T4> Tail;
05258 };
05259 
05260 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05261     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
05262 struct Templates5 {
05263   typedef TemplateSel<T1> Head;
05264   typedef Templates4<T2, T3, T4, T5> Tail;
05265 };
05266 
05267 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05268     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
05269 struct Templates6 {
05270   typedef TemplateSel<T1> Head;
05271   typedef Templates5<T2, T3, T4, T5, T6> Tail;
05272 };
05273 
05274 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05275     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05276     GTEST_TEMPLATE_ T7>
05277 struct Templates7 {
05278   typedef TemplateSel<T1> Head;
05279   typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
05280 };
05281 
05282 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05283     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05284     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
05285 struct Templates8 {
05286   typedef TemplateSel<T1> Head;
05287   typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
05288 };
05289 
05290 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05291     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05292     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
05293 struct Templates9 {
05294   typedef TemplateSel<T1> Head;
05295   typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
05296 };
05297 
05298 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05299     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05300     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05301     GTEST_TEMPLATE_ T10>
05302 struct Templates10 {
05303   typedef TemplateSel<T1> Head;
05304   typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
05305 };
05306 
05307 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05308     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05309     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05310     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
05311 struct Templates11 {
05312   typedef TemplateSel<T1> Head;
05313   typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
05314 };
05315 
05316 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05317     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05318     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05319     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
05320 struct Templates12 {
05321   typedef TemplateSel<T1> Head;
05322   typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
05323 };
05324 
05325 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05326     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05327     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05328     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05329     GTEST_TEMPLATE_ T13>
05330 struct Templates13 {
05331   typedef TemplateSel<T1> Head;
05332   typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
05333 };
05334 
05335 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05336     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05337     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05338     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05339     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
05340 struct Templates14 {
05341   typedef TemplateSel<T1> Head;
05342   typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
05343       T14> Tail;
05344 };
05345 
05346 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05347     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05348     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05349     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05350     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
05351 struct Templates15 {
05352   typedef TemplateSel<T1> Head;
05353   typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05354       T15> Tail;
05355 };
05356 
05357 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05358     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05359     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05360     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05361     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05362     GTEST_TEMPLATE_ T16>
05363 struct Templates16 {
05364   typedef TemplateSel<T1> Head;
05365   typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05366       T15, T16> Tail;
05367 };
05368 
05369 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05370     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05371     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05372     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05373     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05374     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
05375 struct Templates17 {
05376   typedef TemplateSel<T1> Head;
05377   typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05378       T15, T16, T17> Tail;
05379 };
05380 
05381 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05382     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05383     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05384     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05385     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05386     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
05387 struct Templates18 {
05388   typedef TemplateSel<T1> Head;
05389   typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05390       T15, T16, T17, T18> Tail;
05391 };
05392 
05393 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05394     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05395     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05396     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05397     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05398     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05399     GTEST_TEMPLATE_ T19>
05400 struct Templates19 {
05401   typedef TemplateSel<T1> Head;
05402   typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05403       T15, T16, T17, T18, T19> Tail;
05404 };
05405 
05406 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05407     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05408     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05409     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05410     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05411     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05412     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
05413 struct Templates20 {
05414   typedef TemplateSel<T1> Head;
05415   typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05416       T15, T16, T17, T18, T19, T20> Tail;
05417 };
05418 
05419 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05420     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05421     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05422     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05423     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05424     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05425     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
05426 struct Templates21 {
05427   typedef TemplateSel<T1> Head;
05428   typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05429       T15, T16, T17, T18, T19, T20, T21> Tail;
05430 };
05431 
05432 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05433     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05434     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05435     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05436     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05437     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05438     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05439     GTEST_TEMPLATE_ T22>
05440 struct Templates22 {
05441   typedef TemplateSel<T1> Head;
05442   typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05443       T15, T16, T17, T18, T19, T20, T21, T22> Tail;
05444 };
05445 
05446 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05447     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05448     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05449     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05450     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05451     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05452     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05453     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
05454 struct Templates23 {
05455   typedef TemplateSel<T1> Head;
05456   typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05457       T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
05458 };
05459 
05460 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05461     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05462     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05463     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05464     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05465     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05466     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05467     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
05468 struct Templates24 {
05469   typedef TemplateSel<T1> Head;
05470   typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05471       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
05472 };
05473 
05474 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05475     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05476     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05477     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05478     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05479     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05480     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05481     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05482     GTEST_TEMPLATE_ T25>
05483 struct Templates25 {
05484   typedef TemplateSel<T1> Head;
05485   typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05486       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
05487 };
05488 
05489 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05490     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05491     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05492     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05493     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05494     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05495     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05496     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05497     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
05498 struct Templates26 {
05499   typedef TemplateSel<T1> Head;
05500   typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05501       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
05502 };
05503 
05504 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05505     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05506     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05507     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05508     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05509     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05510     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05511     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05512     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
05513 struct Templates27 {
05514   typedef TemplateSel<T1> Head;
05515   typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05516       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
05517 };
05518 
05519 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05520     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05521     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05522     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05523     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05524     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05525     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05526     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05527     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05528     GTEST_TEMPLATE_ T28>
05529 struct Templates28 {
05530   typedef TemplateSel<T1> Head;
05531   typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05532       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
05533       T28> Tail;
05534 };
05535 
05536 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05537     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05538     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05539     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05540     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05541     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05542     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05543     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05544     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05545     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
05546 struct Templates29 {
05547   typedef TemplateSel<T1> Head;
05548   typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05549       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05550       T29> Tail;
05551 };
05552 
05553 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05554     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05555     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05556     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05557     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05558     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05559     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05560     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05561     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05562     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
05563 struct Templates30 {
05564   typedef TemplateSel<T1> Head;
05565   typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05566       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05567       T29, T30> Tail;
05568 };
05569 
05570 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05571     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05572     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05573     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05574     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05575     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05576     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05577     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05578     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05579     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05580     GTEST_TEMPLATE_ T31>
05581 struct Templates31 {
05582   typedef TemplateSel<T1> Head;
05583   typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05584       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05585       T29, T30, T31> Tail;
05586 };
05587 
05588 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05589     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05590     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05591     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05592     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05593     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05594     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05595     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05596     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05597     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05598     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
05599 struct Templates32 {
05600   typedef TemplateSel<T1> Head;
05601   typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05602       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05603       T29, T30, T31, T32> Tail;
05604 };
05605 
05606 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05607     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05608     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05609     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05610     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05611     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05612     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05613     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05614     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05615     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05616     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
05617 struct Templates33 {
05618   typedef TemplateSel<T1> Head;
05619   typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05620       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05621       T29, T30, T31, T32, T33> Tail;
05622 };
05623 
05624 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05625     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05626     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05627     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05628     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05629     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05630     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05631     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05632     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05633     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05634     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05635     GTEST_TEMPLATE_ T34>
05636 struct Templates34 {
05637   typedef TemplateSel<T1> Head;
05638   typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05639       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05640       T29, T30, T31, T32, T33, T34> Tail;
05641 };
05642 
05643 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05644     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05645     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05646     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05647     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05648     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05649     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05650     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05651     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05652     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05653     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05654     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
05655 struct Templates35 {
05656   typedef TemplateSel<T1> Head;
05657   typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05658       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05659       T29, T30, T31, T32, T33, T34, T35> Tail;
05660 };
05661 
05662 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05663     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05664     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05665     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05666     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05667     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05668     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05669     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05670     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05671     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05672     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05673     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
05674 struct Templates36 {
05675   typedef TemplateSel<T1> Head;
05676   typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05677       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05678       T29, T30, T31, T32, T33, T34, T35, T36> Tail;
05679 };
05680 
05681 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05682     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05683     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05684     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05685     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05686     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05687     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05688     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05689     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05690     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05691     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05692     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05693     GTEST_TEMPLATE_ T37>
05694 struct Templates37 {
05695   typedef TemplateSel<T1> Head;
05696   typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05697       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05698       T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
05699 };
05700 
05701 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05702     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05703     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05704     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05705     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05706     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05707     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05708     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05709     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05710     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05711     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05712     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05713     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
05714 struct Templates38 {
05715   typedef TemplateSel<T1> Head;
05716   typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05717       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05718       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
05719 };
05720 
05721 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05722     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05723     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05724     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05725     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05726     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05727     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05728     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05729     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05730     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05731     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05732     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05733     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
05734 struct Templates39 {
05735   typedef TemplateSel<T1> Head;
05736   typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05737       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05738       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
05739 };
05740 
05741 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05742     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05743     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05744     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05745     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05746     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05747     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05748     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05749     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05750     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05751     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05752     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05753     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05754     GTEST_TEMPLATE_ T40>
05755 struct Templates40 {
05756   typedef TemplateSel<T1> Head;
05757   typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05758       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05759       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
05760 };
05761 
05762 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05763     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05764     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05765     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05766     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05767     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05768     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05769     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05770     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05771     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05772     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05773     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05774     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05775     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
05776 struct Templates41 {
05777   typedef TemplateSel<T1> Head;
05778   typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05779       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05780       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
05781 };
05782 
05783 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05784     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05785     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05786     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05787     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05788     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05789     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05790     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05791     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05792     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05793     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05794     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05795     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05796     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
05797 struct Templates42 {
05798   typedef TemplateSel<T1> Head;
05799   typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05800       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05801       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
05802       T42> Tail;
05803 };
05804 
05805 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05806     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05807     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05808     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05809     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05810     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05811     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05812     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05813     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05814     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05815     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05816     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05817     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05818     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05819     GTEST_TEMPLATE_ T43>
05820 struct Templates43 {
05821   typedef TemplateSel<T1> Head;
05822   typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05823       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05824       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05825       T43> Tail;
05826 };
05827 
05828 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05829     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05830     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05831     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05832     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05833     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05834     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05835     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05836     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05837     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05838     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05839     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05840     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05841     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05842     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
05843 struct Templates44 {
05844   typedef TemplateSel<T1> Head;
05845   typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05846       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05847       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05848       T43, T44> Tail;
05849 };
05850 
05851 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05852     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05853     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05854     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05855     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05856     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05857     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05858     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05859     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05860     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05861     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05862     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05863     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05864     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05865     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
05866 struct Templates45 {
05867   typedef TemplateSel<T1> Head;
05868   typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05869       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05870       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05871       T43, T44, T45> Tail;
05872 };
05873 
05874 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05875     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05876     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05877     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05878     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05879     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05880     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05881     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05882     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05883     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05884     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05885     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05886     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05887     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05888     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
05889     GTEST_TEMPLATE_ T46>
05890 struct Templates46 {
05891   typedef TemplateSel<T1> Head;
05892   typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05893       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05894       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05895       T43, T44, T45, T46> Tail;
05896 };
05897 
05898 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05899     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05900     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05901     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05902     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05903     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05904     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05905     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05906     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05907     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05908     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05909     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05910     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05911     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05912     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
05913     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
05914 struct Templates47 {
05915   typedef TemplateSel<T1> Head;
05916   typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05917       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05918       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05919       T43, T44, T45, T46, T47> Tail;
05920 };
05921 
05922 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05923     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05924     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05925     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05926     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05927     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05928     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05929     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05930     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05931     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05932     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05933     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05934     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05935     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05936     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
05937     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
05938 struct Templates48 {
05939   typedef TemplateSel<T1> Head;
05940   typedef Templates47<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, T44, T45, T46, T47, T48> 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, GTEST_TEMPLATE_ T45,
05961     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
05962     GTEST_TEMPLATE_ T49>
05963 struct Templates49 {
05964   typedef TemplateSel<T1> Head;
05965   typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05966       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05967       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05968       T43, T44, T45, T46, T47, T48, T49> Tail;
05969 };
05970 
05971 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05972     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05973     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05974     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05975     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05976     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05977     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05978     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05979     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05980     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05981     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05982     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05983     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05984     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05985     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
05986     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
05987     GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
05988 struct Templates50 {
05989   typedef TemplateSel<T1> Head;
05990   typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05991       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05992       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05993       T43, T44, T45, T46, T47, T48, T49, T50> Tail;
05994 };
05995 
05996 
05997 // We don't want to require the users to write TemplatesN<...> directly,
05998 // as that would require them to count the length.  Templates<...> is much
05999 // easier to write, but generates horrible messages when there is a
06000 // compiler error, as gcc insists on printing out each template
06001 // argument, even if it has the default value (this means Templates<list>
06002 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
06003 // errors).
06004 //
06005 // Our solution is to combine the best part of the two approaches: a
06006 // user would write Templates<T1, ..., TN>, and Google Test will translate
06007 // that to TemplatesN<T1, ..., TN> internally to make error messages
06008 // readable.  The translation is done by the 'type' member of the
06009 // Templates template.
06010 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
06011     GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
06012     GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
06013     GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
06014     GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
06015     GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
06016     GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
06017     GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
06018     GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
06019     GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
06020     GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
06021     GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
06022     GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
06023     GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
06024     GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
06025     GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
06026     GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
06027     GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
06028     GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
06029     GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
06030     GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
06031     GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
06032     GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
06033     GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
06034     GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
06035 struct Templates {
06036   typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06037       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06038       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06039       T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
06040 };
06041 
06042 template <>
06043 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06044     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06045     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06046     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06047     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06048     NoneT> {
06049   typedef Templates0 type;
06050 };
06051 template <GTEST_TEMPLATE_ T1>
06052 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06053     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06054     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06055     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06056     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06057     NoneT> {
06058   typedef Templates1<T1> type;
06059 };
06060 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
06061 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06062     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06063     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06064     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06065     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06066     NoneT> {
06067   typedef Templates2<T1, T2> type;
06068 };
06069 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
06070 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06071     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06072     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06073     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06074     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06075   typedef Templates3<T1, T2, T3> type;
06076 };
06077 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06078     GTEST_TEMPLATE_ T4>
06079 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06080     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06081     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06082     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06083     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06084   typedef Templates4<T1, T2, T3, T4> type;
06085 };
06086 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06087     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
06088 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06089     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06090     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06091     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06092     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06093   typedef Templates5<T1, T2, T3, T4, T5> type;
06094 };
06095 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06096     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
06097 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
06098     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06099     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06100     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06101     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06102   typedef Templates6<T1, T2, T3, T4, T5, T6> type;
06103 };
06104 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06105     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06106     GTEST_TEMPLATE_ T7>
06107 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
06108     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06109     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06110     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06111     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06112   typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
06113 };
06114 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06115     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06116     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
06117 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
06118     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06119     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06120     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06121     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06122   typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
06123 };
06124 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06125     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06126     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
06127 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
06128     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06129     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06130     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06131     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06132   typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
06133 };
06134 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06135     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06136     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06137     GTEST_TEMPLATE_ T10>
06138 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
06139     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06140     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06141     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06142     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06143   typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
06144 };
06145 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06146     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06147     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06148     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
06149 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
06150     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06151     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06152     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06153     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06154   typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
06155 };
06156 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06157     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06158     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06159     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
06160 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
06161     NoneT, 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> {
06165   typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
06166 };
06167 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06168     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06169     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06170     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06171     GTEST_TEMPLATE_ T13>
06172 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, 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, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06176     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06177   typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
06178       T13> type;
06179 };
06180 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06181     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06182     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06183     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06184     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
06185 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06186     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06187     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06188     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06189     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06190   typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06191       T14> type;
06192 };
06193 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06194     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06195     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06196     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06197     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
06198 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06199     T15, 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     NoneT, NoneT, NoneT, NoneT, NoneT> {
06203   typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06204       T14, T15> type;
06205 };
06206 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06207     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06208     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06209     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06210     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06211     GTEST_TEMPLATE_ T16>
06212 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06213     T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06214     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06215     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06216     NoneT, NoneT, NoneT, NoneT, NoneT> {
06217   typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06218       T14, T15, T16> type;
06219 };
06220 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06221     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06222     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06223     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06224     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06225     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
06226 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06227     T15, T16, T17, 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, NoneT, NoneT,
06230     NoneT, NoneT, NoneT, NoneT, NoneT> {
06231   typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06232       T14, T15, T16, T17> type;
06233 };
06234 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06235     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06236     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06237     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06238     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06239     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
06240 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06241     T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06242     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06243     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06244     NoneT, NoneT, NoneT, NoneT> {
06245   typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06246       T14, T15, T16, T17, T18> type;
06247 };
06248 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06249     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06250     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06251     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06252     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06253     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06254     GTEST_TEMPLATE_ T19>
06255 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06256     T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, 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> {
06260   typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06261       T14, T15, T16, T17, T18, T19> 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, GTEST_TEMPLATE_ T12,
06267     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06268     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06269     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
06270 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06271     T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06272     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06273     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06274     NoneT, NoneT, NoneT, NoneT> {
06275   typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06276       T14, T15, T16, T17, T18, T19, T20> type;
06277 };
06278 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06279     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06280     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06281     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06282     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06283     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06284     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
06285 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06286     T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
06287     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06288     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06289     NoneT, NoneT, NoneT, NoneT> {
06290   typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06291       T14, T15, T16, T17, T18, T19, T20, T21> type;
06292 };
06293 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06294     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06295     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06296     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06297     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06298     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06299     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06300     GTEST_TEMPLATE_ T22>
06301 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06302     T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
06303     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06304     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06305     NoneT, NoneT, NoneT> {
06306   typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06307       T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
06308 };
06309 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06310     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06311     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06312     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06313     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06314     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06315     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06316     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
06317 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06318     T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
06319     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06320     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06321     NoneT, NoneT, NoneT> {
06322   typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06323       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
06324 };
06325 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06326     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06327     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06328     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06329     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06330     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06331     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06332     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
06333 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06334     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
06335     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06336     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06337     NoneT, NoneT, NoneT> {
06338   typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06339       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
06340 };
06341 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06342     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06343     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06344     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06345     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06346     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06347     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06348     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06349     GTEST_TEMPLATE_ T25>
06350 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06351     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
06352     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06353     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06354     NoneT, NoneT> {
06355   typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06356       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
06357 };
06358 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06359     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06360     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06361     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06362     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06363     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06364     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06365     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06366     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
06367 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06368     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
06369     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06370     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06371     NoneT, NoneT> {
06372   typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06373       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
06374 };
06375 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06376     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06377     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06378     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06379     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06380     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06381     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06382     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06383     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
06384 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06385     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
06386     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06387     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06388     NoneT, NoneT> {
06389   typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06390       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
06391       T27> type;
06392 };
06393 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06394     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06395     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06396     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06397     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06398     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06399     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06400     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06401     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06402     GTEST_TEMPLATE_ T28>
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, T22, T23, T24, T25, T26, T27, T28,
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> {
06408   typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06409       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06410       T28> type;
06411 };
06412 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06413     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06414     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06415     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06416     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06417     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06418     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06419     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06420     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06421     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
06422 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06423     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06424     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06425     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06426     NoneT> {
06427   typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06428       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06429       T28, T29> type;
06430 };
06431 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06432     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06433     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06434     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06435     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06436     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06437     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06438     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06439     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06440     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
06441 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06442     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06443     T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06444     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06445   typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06446       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06447       T28, T29, T30> type;
06448 };
06449 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06450     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06451     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06452     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06453     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06454     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06455     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06456     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06457     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06458     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06459     GTEST_TEMPLATE_ T31>
06460 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06461     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06462     T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06463     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06464   typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06465       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06466       T28, T29, T30, T31> type;
06467 };
06468 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06469     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06470     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06471     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06472     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06473     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06474     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06475     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06476     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06477     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06478     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
06479 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06480     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06481     T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06482     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06483   typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06484       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06485       T28, T29, T30, T31, T32> type;
06486 };
06487 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06488     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06489     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06490     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06491     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06492     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06493     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06494     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06495     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06496     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06497     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
06498 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06499     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06500     T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06501     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06502   typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06503       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06504       T28, T29, T30, T31, T32, T33> type;
06505 };
06506 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06507     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06508     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06509     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06510     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06511     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06512     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06513     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06514     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06515     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06516     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06517     GTEST_TEMPLATE_ T34>
06518 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06519     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06520     T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06521     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06522   typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06523       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06524       T28, T29, T30, T31, T32, T33, T34> type;
06525 };
06526 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06527     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06528     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06529     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06530     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06531     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06532     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06533     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06534     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06535     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06536     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06537     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
06538 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06539     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06540     T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06541     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06542   typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06543       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06544       T28, T29, T30, T31, T32, T33, T34, T35> type;
06545 };
06546 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06547     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06548     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06549     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06550     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06551     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06552     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06553     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06554     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06555     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06556     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06557     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
06558 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06559     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06560     T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
06561     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06562   typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06563       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06564       T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
06565 };
06566 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06567     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06568     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06569     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06570     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06571     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06572     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06573     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06574     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06575     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06576     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06577     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06578     GTEST_TEMPLATE_ T37>
06579 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06580     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06581     T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
06582     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06583   typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06584       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06585       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
06586 };
06587 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06588     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06589     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06590     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06591     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06592     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06593     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06594     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06595     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06596     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06597     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06598     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06599     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
06600 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06601     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06602     T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
06603     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06604   typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06605       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06606       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
06607 };
06608 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06609     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06610     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06611     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06612     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06613     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06614     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06615     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06616     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06617     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06618     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06619     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06620     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
06621 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06622     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06623     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
06624     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06625   typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06626       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06627       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
06628 };
06629 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06630     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06631     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06632     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06633     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06634     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06635     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06636     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06637     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06638     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06639     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06640     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06641     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06642     GTEST_TEMPLATE_ T40>
06643 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06644     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06645     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
06646     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06647   typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06648       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06649       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
06650 };
06651 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06652     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06653     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06654     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06655     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06656     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06657     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06658     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06659     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06660     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06661     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06662     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06663     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06664     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
06665 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06666     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06667     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
06668     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06669   typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06670       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06671       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
06672       T41> type;
06673 };
06674 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06675     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06676     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06677     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06678     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06679     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06680     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06681     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06682     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06683     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06684     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06685     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06686     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06687     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
06688 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06689     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06690     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
06691     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06692   typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06693       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06694       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06695       T42> type;
06696 };
06697 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06698     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06699     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06700     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06701     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06702     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06703     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06704     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06705     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06706     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06707     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06708     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06709     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06710     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06711     GTEST_TEMPLATE_ T43>
06712 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06713     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06714     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
06715     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06716   typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06717       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06718       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06719       T42, T43> type;
06720 };
06721 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06722     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06723     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06724     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06725     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06726     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06727     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06728     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06729     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06730     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06731     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06732     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06733     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06734     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06735     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
06736 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06737     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06738     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06739     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06740   typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06741       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06742       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06743       T42, T43, T44> type;
06744 };
06745 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06746     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06747     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06748     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06749     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06750     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06751     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06752     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06753     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06754     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06755     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06756     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06757     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06758     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06759     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
06760 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06761     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06762     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06763     T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
06764   typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06765       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06766       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06767       T42, T43, T44, T45> 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, GTEST_TEMPLATE_ T42,
06783     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06784     GTEST_TEMPLATE_ T46>
06785 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06786     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06787     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06788     T45, T46, NoneT, NoneT, NoneT, NoneT> {
06789   typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06790       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06791       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06792       T42, T43, T44, T45, T46> type;
06793 };
06794 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06795     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06796     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06797     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06798     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06799     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06800     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06801     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06802     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06803     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06804     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06805     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06806     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06807     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06808     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06809     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
06810 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06811     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06812     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06813     T45, T46, T47, NoneT, NoneT, NoneT> {
06814   typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06815       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06816       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06817       T42, T43, T44, T45, T46, T47> type;
06818 };
06819 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06820     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06821     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06822     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06823     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06824     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06825     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06826     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06827     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06828     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06829     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06830     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06831     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06832     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06833     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06834     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
06835 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06836     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06837     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06838     T45, T46, T47, T48, NoneT, NoneT> {
06839   typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06840       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06841       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06842       T42, T43, T44, T45, T46, T47, T48> type;
06843 };
06844 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06845     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06846     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06847     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06848     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06849     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06850     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06851     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06852     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06853     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06854     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06855     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06856     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06857     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06858     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06859     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06860     GTEST_TEMPLATE_ T49>
06861 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06862     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06863     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06864     T45, T46, T47, T48, T49, NoneT> {
06865   typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06866       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06867       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06868       T42, T43, T44, T45, T46, T47, T48, T49> type;
06869 };
06870 
06871 // The TypeList template makes it possible to use either a single type
06872 // or a Types<...> list in TYPED_TEST_CASE() and
06873 // INSTANTIATE_TYPED_TEST_CASE_P().
06874 
06875 template <typename T>
06876 struct TypeList {
06877   typedef Types1<T> type;
06878 };
06879 
06880 template <typename T1, typename T2, typename T3, typename T4, typename T5,
06881     typename T6, typename T7, typename T8, typename T9, typename T10,
06882     typename T11, typename T12, typename T13, typename T14, typename T15,
06883     typename T16, typename T17, typename T18, typename T19, typename T20,
06884     typename T21, typename T22, typename T23, typename T24, typename T25,
06885     typename T26, typename T27, typename T28, typename T29, typename T30,
06886     typename T31, typename T32, typename T33, typename T34, typename T35,
06887     typename T36, typename T37, typename T38, typename T39, typename T40,
06888     typename T41, typename T42, typename T43, typename T44, typename T45,
06889     typename T46, typename T47, typename T48, typename T49, typename T50>
06890 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06891     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06892     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
06893     T44, T45, T46, T47, T48, T49, T50> > {
06894   typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
06895       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
06896       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
06897       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
06898 };
06899 
06900 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
06901 
06902 }  // namespace internal
06903 }  // namespace testing
06904 
06905 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
06906 
06907 // Due to C++ preprocessor weirdness, we need double indirection to
06908 // concatenate two tokens when one of them is __LINE__.  Writing
06909 //
06910 //   foo ## __LINE__
06911 //
06912 // will result in the token foo__LINE__, instead of foo followed by
06913 // the current line number.  For more details, see
06914 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
06915 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
06916 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
06917 
06918 // Google Test defines the testing::Message class to allow construction of
06919 // test messages via the << operator.  The idea is that anything
06920 // streamable to std::ostream can be streamed to a testing::Message.
06921 // This allows a user to use his own types in Google Test assertions by
06922 // overloading the << operator.
06923 //
06924 // util/gtl/stl_logging-inl.h overloads << for STL containers.  These
06925 // overloads cannot be defined in the std namespace, as that will be
06926 // undefined behavior.  Therefore, they are defined in the global
06927 // namespace instead.
06928 //
06929 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
06930 // overloads are visible in either the std namespace or the global
06931 // namespace, but not other namespaces, including the testing
06932 // namespace which Google Test's Message class is in.
06933 //
06934 // To allow STL containers (and other types that has a << operator
06935 // defined in the global namespace) to be used in Google Test assertions,
06936 // testing::Message must access the custom << operator from the global
06937 // namespace.  Hence this helper function.
06938 //
06939 // Note: Jeffrey Yasskin suggested an alternative fix by "using
06940 // ::operator<<;" in the definition of Message's operator<<.  That fix
06941 // doesn't require a helper function, but unfortunately doesn't
06942 // compile with MSVC.
06943 template <typename T>
06944 inline void GTestStreamToHelper(std::ostream* os, const T& val) {
06945   *os << val;
06946 }
06947 
06948 class ProtocolMessage;
06949 namespace proto2 { class Message; }
06950 
06951 namespace testing {
06952 
06953 // Forward declarations.
06954 
06955 class AssertionResult;                 // Result of an assertion.
06956 class Message;                         // Represents a failure message.
06957 class Test;                            // Represents a test.
06958 class TestInfo;                        // Information about a test.
06959 class TestPartResult;                  // Result of a test part.
06960 class UnitTest;                        // A collection of test cases.
06961 
06962 template <typename T>
06963 ::std::string PrintToString(const T& value);
06964 
06965 namespace internal {
06966 
06967 struct TraceInfo;                      // Information about a trace point.
06968 class ScopedTrace;                     // Implements scoped trace.
06969 class TestInfoImpl;                    // Opaque implementation of TestInfo
06970 class UnitTestImpl;                    // Opaque implementation of UnitTest
06971 
06972 // How many times InitGoogleTest() has been called.
06973 GTEST_API_ extern int g_init_gtest_count;
06974 
06975 // The text used in failure messages to indicate the start of the
06976 // stack trace.
06977 GTEST_API_ extern const char kStackTraceMarker[];
06978 
06979 // A secret type that Google Test users don't know about.  It has no
06980 // definition on purpose.  Therefore it's impossible to create a
06981 // Secret object, which is what we want.
06982 class Secret;
06983 
06984 // Two overloaded helpers for checking at compile time whether an
06985 // expression is a null pointer literal (i.e. NULL or any 0-valued
06986 // compile-time integral constant).  Their return values have
06987 // different sizes, so we can use sizeof() to test which version is
06988 // picked by the compiler.  These helpers have no implementations, as
06989 // we only need their signatures.
06990 //
06991 // Given IsNullLiteralHelper(x), the compiler will pick the first
06992 // version if x can be implicitly converted to Secret*, and pick the
06993 // second version otherwise.  Since Secret is a secret and incomplete
06994 // type, the only expression a user can write that has type Secret* is
06995 // a null pointer literal.  Therefore, we know that x is a null
06996 // pointer literal if and only if the first version is picked by the
06997 // compiler.
06998 char IsNullLiteralHelper(Secret* p);
06999 char (&IsNullLiteralHelper(...))[2];  // NOLINT
07000 
07001 // A compile-time bool constant that is true if and only if x is a
07002 // null pointer literal (i.e. NULL or any 0-valued compile-time
07003 // integral constant).
07004 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
07005 // We lose support for NULL detection where the compiler doesn't like
07006 // passing non-POD classes through ellipsis (...).
07007 # define GTEST_IS_NULL_LITERAL_(x) false
07008 #else
07009 # define GTEST_IS_NULL_LITERAL_(x) \
07010     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
07011 #endif  // GTEST_ELLIPSIS_NEEDS_POD_
07012 
07013 // Appends the user-supplied message to the Google-Test-generated message.
07014 GTEST_API_ String AppendUserMessage(const String& gtest_msg,
07015                                     const Message& user_msg);
07016 
07017 // A helper class for creating scoped traces in user programs.
07018 class GTEST_API_ ScopedTrace {
07019  public:
07020   // The c'tor pushes the given source file location and message onto
07021   // a trace stack maintained by Google Test.
07022   ScopedTrace(const char* file, int line, const Message& message);
07023 
07024   // The d'tor pops the info pushed by the c'tor.
07025   //
07026   // Note that the d'tor is not virtual in order to be efficient.
07027   // Don't inherit from ScopedTrace!
07028   ~ScopedTrace();
07029 
07030  private:
07031   GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
07032 } GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
07033                             // c'tor and d'tor.  Therefore it doesn't
07034                             // need to be used otherwise.
07035 
07036 // Converts a streamable value to a String.  A NULL pointer is
07037 // converted to "(null)".  When the input value is a ::string,
07038 // ::std::string, ::wstring, or ::std::wstring object, each NUL
07039 // character in it is replaced with "\\0".
07040 // Declared here but defined in gtest.h, so that it has access
07041 // to the definition of the Message class, required by the ARM
07042 // compiler.
07043 template <typename T>
07044 String StreamableToString(const T& streamable);
07045 
07046 // Constructs and returns the message for an equality assertion
07047 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
07048 //
07049 // The first four parameters are the expressions used in the assertion
07050 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
07051 // where foo is 5 and bar is 6, we have:
07052 //
07053 //   expected_expression: "foo"
07054 //   actual_expression:   "bar"
07055 //   expected_value:      "5"
07056 //   actual_value:        "6"
07057 //
07058 // The ignoring_case parameter is true iff the assertion is a
07059 // *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
07060 // be inserted into the message.
07061 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
07062                                      const char* actual_expression,
07063                                      const String& expected_value,
07064                                      const String& actual_value,
07065                                      bool ignoring_case);
07066 
07067 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
07068 GTEST_API_ String GetBoolAssertionFailureMessage(
07069     const AssertionResult& assertion_result,
07070     const char* expression_text,
07071     const char* actual_predicate_value,
07072     const char* expected_predicate_value);
07073 
07074 // This template class represents an IEEE floating-point number
07075 // (either single-precision or double-precision, depending on the
07076 // template parameters).
07077 //
07078 // The purpose of this class is to do more sophisticated number
07079 // comparison.  (Due to round-off error, etc, it's very unlikely that
07080 // two floating-points will be equal exactly.  Hence a naive
07081 // comparison by the == operation often doesn't work.)
07082 //
07083 // Format of IEEE floating-point:
07084 //
07085 //   The most-significant bit being the leftmost, an IEEE
07086 //   floating-point looks like
07087 //
07088 //     sign_bit exponent_bits fraction_bits
07089 //
07090 //   Here, sign_bit is a single bit that designates the sign of the
07091 //   number.
07092 //
07093 //   For float, there are 8 exponent bits and 23 fraction bits.
07094 //
07095 //   For double, there are 11 exponent bits and 52 fraction bits.
07096 //
07097 //   More details can be found at
07098 //   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
07099 //
07100 // Template parameter:
07101 //
07102 //   RawType: the raw floating-point type (either float or double)
07103 template <typename RawType>
07104 class FloatingPoint {
07105  public:
07106   // Defines the unsigned integer type that has the same size as the
07107   // floating point number.
07108   typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
07109 
07110   // Constants.
07111 
07112   // # of bits in a number.
07113   static const size_t kBitCount = 8*sizeof(RawType);
07114 
07115   // # of fraction bits in a number.
07116   static const size_t kFractionBitCount =
07117     std::numeric_limits<RawType>::digits - 1;
07118 
07119   // # of exponent bits in a number.
07120   static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
07121 
07122   // The mask for the sign bit.
07123   static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
07124 
07125   // The mask for the fraction bits.
07126   static const Bits kFractionBitMask =
07127     ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
07128 
07129   // The mask for the exponent bits.
07130   static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
07131 
07132   // How many ULP's (Units in the Last Place) we want to tolerate when
07133   // comparing two numbers.  The larger the value, the more error we
07134   // allow.  A 0 value means that two numbers must be exactly the same
07135   // to be considered equal.
07136   //
07137   // The maximum error of a single floating-point operation is 0.5
07138   // units in the last place.  On Intel CPU's, all floating-point
07139   // calculations are done with 80-bit precision, while double has 64
07140   // bits.  Therefore, 4 should be enough for ordinary use.
07141   //
07142   // See the following article for more details on ULP:
07143   // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
07144   static const size_t kMaxUlps = 4;
07145 
07146   // Constructs a FloatingPoint from a raw floating-point number.
07147   //
07148   // On an Intel CPU, passing a non-normalized NAN (Not a Number)
07149   // around may change its bits, although the new value is guaranteed
07150   // to be also a NAN.  Therefore, don't expect this constructor to
07151   // preserve the bits in x when x is a NAN.
07152   explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
07153 
07154   // Static methods
07155 
07156   // Reinterprets a bit pattern as a floating-point number.
07157   //
07158   // This function is needed to test the AlmostEquals() method.
07159   static RawType ReinterpretBits(const Bits bits) {
07160     FloatingPoint fp(0);
07161     fp.u_.bits_ = bits;
07162     return fp.u_.value_;
07163   }
07164 
07165   // Returns the floating-point number that represent positive infinity.
07166   static RawType Infinity() {
07167     return ReinterpretBits(kExponentBitMask);
07168   }
07169 
07170   // Non-static methods
07171 
07172   // Returns the bits that represents this number.
07173   const Bits &bits() const { return u_.bits_; }
07174 
07175   // Returns the exponent bits of this number.
07176   Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
07177 
07178   // Returns the fraction bits of this number.
07179   Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
07180 
07181   // Returns the sign bit of this number.
07182   Bits sign_bit() const { return kSignBitMask & u_.bits_; }
07183 
07184   // Returns true iff this is NAN (not a number).
07185   bool is_nan() const {
07186     // It's a NAN if the exponent bits are all ones and the fraction
07187     // bits are not entirely zeros.
07188     return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
07189   }
07190 
07191   // Returns true iff this number is at most kMaxUlps ULP's away from
07192   // rhs.  In particular, this function:
07193   //
07194   //   - returns false if either number is (or both are) NAN.
07195   //   - treats really large numbers as almost equal to infinity.
07196   //   - thinks +0.0 and -0.0 are 0 DLP's apart.
07197   bool AlmostEquals(const FloatingPoint& rhs) const {
07198     // The IEEE standard says that any comparison operation involving
07199     // a NAN must return false.
07200     if (is_nan() || rhs.is_nan()) return false;
07201 
07202     return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
07203         <= kMaxUlps;
07204   }
07205 
07206  private:
07207   // The data type used to store the actual floating-point number.
07208   union FloatingPointUnion {
07209     RawType value_;  // The raw floating-point number.
07210     Bits bits_;      // The bits that represent the number.
07211   };
07212 
07213   // Converts an integer from the sign-and-magnitude representation to
07214   // the biased representation.  More precisely, let N be 2 to the
07215   // power of (kBitCount - 1), an integer x is represented by the
07216   // unsigned number x + N.
07217   //
07218   // For instance,
07219   //
07220   //   -N + 1 (the most negative number representable using
07221   //          sign-and-magnitude) is represented by 1;
07222   //   0      is represented by N; and
07223   //   N - 1  (the biggest number representable using
07224   //          sign-and-magnitude) is represented by 2N - 1.
07225   //
07226   // Read http://en.wikipedia.org/wiki/Signed_number_representations
07227   // for more details on signed number representations.
07228   static Bits SignAndMagnitudeToBiased(const Bits &sam) {
07229     if (kSignBitMask & sam) {
07230       // sam represents a negative number.
07231       return ~sam + 1;
07232     } else {
07233       // sam represents a positive number.
07234       return kSignBitMask | sam;
07235     }
07236   }
07237 
07238   // Given two numbers in the sign-and-magnitude representation,
07239   // returns the distance between them as an unsigned number.
07240   static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
07241                                                      const Bits &sam2) {
07242     const Bits biased1 = SignAndMagnitudeToBiased(sam1);
07243     const Bits biased2 = SignAndMagnitudeToBiased(sam2);
07244     return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
07245   }
07246 
07247   FloatingPointUnion u_;
07248 };
07249 
07250 // Typedefs the instances of the FloatingPoint template class that we
07251 // care to use.
07252 typedef FloatingPoint<float> Float;
07253 typedef FloatingPoint<double> Double;
07254 
07255 // In order to catch the mistake of putting tests that use different
07256 // test fixture classes in the same test case, we need to assign
07257 // unique IDs to fixture classes and compare them.  The TypeId type is
07258 // used to hold such IDs.  The user should treat TypeId as an opaque
07259 // type: the only operation allowed on TypeId values is to compare
07260 // them for equality using the == operator.
07261 typedef const void* TypeId;
07262 
07263 template <typename T>
07264 class TypeIdHelper {
07265  public:
07266   // dummy_ must not have a const type.  Otherwise an overly eager
07267   // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
07268   // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
07269   static bool dummy_;
07270 };
07271 
07272 template <typename T>
07273 bool TypeIdHelper<T>::dummy_ = false;
07274 
07275 // GetTypeId<T>() returns the ID of type T.  Different values will be
07276 // returned for different types.  Calling the function twice with the
07277 // same type argument is guaranteed to return the same ID.
07278 template <typename T>
07279 TypeId GetTypeId() {
07280   // The compiler is required to allocate a different
07281   // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
07282   // the template.  Therefore, the address of dummy_ is guaranteed to
07283   // be unique.
07284   return &(TypeIdHelper<T>::dummy_);
07285 }
07286 
07287 // Returns the type ID of ::testing::Test.  Always call this instead
07288 // of GetTypeId< ::testing::Test>() to get the type ID of
07289 // ::testing::Test, as the latter may give the wrong result due to a
07290 // suspected linker bug when compiling Google Test as a Mac OS X
07291 // framework.
07292 GTEST_API_ TypeId GetTestTypeId();
07293 
07294 // Defines the abstract factory interface that creates instances
07295 // of a Test object.
07296 class TestFactoryBase {
07297  public:
07298   virtual ~TestFactoryBase() {}
07299 
07300   // Creates a test instance to run. The instance is both created and destroyed
07301   // within TestInfoImpl::Run()
07302   virtual Test* CreateTest() = 0;
07303 
07304  protected:
07305   TestFactoryBase() {}
07306 
07307  private:
07308   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
07309 };
07310 
07311 // This class provides implementation of TeastFactoryBase interface.
07312 // It is used in TEST and TEST_F macros.
07313 template <class TestClass>
07314 class TestFactoryImpl : public TestFactoryBase {
07315  public:
07316   virtual Test* CreateTest() { return new TestClass; }
07317 };
07318 
07319 #if GTEST_OS_WINDOWS
07320 
07321 // Predicate-formatters for implementing the HRESULT checking macros
07322 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
07323 // We pass a long instead of HRESULT to avoid causing an
07324 // include dependency for the HRESULT type.
07325 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
07326                                             long hr);  // NOLINT
07327 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
07328                                             long hr);  // NOLINT
07329 
07330 #endif  // GTEST_OS_WINDOWS
07331 
07332 // Types of SetUpTestCase() and TearDownTestCase() functions.
07333 typedef void (*SetUpTestCaseFunc)();
07334 typedef void (*TearDownTestCaseFunc)();
07335 
07336 // Creates a new TestInfo object and registers it with Google Test;
07337 // returns the created object.
07338 //
07339 // Arguments:
07340 //
07341 //   test_case_name:   name of the test case
07342 //   name:             name of the test
07343 //   type_param        the name of the test's type parameter, or NULL if
07344 //                     this is not  a typed or a type-parameterized test.
07345 //   value_param       text representation of the test's value parameter,
07346 //                     or NULL if this is not a type-parameterized test.
07347 //   fixture_class_id: ID of the test fixture class
07348 //   set_up_tc:        pointer to the function that sets up the test case
07349 //   tear_down_tc:     pointer to the function that tears down the test case
07350 //   factory:          pointer to the factory that creates a test object.
07351 //                     The newly created TestInfo instance will assume
07352 //                     ownership of the factory object.
07353 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
07354     const char* test_case_name, const char* name,
07355     const char* type_param,
07356     const char* value_param,
07357     TypeId fixture_class_id,
07358     SetUpTestCaseFunc set_up_tc,
07359     TearDownTestCaseFunc tear_down_tc,
07360     TestFactoryBase* factory);
07361 
07362 // If *pstr starts with the given prefix, modifies *pstr to be right
07363 // past the prefix and returns true; otherwise leaves *pstr unchanged
07364 // and returns false.  None of pstr, *pstr, and prefix can be NULL.
07365 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
07366 
07367 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07368 
07369 // State of the definition of a type-parameterized test case.
07370 class GTEST_API_ TypedTestCasePState {
07371  public:
07372   TypedTestCasePState() : registered_(false) {}
07373 
07374   // Adds the given test name to defined_test_names_ and return true
07375   // if the test case hasn't been registered; otherwise aborts the
07376   // program.
07377   bool AddTestName(const char* file, int line, const char* case_name,
07378                    const char* test_name) {
07379     if (registered_) {
07380       fprintf(stderr, "%s Test %s must be defined before "
07381               "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
07382               FormatFileLocation(file, line).c_str(), test_name, case_name);
07383       fflush(stderr);
07384       posix::Abort();
07385     }
07386     defined_test_names_.insert(test_name);
07387     return true;
07388   }
07389 
07390   // Verifies that registered_tests match the test names in
07391   // defined_test_names_; returns registered_tests if successful, or
07392   // aborts the program otherwise.
07393   const char* VerifyRegisteredTestNames(
07394       const char* file, int line, const char* registered_tests);
07395 
07396  private:
07397   bool registered_;
07398   ::std::set<const char*> defined_test_names_;
07399 };
07400 
07401 // Skips to the first non-space char after the first comma in 'str';
07402 // returns NULL if no comma is found in 'str'.
07403 inline const char* SkipComma(const char* str) {
07404   const char* comma = strchr(str, ',');
07405   if (comma == NULL) {
07406     return NULL;
07407   }
07408   while (IsSpace(*(++comma))) {}
07409   return comma;
07410 }
07411 
07412 // Returns the prefix of 'str' before the first comma in it; returns
07413 // the entire string if it contains no comma.
07414 inline String GetPrefixUntilComma(const char* str) {
07415   const char* comma = strchr(str, ',');
07416   return comma == NULL ? String(str) : String(str, comma - str);
07417 }
07418 
07419 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
07420 // registers a list of type-parameterized tests with Google Test.  The
07421 // return value is insignificant - we just need to return something
07422 // such that we can call this function in a namespace scope.
07423 //
07424 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
07425 // template parameter.  It's defined in gtest-type-util.h.
07426 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
07427 class TypeParameterizedTest {
07428  public:
07429   // 'index' is the index of the test in the type list 'Types'
07430   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
07431   // Types).  Valid values for 'index' are [0, N - 1] where N is the
07432   // length of Types.
07433   static bool Register(const char* prefix, const char* case_name,
07434                        const char* test_names, int index) {
07435     typedef typename Types::Head Type;
07436     typedef Fixture<Type> FixtureClass;
07437     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
07438 
07439     // First, registers the first type-parameterized test in the type
07440     // list.
07441     MakeAndRegisterTestInfo(
07442         String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
07443                        case_name, index).c_str(),
07444         GetPrefixUntilComma(test_names).c_str(),
07445         GetTypeName<Type>().c_str(),
07446         NULL,  // No value parameter.
07447         GetTypeId<FixtureClass>(),
07448         TestClass::SetUpTestCase,
07449         TestClass::TearDownTestCase,
07450         new TestFactoryImpl<TestClass>);
07451 
07452     // Next, recurses (at compile time) with the tail of the type list.
07453     return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
07454         ::Register(prefix, case_name, test_names, index + 1);
07455   }
07456 };
07457 
07458 // The base case for the compile time recursion.
07459 template <GTEST_TEMPLATE_ Fixture, class TestSel>
07460 class TypeParameterizedTest<Fixture, TestSel, Types0> {
07461  public:
07462   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
07463                        const char* /*test_names*/, int /*index*/) {
07464     return true;
07465   }
07466 };
07467 
07468 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
07469 // registers *all combinations* of 'Tests' and 'Types' with Google
07470 // Test.  The return value is insignificant - we just need to return
07471 // something such that we can call this function in a namespace scope.
07472 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
07473 class TypeParameterizedTestCase {
07474  public:
07475   static bool Register(const char* prefix, const char* case_name,
07476                        const char* test_names) {
07477     typedef typename Tests::Head Head;
07478 
07479     // First, register the first test in 'Test' for each type in 'Types'.
07480     TypeParameterizedTest<Fixture, Head, Types>::Register(
07481         prefix, case_name, test_names, 0);
07482 
07483     // Next, recurses (at compile time) with the tail of the test list.
07484     return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
07485         ::Register(prefix, case_name, SkipComma(test_names));
07486   }
07487 };
07488 
07489 // The base case for the compile time recursion.
07490 template <GTEST_TEMPLATE_ Fixture, typename Types>
07491 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
07492  public:
07493   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
07494                        const char* /*test_names*/) {
07495     return true;
07496   }
07497 };
07498 
07499 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07500 
07501 // Returns the current OS stack trace as a String.
07502 //
07503 // The maximum number of stack frames to be included is specified by
07504 // the gtest_stack_trace_depth flag.  The skip_count parameter
07505 // specifies the number of top frames to be skipped, which doesn't
07506 // count against the number of frames to be included.
07507 //
07508 // For example, if Foo() calls Bar(), which in turn calls
07509 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
07510 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
07511 GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
07512                                                   int skip_count);
07513 
07514 // Helpers for suppressing warnings on unreachable code or constant
07515 // condition.
07516 
07517 // Always returns true.
07518 GTEST_API_ bool AlwaysTrue();
07519 
07520 // Always returns false.
07521 inline bool AlwaysFalse() { return !AlwaysTrue(); }
07522 
07523 // Helper for suppressing false warning from Clang on a const char*
07524 // variable declared in a conditional expression always being NULL in
07525 // the else branch.
07526 struct GTEST_API_ ConstCharPtr {
07527   ConstCharPtr(const char* str) : value(str) {}
07528   operator bool() const { return true; }
07529   const char* value;
07530 };
07531 
07532 // A simple Linear Congruential Generator for generating random
07533 // numbers with a uniform distribution.  Unlike rand() and srand(), it
07534 // doesn't use global state (and therefore can't interfere with user
07535 // code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
07536 // but it's good enough for our purposes.
07537 class GTEST_API_ Random {
07538  public:
07539   static const UInt32 kMaxRange = 1u << 31;
07540 
07541   explicit Random(UInt32 seed) : state_(seed) {}
07542 
07543   void Reseed(UInt32 seed) { state_ = seed; }
07544 
07545   // Generates a random number from [0, range).  Crashes if 'range' is
07546   // 0 or greater than kMaxRange.
07547   UInt32 Generate(UInt32 range);
07548 
07549  private:
07550   UInt32 state_;
07551   GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
07552 };
07553 
07554 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
07555 // compiler error iff T1 and T2 are different types.
07556 template <typename T1, typename T2>
07557 struct CompileAssertTypesEqual;
07558 
07559 template <typename T>
07560 struct CompileAssertTypesEqual<T, T> {
07561 };
07562 
07563 // Removes the reference from a type if it is a reference type,
07564 // otherwise leaves it unchanged.  This is the same as
07565 // tr1::remove_reference, which is not widely available yet.
07566 template <typename T>
07567 struct RemoveReference { typedef T type; };  // NOLINT
07568 template <typename T>
07569 struct RemoveReference<T&> { typedef T type; };  // NOLINT
07570 
07571 // A handy wrapper around RemoveReference that works when the argument
07572 // T depends on template parameters.
07573 #define GTEST_REMOVE_REFERENCE_(T) \
07574     typename ::testing::internal::RemoveReference<T>::type
07575 
07576 // Removes const from a type if it is a const type, otherwise leaves
07577 // it unchanged.  This is the same as tr1::remove_const, which is not
07578 // widely available yet.
07579 template <typename T>
07580 struct RemoveConst { typedef T type; };  // NOLINT
07581 template <typename T>
07582 struct RemoveConst<const T> { typedef T type; };  // NOLINT
07583 
07584 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
07585 // definition to fail to remove the const in 'const int[3]' and 'const
07586 // char[3][4]'.  The following specialization works around the bug.
07587 template <typename T, size_t N>
07588 struct RemoveConst<const T[N]> {
07589   typedef typename RemoveConst<T>::type type[N];
07590 };
07591 
07592 #if defined(_MSC_VER) && _MSC_VER < 1400
07593 // This is the only specialization that allows VC++ 7.1 to remove const in
07594 // 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
07595 // and thus needs to be conditionally compiled.
07596 template <typename T, size_t N>
07597 struct RemoveConst<T[N]> {
07598   typedef typename RemoveConst<T>::type type[N];
07599 };
07600 #endif
07601 
07602 // A handy wrapper around RemoveConst that works when the argument
07603 // T depends on template parameters.
07604 #define GTEST_REMOVE_CONST_(T) \
07605     typename ::testing::internal::RemoveConst<T>::type
07606 
07607 // Turns const U&, U&, const U, and U all into U.
07608 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
07609     GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
07610 
07611 // Adds reference to a type if it is not a reference type,
07612 // otherwise leaves it unchanged.  This is the same as
07613 // tr1::add_reference, which is not widely available yet.
07614 template <typename T>
07615 struct AddReference { typedef T& type; };  // NOLINT
07616 template <typename T>
07617 struct AddReference<T&> { typedef T& type; };  // NOLINT
07618 
07619 // A handy wrapper around AddReference that works when the argument T
07620 // depends on template parameters.
07621 #define GTEST_ADD_REFERENCE_(T) \
07622     typename ::testing::internal::AddReference<T>::type
07623 
07624 // Adds a reference to const on top of T as necessary.  For example,
07625 // it transforms
07626 //
07627 //   char         ==> const char&
07628 //   const char   ==> const char&
07629 //   char&        ==> const char&
07630 //   const char&  ==> const char&
07631 //
07632 // The argument T must depend on some template parameters.
07633 #define GTEST_REFERENCE_TO_CONST_(T) \
07634     GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
07635 
07636 // ImplicitlyConvertible<From, To>::value is a compile-time bool
07637 // constant that's true iff type From can be implicitly converted to
07638 // type To.
07639 template <typename From, typename To>
07640 class ImplicitlyConvertible {
07641  private:
07642   // We need the following helper functions only for their types.
07643   // They have no implementations.
07644 
07645   // MakeFrom() is an expression whose type is From.  We cannot simply
07646   // use From(), as the type From may not have a public default
07647   // constructor.
07648   static From MakeFrom();
07649 
07650   // These two functions are overloaded.  Given an expression
07651   // Helper(x), the compiler will pick the first version if x can be
07652   // implicitly converted to type To; otherwise it will pick the
07653   // second version.
07654   //
07655   // The first version returns a value of size 1, and the second
07656   // version returns a value of size 2.  Therefore, by checking the
07657   // size of Helper(x), which can be done at compile time, we can tell
07658   // which version of Helper() is used, and hence whether x can be
07659   // implicitly converted to type To.
07660   static char Helper(To);
07661   static char (&Helper(...))[2];  // NOLINT
07662 
07663   // We have to put the 'public' section after the 'private' section,
07664   // or MSVC refuses to compile the code.
07665  public:
07666   // MSVC warns about implicitly converting from double to int for
07667   // possible loss of data, so we need to temporarily disable the
07668   // warning.
07669 #ifdef _MSC_VER
07670 # pragma warning(push)          // Saves the current warning state.
07671 # pragma warning(disable:4244)  // Temporarily disables warning 4244.
07672 
07673   static const bool value =
07674       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
07675 # pragma warning(pop)           // Restores the warning state.
07676 #elif defined(__BORLANDC__)
07677   // C++Builder cannot use member overload resolution during template
07678   // instantiation.  The simplest workaround is to use its C++0x type traits
07679   // functions (C++Builder 2009 and above only).
07680   static const bool value = __is_convertible(From, To);
07681 #else
07682   static const bool value =
07683       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
07684 #endif  // _MSV_VER
07685 };
07686 template <typename From, typename To>
07687 const bool ImplicitlyConvertible<From, To>::value;
07688 
07689 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
07690 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
07691 // of those.
07692 template <typename T>
07693 struct IsAProtocolMessage
07694     : public bool_constant<
07695   ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
07696   ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
07697 };
07698 
07699 // When the compiler sees expression IsContainerTest<C>(0), if C is an
07700 // STL-style container class, the first overload of IsContainerTest
07701 // will be viable (since both C::iterator* and C::const_iterator* are
07702 // valid types and NULL can be implicitly converted to them).  It will
07703 // be picked over the second overload as 'int' is a perfect match for
07704 // the type of argument 0.  If C::iterator or C::const_iterator is not
07705 // a valid type, the first overload is not viable, and the second
07706 // overload will be picked.  Therefore, we can determine whether C is
07707 // a container class by checking the type of IsContainerTest<C>(0).
07708 // The value of the expression is insignificant.
07709 //
07710 // Note that we look for both C::iterator and C::const_iterator.  The
07711 // reason is that C++ injects the name of a class as a member of the
07712 // class itself (e.g. you can refer to class iterator as either
07713 // 'iterator' or 'iterator::iterator').  If we look for C::iterator
07714 // only, for example, we would mistakenly think that a class named
07715 // iterator is an STL container.
07716 //
07717 // Also note that the simpler approach of overloading
07718 // IsContainerTest(typename C::const_iterator*) and
07719 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
07720 typedef int IsContainer;
07721 template <class C>
07722 IsContainer IsContainerTest(int /* dummy */,
07723                             typename C::iterator* /* it */ = NULL,
07724                             typename C::const_iterator* /* const_it */ = NULL) {
07725   return 0;
07726 }
07727 
07728 typedef char IsNotContainer;
07729 template <class C>
07730 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
07731 
07732 // EnableIf<condition>::type is void when 'Cond' is true, and
07733 // undefined when 'Cond' is false.  To use SFINAE to make a function
07734 // overload only apply when a particular expression is true, add
07735 // "typename EnableIf<expression>::type* = 0" as the last parameter.
07736 template<bool> struct EnableIf;
07737 template<> struct EnableIf<true> { typedef void type; };  // NOLINT
07738 
07739 // Utilities for native arrays.
07740 
07741 // ArrayEq() compares two k-dimensional native arrays using the
07742 // elements' operator==, where k can be any integer >= 0.  When k is
07743 // 0, ArrayEq() degenerates into comparing a single pair of values.
07744 
07745 template <typename T, typename U>
07746 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
07747 
07748 // This generic version is used when k is 0.
07749 template <typename T, typename U>
07750 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
07751 
07752 // This overload is used when k >= 1.
07753 template <typename T, typename U, size_t N>
07754 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
07755   return internal::ArrayEq(lhs, N, rhs);
07756 }
07757 
07758 // This helper reduces code bloat.  If we instead put its logic inside
07759 // the previous ArrayEq() function, arrays with different sizes would
07760 // lead to different copies of the template code.
07761 template <typename T, typename U>
07762 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
07763   for (size_t i = 0; i != size; i++) {
07764     if (!internal::ArrayEq(lhs[i], rhs[i]))
07765       return false;
07766   }
07767   return true;
07768 }
07769 
07770 // Finds the first element in the iterator range [begin, end) that
07771 // equals elem.  Element may be a native array type itself.
07772 template <typename Iter, typename Element>
07773 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
07774   for (Iter it = begin; it != end; ++it) {
07775     if (internal::ArrayEq(*it, elem))
07776       return it;
07777   }
07778   return end;
07779 }
07780 
07781 // CopyArray() copies a k-dimensional native array using the elements'
07782 // operator=, where k can be any integer >= 0.  When k is 0,
07783 // CopyArray() degenerates into copying a single value.
07784 
07785 template <typename T, typename U>
07786 void CopyArray(const T* from, size_t size, U* to);
07787 
07788 // This generic version is used when k is 0.
07789 template <typename T, typename U>
07790 inline void CopyArray(const T& from, U* to) { *to = from; }
07791 
07792 // This overload is used when k >= 1.
07793 template <typename T, typename U, size_t N>
07794 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
07795   internal::CopyArray(from, N, *to);
07796 }
07797 
07798 // This helper reduces code bloat.  If we instead put its logic inside
07799 // the previous CopyArray() function, arrays with different sizes
07800 // would lead to different copies of the template code.
07801 template <typename T, typename U>
07802 void CopyArray(const T* from, size_t size, U* to) {
07803   for (size_t i = 0; i != size; i++) {
07804     internal::CopyArray(from[i], to + i);
07805   }
07806 }
07807 
07808 // The relation between an NativeArray object (see below) and the
07809 // native array it represents.
07810 enum RelationToSource {
07811   kReference,  // The NativeArray references the native array.
07812   kCopy        // The NativeArray makes a copy of the native array and
07813                // owns the copy.
07814 };
07815 
07816 // Adapts a native array to a read-only STL-style container.  Instead
07817 // of the complete STL container concept, this adaptor only implements
07818 // members useful for Google Mock's container matchers.  New members
07819 // should be added as needed.  To simplify the implementation, we only
07820 // support Element being a raw type (i.e. having no top-level const or
07821 // reference modifier).  It's the client's responsibility to satisfy
07822 // this requirement.  Element can be an array type itself (hence
07823 // multi-dimensional arrays are supported).
07824 template <typename Element>
07825 class NativeArray {
07826  public:
07827   // STL-style container typedefs.
07828   typedef Element value_type;
07829   typedef Element* iterator;
07830   typedef const Element* const_iterator;
07831 
07832   // Constructs from a native array.
07833   NativeArray(const Element* array, size_t count, RelationToSource relation) {
07834     Init(array, count, relation);
07835   }
07836 
07837   // Copy constructor.
07838   NativeArray(const NativeArray& rhs) {
07839     Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
07840   }
07841 
07842   ~NativeArray() {
07843     // Ensures that the user doesn't instantiate NativeArray with a
07844     // const or reference type.
07845     static_cast<void>(StaticAssertTypeEqHelper<Element,
07846         GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
07847     if (relation_to_source_ == kCopy)
07848       delete[] array_;
07849   }
07850 
07851   // STL-style container methods.
07852   size_t size() const { return size_; }
07853   const_iterator begin() const { return array_; }
07854   const_iterator end() const { return array_ + size_; }
07855   bool operator==(const NativeArray& rhs) const {
07856     return size() == rhs.size() &&
07857         ArrayEq(begin(), size(), rhs.begin());
07858   }
07859 
07860  private:
07861   // Initializes this object; makes a copy of the input array if
07862   // 'relation' is kCopy.
07863   void Init(const Element* array, size_t a_size, RelationToSource relation) {
07864     if (relation == kReference) {
07865       array_ = array;
07866     } else {
07867       Element* const copy = new Element[a_size];
07868       CopyArray(array, a_size, copy);
07869       array_ = copy;
07870     }
07871     size_ = a_size;
07872     relation_to_source_ = relation;
07873   }
07874 
07875   const Element* array_;
07876   size_t size_;
07877   RelationToSource relation_to_source_;
07878 
07879   GTEST_DISALLOW_ASSIGN_(NativeArray);
07880 };
07881 
07882 }  // namespace internal
07883 }  // namespace testing
07884 
07885 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
07886   ::testing::internal::AssertHelper(result_type, file, line, message) \
07887     = ::testing::Message()
07888 
07889 #define GTEST_MESSAGE_(message, result_type) \
07890   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
07891 
07892 #define GTEST_FATAL_FAILURE_(message) \
07893   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
07894 
07895 #define GTEST_NONFATAL_FAILURE_(message) \
07896   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
07897 
07898 #define GTEST_SUCCESS_(message) \
07899   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
07900 
07901 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
07902 // statement if it returns or throws (or doesn't return or throw in some
07903 // situations).
07904 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
07905   if (::testing::internal::AlwaysTrue()) { statement; }
07906 
07907 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
07908   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
07909   if (::testing::internal::ConstCharPtr gtest_msg = "") { \
07910     bool gtest_caught_expected = false; \
07911     try { \
07912       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
07913     } \
07914     catch (expected_exception const&) { \
07915       gtest_caught_expected = true; \
07916     } \
07917     catch (...) { \
07918       gtest_msg.value = \
07919           "Expected: " #statement " throws an exception of type " \
07920           #expected_exception ".\n  Actual: it throws a different type."; \
07921       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
07922     } \
07923     if (!gtest_caught_expected) { \
07924       gtest_msg.value = \
07925           "Expected: " #statement " throws an exception of type " \
07926           #expected_exception ".\n  Actual: it throws nothing."; \
07927       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
07928     } \
07929   } else \
07930     GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
07931       fail(gtest_msg.value)
07932 
07933 #define GTEST_TEST_NO_THROW_(statement, fail) \
07934   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
07935   if (::testing::internal::AlwaysTrue()) { \
07936     try { \
07937       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
07938     } \
07939     catch (...) { \
07940       goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
07941     } \
07942   } else \
07943     GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
07944       fail("Expected: " #statement " doesn't throw an exception.\n" \
07945            "  Actual: it throws.")
07946 
07947 #define GTEST_TEST_ANY_THROW_(statement, fail) \
07948   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
07949   if (::testing::internal::AlwaysTrue()) { \
07950     bool gtest_caught_any = false; \
07951     try { \
07952       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
07953     } \
07954     catch (...) { \
07955       gtest_caught_any = true; \
07956     } \
07957     if (!gtest_caught_any) { \
07958       goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
07959     } \
07960   } else \
07961     GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
07962       fail("Expected: " #statement " throws an exception.\n" \
07963            "  Actual: it doesn't.")
07964 
07965 
07966 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
07967 // either a boolean expression or an AssertionResult. text is a textual
07968 // represenation of expression as it was passed into the EXPECT_TRUE.
07969 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
07970   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
07971   if (const ::testing::AssertionResult gtest_ar_ = \
07972       ::testing::AssertionResult(expression)) \
07973     ; \
07974   else \
07975     fail(::testing::internal::GetBoolAssertionFailureMessage(\
07976         gtest_ar_, text, #actual, #expected).c_str())
07977 
07978 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
07979   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
07980   if (::testing::internal::AlwaysTrue()) { \
07981     ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
07982     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
07983     if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
07984       goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
07985     } \
07986   } else \
07987     GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
07988       fail("Expected: " #statement " doesn't generate new fatal " \
07989            "failures in the current thread.\n" \
07990            "  Actual: it does.")
07991 
07992 // Expands to the name of the class that implements the given test.
07993 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
07994   test_case_name##_##test_name##_Test
07995 
07996 // Helper macro for defining tests.
07997 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
07998 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
07999  public:\
08000   GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
08001  private:\
08002   virtual void TestBody();\
08003   static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
08004   GTEST_DISALLOW_COPY_AND_ASSIGN_(\
08005       GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
08006 };\
08007 \
08008 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
08009   ::test_info_ =\
08010     ::testing::internal::MakeAndRegisterTestInfo(\
08011         #test_case_name, #test_name, NULL, NULL, \
08012         (parent_id), \
08013         parent_class::SetUpTestCase, \
08014         parent_class::TearDownTestCase, \
08015         new ::testing::internal::TestFactoryImpl<\
08016             GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
08017 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
08018 
08019 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
08020 // Copyright 2005, Google Inc.
08021 // All rights reserved.
08022 //
08023 // Redistribution and use in source and binary forms, with or without
08024 // modification, are permitted provided that the following conditions are
08025 // met:
08026 //
08027 //     * Redistributions of source code must retain the above copyright
08028 // notice, this list of conditions and the following disclaimer.
08029 //     * Redistributions in binary form must reproduce the above
08030 // copyright notice, this list of conditions and the following disclaimer
08031 // in the documentation and/or other materials provided with the
08032 // distribution.
08033 //     * Neither the name of Google Inc. nor the names of its
08034 // contributors may be used to endorse or promote products derived from
08035 // this software without specific prior written permission.
08036 //
08037 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08038 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08039 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08040 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08041 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08042 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08043 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08044 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08045 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08046 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08047 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08048 //
08049 // Author: wan@google.com (Zhanyong Wan)
08050 //
08051 // The Google C++ Testing Framework (Google Test)
08052 //
08053 // This header file defines the public API for death tests.  It is
08054 // #included by gtest.h so a user doesn't need to include this
08055 // directly.
08056 
08057 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08058 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08059 
08060 // Copyright 2005, Google Inc.
08061 // All rights reserved.
08062 //
08063 // Redistribution and use in source and binary forms, with or without
08064 // modification, are permitted provided that the following conditions are
08065 // met:
08066 //
08067 //     * Redistributions of source code must retain the above copyright
08068 // notice, this list of conditions and the following disclaimer.
08069 //     * Redistributions in binary form must reproduce the above
08070 // copyright notice, this list of conditions and the following disclaimer
08071 // in the documentation and/or other materials provided with the
08072 // distribution.
08073 //     * Neither the name of Google Inc. nor the names of its
08074 // contributors may be used to endorse or promote products derived from
08075 // this software without specific prior written permission.
08076 //
08077 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08078 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08079 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08080 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08081 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08082 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08083 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08084 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08085 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08086 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08087 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08088 //
08089 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
08090 //
08091 // The Google C++ Testing Framework (Google Test)
08092 //
08093 // This header file defines internal utilities needed for implementing
08094 // death tests.  They are subject to change without notice.
08095 
08096 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08097 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08098 
08099 
08100 #include <stdio.h>
08101 
08102 namespace testing {
08103 namespace internal {
08104 
08105 GTEST_DECLARE_string_(internal_run_death_test);
08106 
08107 // Names of the flags (needed for parsing Google Test flags).
08108 const char kDeathTestStyleFlag[] = "death_test_style";
08109 const char kDeathTestUseFork[] = "death_test_use_fork";
08110 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
08111 
08112 #if GTEST_HAS_DEATH_TEST
08113 
08114 // DeathTest is a class that hides much of the complexity of the
08115 // GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
08116 // returns a concrete class that depends on the prevailing death test
08117 // style, as defined by the --gtest_death_test_style and/or
08118 // --gtest_internal_run_death_test flags.
08119 
08120 // In describing the results of death tests, these terms are used with
08121 // the corresponding definitions:
08122 //
08123 // exit status:  The integer exit information in the format specified
08124 //               by wait(2)
08125 // exit code:    The integer code passed to exit(3), _exit(2), or
08126 //               returned from main()
08127 class GTEST_API_ DeathTest {
08128  public:
08129   // Create returns false if there was an error determining the
08130   // appropriate action to take for the current death test; for example,
08131   // if the gtest_death_test_style flag is set to an invalid value.
08132   // The LastMessage method will return a more detailed message in that
08133   // case.  Otherwise, the DeathTest pointer pointed to by the "test"
08134   // argument is set.  If the death test should be skipped, the pointer
08135   // is set to NULL; otherwise, it is set to the address of a new concrete
08136   // DeathTest object that controls the execution of the current test.
08137   static bool Create(const char* statement, const RE* regex,
08138                      const char* file, int line, DeathTest** test);
08139   DeathTest();
08140   virtual ~DeathTest() { }
08141 
08142   // A helper class that aborts a death test when it's deleted.
08143   class ReturnSentinel {
08144    public:
08145     explicit ReturnSentinel(DeathTest* test) : test_(test) { }
08146     ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
08147    private:
08148     DeathTest* const test_;
08149     GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
08150   } GTEST_ATTRIBUTE_UNUSED_;
08151 
08152   // An enumeration of possible roles that may be taken when a death
08153   // test is encountered.  EXECUTE means that the death test logic should
08154   // be executed immediately.  OVERSEE means that the program should prepare
08155   // the appropriate environment for a child process to execute the death
08156   // test, then wait for it to complete.
08157   enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
08158 
08159   // An enumeration of the three reasons that a test might be aborted.
08160   enum AbortReason {
08161     TEST_ENCOUNTERED_RETURN_STATEMENT,
08162     TEST_THREW_EXCEPTION,
08163     TEST_DID_NOT_DIE
08164   };
08165 
08166   // Assumes one of the above roles.
08167   virtual TestRole AssumeRole() = 0;
08168 
08169   // Waits for the death test to finish and returns its status.
08170   virtual int Wait() = 0;
08171 
08172   // Returns true if the death test passed; that is, the test process
08173   // exited during the test, its exit status matches a user-supplied
08174   // predicate, and its stderr output matches a user-supplied regular
08175   // expression.
08176   // The user-supplied predicate may be a macro expression rather
08177   // than a function pointer or functor, or else Wait and Passed could
08178   // be combined.
08179   virtual bool Passed(bool exit_status_ok) = 0;
08180 
08181   // Signals that the death test did not die as expected.
08182   virtual void Abort(AbortReason reason) = 0;
08183 
08184   // Returns a human-readable outcome message regarding the outcome of
08185   // the last death test.
08186   static const char* LastMessage();
08187 
08188   static void set_last_death_test_message(const String& message);
08189 
08190  private:
08191   // A string containing a description of the outcome of the last death test.
08192   static String last_death_test_message_;
08193 
08194   GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
08195 };
08196 
08197 // Factory interface for death tests.  May be mocked out for testing.
08198 class DeathTestFactory {
08199  public:
08200   virtual ~DeathTestFactory() { }
08201   virtual bool Create(const char* statement, const RE* regex,
08202                       const char* file, int line, DeathTest** test) = 0;
08203 };
08204 
08205 // A concrete DeathTestFactory implementation for normal use.
08206 class DefaultDeathTestFactory : public DeathTestFactory {
08207  public:
08208   virtual bool Create(const char* statement, const RE* regex,
08209                       const char* file, int line, DeathTest** test);
08210 };
08211 
08212 // Returns true if exit_status describes a process that was terminated
08213 // by a signal, or exited normally with a nonzero exit code.
08214 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
08215 
08216 // Traps C++ exceptions escaping statement and reports them as test
08217 // failures. Note that trapping SEH exceptions is not implemented here.
08218 # if GTEST_HAS_EXCEPTIONS
08219 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
08220   try { \
08221     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08222   } catch (const ::std::exception& gtest_exception) { \
08223     fprintf(\
08224         stderr, \
08225         "\n%s: Caught std::exception-derived exception escaping the " \
08226         "death test statement. Exception message: %s\n", \
08227         ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
08228         gtest_exception.what()); \
08229     fflush(stderr); \
08230     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
08231   } catch (...) { \
08232     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
08233   }
08234 
08235 # else
08236 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
08237   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
08238 
08239 # endif
08240 
08241 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
08242 // ASSERT_EXIT*, and EXPECT_EXIT*.
08243 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
08244   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08245   if (::testing::internal::AlwaysTrue()) { \
08246     const ::testing::internal::RE& gtest_regex = (regex); \
08247     ::testing::internal::DeathTest* gtest_dt; \
08248     if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
08249         __FILE__, __LINE__, &gtest_dt)) { \
08250       goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
08251     } \
08252     if (gtest_dt != NULL) { \
08253       ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
08254           gtest_dt_ptr(gtest_dt); \
08255       switch (gtest_dt->AssumeRole()) { \
08256         case ::testing::internal::DeathTest::OVERSEE_TEST: \
08257           if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
08258             goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
08259           } \
08260           break; \
08261         case ::testing::internal::DeathTest::EXECUTE_TEST: { \
08262           ::testing::internal::DeathTest::ReturnSentinel \
08263               gtest_sentinel(gtest_dt); \
08264           GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
08265           gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
08266           break; \
08267         } \
08268         default: \
08269           break; \
08270       } \
08271     } \
08272   } else \
08273     GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
08274       fail(::testing::internal::DeathTest::LastMessage())
08275 // The symbol "fail" here expands to something into which a message
08276 // can be streamed.
08277 
08278 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
08279 // NDEBUG mode. In this case we need the statements to be executed, the regex is
08280 // ignored, and the macro must accept a streamed message even though the message
08281 // is never printed.
08282 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
08283   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08284   if (::testing::internal::AlwaysTrue()) { \
08285      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08286   } else \
08287     ::testing::Message()
08288 
08289 // A class representing the parsed contents of the
08290 // --gtest_internal_run_death_test flag, as it existed when
08291 // RUN_ALL_TESTS was called.
08292 class InternalRunDeathTestFlag {
08293  public:
08294   InternalRunDeathTestFlag(const String& a_file,
08295                            int a_line,
08296                            int an_index,
08297                            int a_write_fd)
08298       : file_(a_file), line_(a_line), index_(an_index),
08299         write_fd_(a_write_fd) {}
08300 
08301   ~InternalRunDeathTestFlag() {
08302     if (write_fd_ >= 0)
08303       posix::Close(write_fd_);
08304   }
08305 
08306   String file() const { return file_; }
08307   int line() const { return line_; }
08308   int index() const { return index_; }
08309   int write_fd() const { return write_fd_; }
08310 
08311  private:
08312   String file_;
08313   int line_;
08314   int index_;
08315   int write_fd_;
08316 
08317   GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
08318 };
08319 
08320 // Returns a newly created InternalRunDeathTestFlag object with fields
08321 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
08322 // the flag is specified; otherwise returns NULL.
08323 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
08324 
08325 #else  // GTEST_HAS_DEATH_TEST
08326 
08327 // This macro is used for implementing macros such as
08328 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
08329 // death tests are not supported. Those macros must compile on such systems
08330 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
08331 // systems that support death tests. This allows one to write such a macro
08332 // on a system that does not support death tests and be sure that it will
08333 // compile on a death-test supporting system.
08334 //
08335 // Parameters:
08336 //   statement -  A statement that a macro such as EXPECT_DEATH would test
08337 //                for program termination. This macro has to make sure this
08338 //                statement is compiled but not executed, to ensure that
08339 //                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
08340 //                parameter iff EXPECT_DEATH compiles with it.
08341 //   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
08342 //                the output of statement.  This parameter has to be
08343 //                compiled but not evaluated by this macro, to ensure that
08344 //                this macro only accepts expressions that a macro such as
08345 //                EXPECT_DEATH would accept.
08346 //   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
08347 //                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
08348 //                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
08349 //                compile inside functions where ASSERT_DEATH doesn't
08350 //                compile.
08351 //
08352 //  The branch that has an always false condition is used to ensure that
08353 //  statement and regex are compiled (and thus syntactically correct) but
08354 //  never executed. The unreachable code macro protects the terminator
08355 //  statement from generating an 'unreachable code' warning in case
08356 //  statement unconditionally returns or throws. The Message constructor at
08357 //  the end allows the syntax of streaming additional messages into the
08358 //  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
08359 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
08360     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08361     if (::testing::internal::AlwaysTrue()) { \
08362       GTEST_LOG_(WARNING) \
08363           << "Death tests are not supported on this platform.\n" \
08364           << "Statement '" #statement "' cannot be verified."; \
08365     } else if (::testing::internal::AlwaysFalse()) { \
08366       ::testing::internal::RE::PartialMatch(".*", (regex)); \
08367       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08368       terminator; \
08369     } else \
08370       ::testing::Message()
08371 
08372 #endif  // GTEST_HAS_DEATH_TEST
08373 
08374 }  // namespace internal
08375 }  // namespace testing
08376 
08377 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08378 
08379 namespace testing {
08380 
08381 // This flag controls the style of death tests.  Valid values are "threadsafe",
08382 // meaning that the death test child process will re-execute the test binary
08383 // from the start, running only a single death test, or "fast",
08384 // meaning that the child process will execute the test logic immediately
08385 // after forking.
08386 GTEST_DECLARE_string_(death_test_style);
08387 
08388 #if GTEST_HAS_DEATH_TEST
08389 
08390 namespace internal {
08391 
08392 // Returns a Boolean value indicating whether the caller is currently
08393 // executing in the context of the death test child process.  Tools such as
08394 // Valgrind heap checkers may need this to modify their behavior in death
08395 // tests.  IMPORTANT: This is an internal utility.  Using it may break the
08396 // implementation of death tests.  User code MUST NOT use it.
08397 GTEST_API_ bool InDeathTestChild();
08398 
08399 }  // namespace internal
08400 
08401 // The following macros are useful for writing death tests.
08402 
08403 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
08404 // executed:
08405 //
08406 //   1. It generates a warning if there is more than one active
08407 //   thread.  This is because it's safe to fork() or clone() only
08408 //   when there is a single thread.
08409 //
08410 //   2. The parent process clone()s a sub-process and runs the death
08411 //   test in it; the sub-process exits with code 0 at the end of the
08412 //   death test, if it hasn't exited already.
08413 //
08414 //   3. The parent process waits for the sub-process to terminate.
08415 //
08416 //   4. The parent process checks the exit code and error message of
08417 //   the sub-process.
08418 //
08419 // Examples:
08420 //
08421 //   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
08422 //   for (int i = 0; i < 5; i++) {
08423 //     EXPECT_DEATH(server.ProcessRequest(i),
08424 //                  "Invalid request .* in ProcessRequest()")
08425 //                  << "Failed to die on request " << i;
08426 //   }
08427 //
08428 //   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
08429 //
08430 //   bool KilledBySIGHUP(int exit_code) {
08431 //     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
08432 //   }
08433 //
08434 //   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
08435 //
08436 // On the regular expressions used in death tests:
08437 //
08438 //   On POSIX-compliant systems (*nix), we use the <regex.h> library,
08439 //   which uses the POSIX extended regex syntax.
08440 //
08441 //   On other platforms (e.g. Windows), we only support a simple regex
08442 //   syntax implemented as part of Google Test.  This limited
08443 //   implementation should be enough most of the time when writing
08444 //   death tests; though it lacks many features you can find in PCRE
08445 //   or POSIX extended regex syntax.  For example, we don't support
08446 //   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
08447 //   repetition count ("x{5,7}"), among others.
08448 //
08449 //   Below is the syntax that we do support.  We chose it to be a
08450 //   subset of both PCRE and POSIX extended regex, so it's easy to
08451 //   learn wherever you come from.  In the following: 'A' denotes a
08452 //   literal character, period (.), or a single \\ escape sequence;
08453 //   'x' and 'y' denote regular expressions; 'm' and 'n' are for
08454 //   natural numbers.
08455 //
08456 //     c     matches any literal character c
08457 //     \\d   matches any decimal digit
08458 //     \\D   matches any character that's not a decimal digit
08459 //     \\f   matches \f
08460 //     \\n   matches \n
08461 //     \\r   matches \r
08462 //     \\s   matches any ASCII whitespace, including \n
08463 //     \\S   matches any character that's not a whitespace
08464 //     \\t   matches \t
08465 //     \\v   matches \v
08466 //     \\w   matches any letter, _, or decimal digit
08467 //     \\W   matches any character that \\w doesn't match
08468 //     \\c   matches any literal character c, which must be a punctuation
08469 //     .     matches any single character except \n
08470 //     A?    matches 0 or 1 occurrences of A
08471 //     A*    matches 0 or many occurrences of A
08472 //     A+    matches 1 or many occurrences of A
08473 //     ^     matches the beginning of a string (not that of each line)
08474 //     $     matches the end of a string (not that of each line)
08475 //     xy    matches x followed by y
08476 //
08477 //   If you accidentally use PCRE or POSIX extended regex features
08478 //   not implemented by us, you will get a run-time failure.  In that
08479 //   case, please try to rewrite your regular expression within the
08480 //   above syntax.
08481 //
08482 //   This implementation is *not* meant to be as highly tuned or robust
08483 //   as a compiled regex library, but should perform well enough for a
08484 //   death test, which already incurs significant overhead by launching
08485 //   a child process.
08486 //
08487 // Known caveats:
08488 //
08489 //   A "threadsafe" style death test obtains the path to the test
08490 //   program from argv[0] and re-executes it in the sub-process.  For
08491 //   simplicity, the current implementation doesn't search the PATH
08492 //   when launching the sub-process.  This means that the user must
08493 //   invoke the test program via a path that contains at least one
08494 //   path separator (e.g. path/to/foo_test and
08495 //   /absolute/path/to/bar_test are fine, but foo_test is not).  This
08496 //   is rarely a problem as people usually don't put the test binary
08497 //   directory in PATH.
08498 //
08499 // TODO(wan@google.com): make thread-safe death tests search the PATH.
08500 
08501 // Asserts that a given statement causes the program to exit, with an
08502 // integer exit status that satisfies predicate, and emitting error output
08503 // that matches regex.
08504 # define ASSERT_EXIT(statement, predicate, regex) \
08505     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
08506 
08507 // Like ASSERT_EXIT, but continues on to successive tests in the
08508 // test case, if any:
08509 # define EXPECT_EXIT(statement, predicate, regex) \
08510     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
08511 
08512 // Asserts that a given statement causes the program to exit, either by
08513 // explicitly exiting with a nonzero exit code or being killed by a
08514 // signal, and emitting error output that matches regex.
08515 # define ASSERT_DEATH(statement, regex) \
08516     ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
08517 
08518 // Like ASSERT_DEATH, but continues on to successive tests in the
08519 // test case, if any:
08520 # define EXPECT_DEATH(statement, regex) \
08521     EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
08522 
08523 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
08524 
08525 // Tests that an exit code describes a normal exit with a given exit code.
08526 class GTEST_API_ ExitedWithCode {
08527  public:
08528   explicit ExitedWithCode(int exit_code);
08529   bool operator()(int exit_status) const;
08530  private:
08531   // No implementation - assignment is unsupported.
08532   void operator=(const ExitedWithCode& other);
08533 
08534   const int exit_code_;
08535 };
08536 
08537 # if !GTEST_OS_WINDOWS
08538 // Tests that an exit code describes an exit due to termination by a
08539 // given signal.
08540 class GTEST_API_ KilledBySignal {
08541  public:
08542   explicit KilledBySignal(int signum);
08543   bool operator()(int exit_status) const;
08544  private:
08545   const int signum_;
08546 };
08547 # endif  // !GTEST_OS_WINDOWS
08548 
08549 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
08550 // The death testing framework causes this to have interesting semantics,
08551 // since the sideeffects of the call are only visible in opt mode, and not
08552 // in debug mode.
08553 //
08554 // In practice, this can be used to test functions that utilize the
08555 // LOG(DFATAL) macro using the following style:
08556 //
08557 // int DieInDebugOr12(int* sideeffect) {
08558 //   if (sideeffect) {
08559 //     *sideeffect = 12;
08560 //   }
08561 //   LOG(DFATAL) << "death";
08562 //   return 12;
08563 // }
08564 //
08565 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
08566 //   int sideeffect = 0;
08567 //   // Only asserts in dbg.
08568 //   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
08569 //
08570 // #ifdef NDEBUG
08571 //   // opt-mode has sideeffect visible.
08572 //   EXPECT_EQ(12, sideeffect);
08573 // #else
08574 //   // dbg-mode no visible sideeffect.
08575 //   EXPECT_EQ(0, sideeffect);
08576 // #endif
08577 // }
08578 //
08579 // This will assert that DieInDebugReturn12InOpt() crashes in debug
08580 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
08581 // appropriate fallback value (12 in this case) in opt mode. If you
08582 // need to test that a function has appropriate side-effects in opt
08583 // mode, include assertions against the side-effects.  A general
08584 // pattern for this is:
08585 //
08586 // EXPECT_DEBUG_DEATH({
08587 //   // Side-effects here will have an effect after this statement in
08588 //   // opt mode, but none in debug mode.
08589 //   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
08590 // }, "death");
08591 //
08592 # ifdef NDEBUG
08593 
08594 #  define EXPECT_DEBUG_DEATH(statement, regex) \
08595   GTEST_EXECUTE_STATEMENT_(statement, regex)
08596 
08597 #  define ASSERT_DEBUG_DEATH(statement, regex) \
08598   GTEST_EXECUTE_STATEMENT_(statement, regex)
08599 
08600 # else
08601 
08602 #  define EXPECT_DEBUG_DEATH(statement, regex) \
08603   EXPECT_DEATH(statement, regex)
08604 
08605 #  define ASSERT_DEBUG_DEATH(statement, regex) \
08606   ASSERT_DEATH(statement, regex)
08607 
08608 # endif  // NDEBUG for EXPECT_DEBUG_DEATH
08609 #endif  // GTEST_HAS_DEATH_TEST
08610 
08611 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
08612 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
08613 // death tests are supported; otherwise they just issue a warning.  This is
08614 // useful when you are combining death test assertions with normal test
08615 // assertions in one test.
08616 #if GTEST_HAS_DEATH_TEST
08617 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
08618     EXPECT_DEATH(statement, regex)
08619 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
08620     ASSERT_DEATH(statement, regex)
08621 #else
08622 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
08623     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
08624 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
08625     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
08626 #endif
08627 
08628 }  // namespace testing
08629 
08630 #endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08631 // Copyright 2005, Google Inc.
08632 // All rights reserved.
08633 //
08634 // Redistribution and use in source and binary forms, with or without
08635 // modification, are permitted provided that the following conditions are
08636 // met:
08637 //
08638 //     * Redistributions of source code must retain the above copyright
08639 // notice, this list of conditions and the following disclaimer.
08640 //     * Redistributions in binary form must reproduce the above
08641 // copyright notice, this list of conditions and the following disclaimer
08642 // in the documentation and/or other materials provided with the
08643 // distribution.
08644 //     * Neither the name of Google Inc. nor the names of its
08645 // contributors may be used to endorse or promote products derived from
08646 // this software without specific prior written permission.
08647 //
08648 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08649 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08650 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08651 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08652 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08653 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08654 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08655 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08656 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08657 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08658 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08659 //
08660 // Author: wan@google.com (Zhanyong Wan)
08661 //
08662 // The Google C++ Testing Framework (Google Test)
08663 //
08664 // This header file defines the Message class.
08665 //
08666 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
08667 // leave some internal implementation details in this header file.
08668 // They are clearly marked by comments like this:
08669 //
08670 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
08671 //
08672 // Such code is NOT meant to be used by a user directly, and is subject
08673 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
08674 // program!
08675 
08676 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
08677 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
08678 
08679 #include <limits>
08680 
08681 
08682 namespace testing {
08683 
08684 // The Message class works like an ostream repeater.
08685 //
08686 // Typical usage:
08687 //
08688 //   1. You stream a bunch of values to a Message object.
08689 //      It will remember the text in a stringstream.
08690 //   2. Then you stream the Message object to an ostream.
08691 //      This causes the text in the Message to be streamed
08692 //      to the ostream.
08693 //
08694 // For example;
08695 //
08696 //   testing::Message foo;
08697 //   foo << 1 << " != " << 2;
08698 //   std::cout << foo;
08699 //
08700 // will print "1 != 2".
08701 //
08702 // Message is not intended to be inherited from.  In particular, its
08703 // destructor is not virtual.
08704 //
08705 // Note that stringstream behaves differently in gcc and in MSVC.  You
08706 // can stream a NULL char pointer to it in the former, but not in the
08707 // latter (it causes an access violation if you do).  The Message
08708 // class hides this difference by treating a NULL char pointer as
08709 // "(null)".
08710 class GTEST_API_ Message {
08711  private:
08712   // The type of basic IO manipulators (endl, ends, and flush) for
08713   // narrow streams.
08714   typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
08715 
08716  public:
08717   // Constructs an empty Message.
08718   // We allocate the stringstream separately because otherwise each use of
08719   // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
08720   // stack frame leading to huge stack frames in some cases; gcc does not reuse
08721   // the stack space.
08722   Message() : ss_(new ::std::stringstream) {
08723     // By default, we want there to be enough precision when printing
08724     // a double to a Message.
08725     *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
08726   }
08727 
08728   // Copy constructor.
08729   Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
08730     *ss_ << msg.GetString();
08731   }
08732 
08733   // Constructs a Message from a C-string.
08734   explicit Message(const char* str) : ss_(new ::std::stringstream) {
08735     *ss_ << str;
08736   }
08737 
08738 #if GTEST_OS_SYMBIAN
08739   // Streams a value (either a pointer or not) to this object.
08740   template <typename T>
08741   inline Message& operator <<(const T& value) {
08742     StreamHelper(typename internal::is_pointer<T>::type(), value);
08743     return *this;
08744   }
08745 #else
08746   // Streams a non-pointer value to this object.
08747   template <typename T>
08748   inline Message& operator <<(const T& val) {
08749     ::GTestStreamToHelper(ss_.get(), val);
08750     return *this;
08751   }
08752 
08753   // Streams a pointer value to this object.
08754   //
08755   // This function is an overload of the previous one.  When you
08756   // stream a pointer to a Message, this definition will be used as it
08757   // is more specialized.  (The C++ Standard, section
08758   // [temp.func.order].)  If you stream a non-pointer, then the
08759   // previous definition will be used.
08760   //
08761   // The reason for this overload is that streaming a NULL pointer to
08762   // ostream is undefined behavior.  Depending on the compiler, you
08763   // may get "0", "(nil)", "(null)", or an access violation.  To
08764   // ensure consistent result across compilers, we always treat NULL
08765   // as "(null)".
08766   template <typename T>
08767   inline Message& operator <<(T* const& pointer) {  // NOLINT
08768     if (pointer == NULL) {
08769       *ss_ << "(null)";
08770     } else {
08771       ::GTestStreamToHelper(ss_.get(), pointer);
08772     }
08773     return *this;
08774   }
08775 #endif  // GTEST_OS_SYMBIAN
08776 
08777   // Since the basic IO manipulators are overloaded for both narrow
08778   // and wide streams, we have to provide this specialized definition
08779   // of operator <<, even though its body is the same as the
08780   // templatized version above.  Without this definition, streaming
08781   // endl or other basic IO manipulators to Message will confuse the
08782   // compiler.
08783   Message& operator <<(BasicNarrowIoManip val) {
08784     *ss_ << val;
08785     return *this;
08786   }
08787 
08788   // Instead of 1/0, we want to see true/false for bool values.
08789   Message& operator <<(bool b) {
08790     return *this << (b ? "true" : "false");
08791   }
08792 
08793   // These two overloads allow streaming a wide C string to a Message
08794   // using the UTF-8 encoding.
08795   Message& operator <<(const wchar_t* wide_c_str) {
08796     return *this << internal::String::ShowWideCString(wide_c_str);
08797   }
08798   Message& operator <<(wchar_t* wide_c_str) {
08799     return *this << internal::String::ShowWideCString(wide_c_str);
08800   }
08801 
08802 #if GTEST_HAS_STD_WSTRING
08803   // Converts the given wide string to a narrow string using the UTF-8
08804   // encoding, and streams the result to this Message object.
08805   Message& operator <<(const ::std::wstring& wstr);
08806 #endif  // GTEST_HAS_STD_WSTRING
08807 
08808 #if GTEST_HAS_GLOBAL_WSTRING
08809   // Converts the given wide string to a narrow string using the UTF-8
08810   // encoding, and streams the result to this Message object.
08811   Message& operator <<(const ::wstring& wstr);
08812 #endif  // GTEST_HAS_GLOBAL_WSTRING
08813 
08814   // Gets the text streamed to this object so far as a String.
08815   // Each '\0' character in the buffer is replaced with "\\0".
08816   //
08817   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
08818   internal::String GetString() const {
08819     return internal::StringStreamToString(ss_.get());
08820   }
08821 
08822  private:
08823 
08824 #if GTEST_OS_SYMBIAN
08825   // These are needed as the Nokia Symbian Compiler cannot decide between
08826   // const T& and const T* in a function template. The Nokia compiler _can_
08827   // decide between class template specializations for T and T*, so a
08828   // tr1::type_traits-like is_pointer works, and we can overload on that.
08829   template <typename T>
08830   inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
08831     if (pointer == NULL) {
08832       *ss_ << "(null)";
08833     } else {
08834       ::GTestStreamToHelper(ss_.get(), pointer);
08835     }
08836   }
08837   template <typename T>
08838   inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
08839     ::GTestStreamToHelper(ss_.get(), value);
08840   }
08841 #endif  // GTEST_OS_SYMBIAN
08842 
08843   // We'll hold the text streamed to this object here.
08844   const internal::scoped_ptr< ::std::stringstream> ss_;
08845 
08846   // We declare (but don't implement) this to prevent the compiler
08847   // from implementing the assignment operator.
08848   void operator=(const Message&);
08849 };
08850 
08851 // Streams a Message to an ostream.
08852 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
08853   return os << sb.GetString();
08854 }
08855 
08856 }  // namespace testing
08857 
08858 #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
08859 // This file was GENERATED by command:
08860 //     pump.py gtest-param-test.h.pump
08861 // DO NOT EDIT BY HAND!!!
08862 
08863 // Copyright 2008, Google Inc.
08864 // All rights reserved.
08865 //
08866 // Redistribution and use in source and binary forms, with or without
08867 // modification, are permitted provided that the following conditions are
08868 // met:
08869 //
08870 //     * Redistributions of source code must retain the above copyright
08871 // notice, this list of conditions and the following disclaimer.
08872 //     * Redistributions in binary form must reproduce the above
08873 // copyright notice, this list of conditions and the following disclaimer
08874 // in the documentation and/or other materials provided with the
08875 // distribution.
08876 //     * Neither the name of Google Inc. nor the names of its
08877 // contributors may be used to endorse or promote products derived from
08878 // this software without specific prior written permission.
08879 //
08880 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08881 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08882 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08883 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08884 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08885 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08886 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08887 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08888 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08889 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08890 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08891 //
08892 // Authors: vladl@google.com (Vlad Losev)
08893 //
08894 // Macros and functions for implementing parameterized tests
08895 // in Google C++ Testing Framework (Google Test)
08896 //
08897 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
08898 //
08899 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
08900 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
08901 
08902 
08903 // Value-parameterized tests allow you to test your code with different
08904 // parameters without writing multiple copies of the same test.
08905 //
08906 // Here is how you use value-parameterized tests:
08907 
08908 #if 0
08909 
08910 // To write value-parameterized tests, first you should define a fixture
08911 // class. It is usually derived from testing::TestWithParam<T> (see below for
08912 // another inheritance scheme that's sometimes useful in more complicated
08913 // class hierarchies), where the type of your parameter values.
08914 // TestWithParam<T> is itself derived from testing::Test. T can be any
08915 // copyable type. If it's a raw pointer, you are responsible for managing the
08916 // lifespan of the pointed values.
08917 
08918 class FooTest : public ::testing::TestWithParam<const char*> {
08919   // You can implement all the usual class fixture members here.
08920 };
08921 
08922 // Then, use the TEST_P macro to define as many parameterized tests
08923 // for this fixture as you want. The _P suffix is for "parameterized"
08924 // or "pattern", whichever you prefer to think.
08925 
08926 TEST_P(FooTest, DoesBlah) {
08927   // Inside a test, access the test parameter with the GetParam() method
08928   // of the TestWithParam<T> class:
08929   EXPECT_TRUE(foo.Blah(GetParam()));
08930   ...
08931 }
08932 
08933 TEST_P(FooTest, HasBlahBlah) {
08934   ...
08935 }
08936 
08937 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
08938 // case with any set of parameters you want. Google Test defines a number
08939 // of functions for generating test parameters. They return what we call
08940 // (surprise!) parameter generators. Here is a  summary of them, which
08941 // are all in the testing namespace:
08942 //
08943 //
08944 //  Range(begin, end [, step]) - Yields values {begin, begin+step,
08945 //                               begin+step+step, ...}. The values do not
08946 //                               include end. step defaults to 1.
08947 //  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
08948 //  ValuesIn(container)        - Yields values from a C-style array, an STL
08949 //  ValuesIn(begin,end)          container, or an iterator range [begin, end).
08950 //  Bool()                     - Yields sequence {false, true}.
08951 //  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
08952 //                               for the math savvy) of the values generated
08953 //                               by the N generators.
08954 //
08955 // For more details, see comments at the definitions of these functions below
08956 // in this file.
08957 //
08958 // The following statement will instantiate tests from the FooTest test case
08959 // each with parameter values "meeny", "miny", and "moe".
08960 
08961 INSTANTIATE_TEST_CASE_P(InstantiationName,
08962                         FooTest,
08963                         Values("meeny", "miny", "moe"));
08964 
08965 // To distinguish different instances of the pattern, (yes, you
08966 // can instantiate it more then once) the first argument to the
08967 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
08968 // actual test case name. Remember to pick unique prefixes for different
08969 // instantiations. The tests from the instantiation above will have
08970 // these names:
08971 //
08972 //    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
08973 //    * InstantiationName/FooTest.DoesBlah/1 for "miny"
08974 //    * InstantiationName/FooTest.DoesBlah/2 for "moe"
08975 //    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
08976 //    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
08977 //    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
08978 //
08979 // You can use these names in --gtest_filter.
08980 //
08981 // This statement will instantiate all tests from FooTest again, each
08982 // with parameter values "cat" and "dog":
08983 
08984 const char* pets[] = {"cat", "dog"};
08985 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
08986 
08987 // The tests from the instantiation above will have these names:
08988 //
08989 //    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
08990 //    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
08991 //    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
08992 //    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
08993 //
08994 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
08995 // in the given test case, whether their definitions come before or
08996 // AFTER the INSTANTIATE_TEST_CASE_P statement.
08997 //
08998 // Please also note that generator expressions (including parameters to the
08999 // generators) are evaluated in InitGoogleTest(), after main() has started.
09000 // This allows the user on one hand, to adjust generator parameters in order
09001 // to dynamically determine a set of tests to run and on the other hand,
09002 // give the user a chance to inspect the generated tests with Google Test
09003 // reflection API before RUN_ALL_TESTS() is executed.
09004 //
09005 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
09006 // for more examples.
09007 //
09008 // In the future, we plan to publish the API for defining new parameter
09009 // generators. But for now this interface remains part of the internal
09010 // implementation and is subject to change.
09011 //
09012 //
09013 // A parameterized test fixture must be derived from testing::Test and from
09014 // testing::WithParamInterface<T>, where T is the type of the parameter
09015 // values. Inheriting from TestWithParam<T> satisfies that requirement because
09016 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
09017 // complicated hierarchies, however, it is occasionally useful to inherit
09018 // separately from Test and WithParamInterface. For example:
09019 
09020 class BaseTest : public ::testing::Test {
09021   // You can inherit all the usual members for a non-parameterized test
09022   // fixture here.
09023 };
09024 
09025 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
09026   // The usual test fixture members go here too.
09027 };
09028 
09029 TEST_F(BaseTest, HasFoo) {
09030   // This is an ordinary non-parameterized test.
09031 }
09032 
09033 TEST_P(DerivedTest, DoesBlah) {
09034   // GetParam works just the same here as if you inherit from TestWithParam.
09035   EXPECT_TRUE(foo.Blah(GetParam()));
09036 }
09037 
09038 #endif  // 0
09039 
09040 
09041 #if !GTEST_OS_SYMBIAN
09042 # include <utility>
09043 #endif
09044 
09045 // scripts/fuse_gtest.py depends on gtest's own header being #included
09046 // *unconditionally*.  Therefore these #includes cannot be moved
09047 // inside #if GTEST_HAS_PARAM_TEST.
09048 // Copyright 2008 Google Inc.
09049 // All Rights Reserved.
09050 //
09051 // Redistribution and use in source and binary forms, with or without
09052 // modification, are permitted provided that the following conditions are
09053 // met:
09054 //
09055 //     * Redistributions of source code must retain the above copyright
09056 // notice, this list of conditions and the following disclaimer.
09057 //     * Redistributions in binary form must reproduce the above
09058 // copyright notice, this list of conditions and the following disclaimer
09059 // in the documentation and/or other materials provided with the
09060 // distribution.
09061 //     * Neither the name of Google Inc. nor the names of its
09062 // contributors may be used to endorse or promote products derived from
09063 // this software without specific prior written permission.
09064 //
09065 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
09066 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
09067 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
09068 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
09069 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
09070 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
09071 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
09072 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
09073 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
09074 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
09075 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
09076 //
09077 // Author: vladl@google.com (Vlad Losev)
09078 
09079 // Type and function utilities for implementing parameterized tests.
09080 
09081 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
09082 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
09083 
09084 #include <iterator>
09085 #include <utility>
09086 #include <vector>
09087 
09088 // scripts/fuse_gtest.py depends on gtest's own header being #included
09089 // *unconditionally*.  Therefore these #includes cannot be moved
09090 // inside #if GTEST_HAS_PARAM_TEST.
09091 // Copyright 2003 Google Inc.
09092 // All rights reserved.
09093 //
09094 // Redistribution and use in source and binary forms, with or without
09095 // modification, are permitted provided that the following conditions are
09096 // met:
09097 //
09098 //     * Redistributions of source code must retain the above copyright
09099 // notice, this list of conditions and the following disclaimer.
09100 //     * Redistributions in binary form must reproduce the above
09101 // copyright notice, this list of conditions and the following disclaimer
09102 // in the documentation and/or other materials provided with the
09103 // distribution.
09104 //     * Neither the name of Google Inc. nor the names of its
09105 // contributors may be used to endorse or promote products derived from
09106 // this software without specific prior written permission.
09107 //
09108 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
09109 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
09110 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
09111 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
09112 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
09113 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
09114 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
09115 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
09116 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
09117 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
09118 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
09119 //
09120 // Authors: Dan Egnor (egnor@google.com)
09121 //
09122 // A "smart" pointer type with reference tracking.  Every pointer to a
09123 // particular object is kept on a circular linked list.  When the last pointer
09124 // to an object is destroyed or reassigned, the object is deleted.
09125 //
09126 // Used properly, this deletes the object when the last reference goes away.
09127 // There are several caveats:
09128 // - Like all reference counting schemes, cycles lead to leaks.
09129 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
09130 // - Every time a pointer is assigned, the entire list of pointers to that
09131 //   object is traversed.  This class is therefore NOT SUITABLE when there
09132 //   will often be more than two or three pointers to a particular object.
09133 // - References are only tracked as long as linked_ptr<> objects are copied.
09134 //   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
09135 //   will happen (double deletion).
09136 //
09137 // A good use of this class is storing object references in STL containers.
09138 // You can safely put linked_ptr<> in a vector<>.
09139 // Other uses may not be as good.
09140 //
09141 // Note: If you use an incomplete type with linked_ptr<>, the class
09142 // *containing* linked_ptr<> must have a constructor and destructor (even
09143 // if they do nothing!).
09144 //
09145 // Bill Gibbons suggested we use something like this.
09146 //
09147 // Thread Safety:
09148 //   Unlike other linked_ptr implementations, in this implementation
09149 //   a linked_ptr object is thread-safe in the sense that:
09150 //     - it's safe to copy linked_ptr objects concurrently,
09151 //     - it's safe to copy *from* a linked_ptr and read its underlying
09152 //       raw pointer (e.g. via get()) concurrently, and
09153 //     - it's safe to write to two linked_ptrs that point to the same
09154 //       shared object concurrently.
09155 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
09156 // confusion with normal linked_ptr.
09157 
09158 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
09159 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
09160 
09161 #include <stdlib.h>
09162 #include <assert.h>
09163 
09164 
09165 namespace testing {
09166 namespace internal {
09167 
09168 // Protects copying of all linked_ptr objects.
09169 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
09170 
09171 // This is used internally by all instances of linked_ptr<>.  It needs to be
09172 // a non-template class because different types of linked_ptr<> can refer to
09173 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
09174 // So, it needs to be possible for different types of linked_ptr to participate
09175 // in the same circular linked list, so we need a single class type here.
09176 //
09177 // DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
09178 class linked_ptr_internal {
09179  public:
09180   // Create a new circle that includes only this instance.
09181   void join_new() {
09182     next_ = this;
09183   }
09184 
09185   // Many linked_ptr operations may change p.link_ for some linked_ptr
09186   // variable p in the same circle as this object.  Therefore we need
09187   // to prevent two such operations from occurring concurrently.
09188   //
09189   // Note that different types of linked_ptr objects can coexist in a
09190   // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
09191   // linked_ptr<Derived2>).  Therefore we must use a single mutex to
09192   // protect all linked_ptr objects.  This can create serious
09193   // contention in production code, but is acceptable in a testing
09194   // framework.
09195 
09196   // Join an existing circle.
09197   void join(linked_ptr_internal const* ptr)
09198       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
09199     MutexLock lock(&g_linked_ptr_mutex);
09200 
09201     linked_ptr_internal const* p = ptr;
09202     while (p->next_ != ptr) p = p->next_;
09203     p->next_ = this;
09204     next_ = ptr;
09205   }
09206 
09207   // Leave whatever circle we're part of.  Returns true if we were the
09208   // last member of the circle.  Once this is done, you can join() another.
09209   bool depart()
09210       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
09211     MutexLock lock(&g_linked_ptr_mutex);
09212 
09213     if (next_ == this) return true;
09214     linked_ptr_internal const* p = next_;
09215     while (p->next_ != this) p = p->next_;
09216     p->next_ = next_;
09217     return false;
09218   }
09219 
09220  private:
09221   mutable linked_ptr_internal const* next_;
09222 };
09223 
09224 template <typename T>
09225 class linked_ptr {
09226  public:
09227   typedef T element_type;
09228 
09229   // Take over ownership of a raw pointer.  This should happen as soon as
09230   // possible after the object is created.
09231   explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
09232   ~linked_ptr() { depart(); }
09233 
09234   // Copy an existing linked_ptr<>, adding ourselves to the list of references.
09235   template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
09236   linked_ptr(linked_ptr const& ptr) {  // NOLINT
09237     assert(&ptr != this);
09238     copy(&ptr);
09239   }
09240 
09241   // Assignment releases the old value and acquires the new.
09242   template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
09243     depart();
09244     copy(&ptr);
09245     return *this;
09246   }
09247 
09248   linked_ptr& operator=(linked_ptr const& ptr) {
09249     if (&ptr != this) {
09250       depart();
09251       copy(&ptr);
09252     }
09253     return *this;
09254   }
09255 
09256   // Smart pointer members.
09257   void reset(T* ptr = NULL) {
09258     depart();
09259     capture(ptr);
09260   }
09261   T* get() const { return value_; }
09262   T* operator->() const { return value_; }
09263   T& operator*() const { return *value_; }
09264 
09265   bool operator==(T* p) const { return value_ == p; }
09266   bool operator!=(T* p) const { return value_ != p; }
09267   template <typename U>
09268   bool operator==(linked_ptr<U> const& ptr) const {
09269     return value_ == ptr.get();
09270   }
09271   template <typename U>
09272   bool operator!=(linked_ptr<U> const& ptr) const {
09273     return value_ != ptr.get();
09274   }
09275 
09276  private:
09277   template <typename U>
09278   friend class linked_ptr;
09279 
09280   T* value_;
09281   linked_ptr_internal link_;
09282 
09283   void depart() {
09284     if (link_.depart()) delete value_;
09285   }
09286 
09287   void capture(T* ptr) {
09288     value_ = ptr;
09289     link_.join_new();
09290   }
09291 
09292   template <typename U> void copy(linked_ptr<U> const* ptr) {
09293     value_ = ptr->get();
09294     if (value_)
09295       link_.join(&ptr->link_);
09296     else
09297       link_.join_new();
09298   }
09299 };
09300 
09301 template<typename T> inline
09302 bool operator==(T* ptr, const linked_ptr<T>& x) {
09303   return ptr == x.get();
09304 }
09305 
09306 template<typename T> inline
09307 bool operator!=(T* ptr, const linked_ptr<T>& x) {
09308   return ptr != x.get();
09309 }
09310 
09311 // A function to convert T* into linked_ptr<T>
09312 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
09313 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
09314 template <typename T>
09315 linked_ptr<T> make_linked_ptr(T* ptr) {
09316   return linked_ptr<T>(ptr);
09317 }
09318 
09319 }  // namespace internal
09320 }  // namespace testing
09321 
09322 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
09323 // Copyright 2007, Google Inc.
09324 // All rights reserved.
09325 //
09326 // Redistribution and use in source and binary forms, with or without
09327 // modification, are permitted provided that the following conditions are
09328 // met:
09329 //
09330 //     * Redistributions of source code must retain the above copyright
09331 // notice, this list of conditions and the following disclaimer.
09332 //     * Redistributions in binary form must reproduce the above
09333 // copyright notice, this list of conditions and the following disclaimer
09334 // in the documentation and/or other materials provided with the
09335 // distribution.
09336 //     * Neither the name of Google Inc. nor the names of its
09337 // contributors may be used to endorse or promote products derived from
09338 // this software without specific prior written permission.
09339 //
09340 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
09341 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
09342 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
09343 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
09344 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
09345 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
09346 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
09347 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
09348 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
09349 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
09350 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
09351 //
09352 // Author: wan@google.com (Zhanyong Wan)
09353 
09354 // Google Test - The Google C++ Testing Framework
09355 //
09356 // This file implements a universal value printer that can print a
09357 // value of any type T:
09358 //
09359 //   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
09360 //
09361 // A user can teach this function how to print a class type T by
09362 // defining either operator<<() or PrintTo() in the namespace that
09363 // defines T.  More specifically, the FIRST defined function in the
09364 // following list will be used (assuming T is defined in namespace
09365 // foo):
09366 //
09367 //   1. foo::PrintTo(const T&, ostream*)
09368 //   2. operator<<(ostream&, const T&) defined in either foo or the
09369 //      global namespace.
09370 //
09371 // If none of the above is defined, it will print the debug string of
09372 // the value if it is a protocol buffer, or print the raw bytes in the
09373 // value otherwise.
09374 //
09375 // To aid debugging: when T is a reference type, the address of the
09376 // value is also printed; when T is a (const) char pointer, both the
09377 // pointer value and the NUL-terminated string it points to are
09378 // printed.
09379 //
09380 // We also provide some convenient wrappers:
09381 //
09382 //   // Prints a value to a string.  For a (const or not) char
09383 //   // pointer, the NUL-terminated string (but not the pointer) is
09384 //   // printed.
09385 //   std::string ::testing::PrintToString(const T& value);
09386 //
09387 //   // Prints a value tersely: for a reference type, the referenced
09388 //   // value (but not the address) is printed; for a (const or not) char
09389 //   // pointer, the NUL-terminated string (but not the pointer) is
09390 //   // printed.
09391 //   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
09392 //
09393 //   // Prints value using the type inferred by the compiler.  The difference
09394 //   // from UniversalTersePrint() is that this function prints both the
09395 //   // pointer and the NUL-terminated string for a (const or not) char pointer.
09396 //   void ::testing::internal::UniversalPrint(const T& value, ostream*);
09397 //
09398 //   // Prints the fields of a tuple tersely to a string vector, one
09399 //   // element for each field. Tuple support must be enabled in
09400 //   // gtest-port.h.
09401 //   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
09402 //       const Tuple& value);
09403 //
09404 // Known limitation:
09405 //
09406 // The print primitives print the elements of an STL-style container
09407 // using the compiler-inferred type of *iter where iter is a
09408 // const_iterator of the container.  When const_iterator is an input
09409 // iterator but not a forward iterator, this inferred type may not
09410 // match value_type, and the print output may be incorrect.  In
09411 // practice, this is rarely a problem as for most containers
09412 // const_iterator is a forward iterator.  We'll fix this if there's an
09413 // actual need for it.  Note that this fix cannot rely on value_type
09414 // being defined as many user-defined container types don't have
09415 // value_type.
09416 
09417 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
09418 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
09419 
09420 #include <ostream>  // NOLINT
09421 #include <sstream>
09422 #include <string>
09423 #include <utility>
09424 #include <vector>
09425 
09426 namespace testing {
09427 
09428 // Definitions in the 'internal' and 'internal2' name spaces are
09429 // subject to change without notice.  DO NOT USE THEM IN USER CODE!
09430 namespace internal2 {
09431 
09432 // Prints the given number of bytes in the given object to the given
09433 // ostream.
09434 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
09435                                      size_t count,
09436                                      ::std::ostream* os);
09437 
09438 // For selecting which printer to use when a given type has neither <<
09439 // nor PrintTo().
09440 enum TypeKind {
09441   kProtobuf,              // a protobuf type
09442   kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
09443                           // (e.g. a named or unnamed enum type)
09444   kOtherType              // anything else
09445 };
09446 
09447 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
09448 // by the universal printer to print a value of type T when neither
09449 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
09450 // "kind" of T as defined by enum TypeKind.
09451 template <typename T, TypeKind kTypeKind>
09452 class TypeWithoutFormatter {
09453  public:
09454   // This default version is called when kTypeKind is kOtherType.
09455   static void PrintValue(const T& value, ::std::ostream* os) {
09456     PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
09457                          sizeof(value), os);
09458   }
09459 };
09460 
09461 // We print a protobuf using its ShortDebugString() when the string
09462 // doesn't exceed this many characters; otherwise we print it using
09463 // DebugString() for better readability.
09464 const size_t kProtobufOneLinerMaxLength = 50;
09465 
09466 template <typename T>
09467 class TypeWithoutFormatter<T, kProtobuf> {
09468  public:
09469   static void PrintValue(const T& value, ::std::ostream* os) {
09470     const ::testing::internal::string short_str = value.ShortDebugString();
09471     const ::testing::internal::string pretty_str =
09472         short_str.length() <= kProtobufOneLinerMaxLength ?
09473         short_str : ("\n" + value.DebugString());
09474     *os << ("<" + pretty_str + ">");
09475   }
09476 };
09477 
09478 template <typename T>
09479 class TypeWithoutFormatter<T, kConvertibleToInteger> {
09480  public:
09481   // Since T has no << operator or PrintTo() but can be implicitly
09482   // converted to BiggestInt, we print it as a BiggestInt.
09483   //
09484   // Most likely T is an enum type (either named or unnamed), in which
09485   // case printing it as an integer is the desired behavior.  In case
09486   // T is not an enum, printing it as an integer is the best we can do
09487   // given that it has no user-defined printer.
09488   static void PrintValue(const T& value, ::std::ostream* os) {
09489     const internal::BiggestInt kBigInt = value;
09490     *os << kBigInt;
09491   }
09492 };
09493 
09494 // Prints the given value to the given ostream.  If the value is a
09495 // protocol message, its debug string is printed; if it's an enum or
09496 // of a type implicitly convertible to BiggestInt, it's printed as an
09497 // integer; otherwise the bytes in the value are printed.  This is
09498 // what UniversalPrinter<T>::Print() does when it knows nothing about
09499 // type T and T has neither << operator nor PrintTo().
09500 //
09501 // A user can override this behavior for a class type Foo by defining
09502 // a << operator in the namespace where Foo is defined.
09503 //
09504 // We put this operator in namespace 'internal2' instead of 'internal'
09505 // to simplify the implementation, as much code in 'internal' needs to
09506 // use << in STL, which would conflict with our own << were it defined
09507 // in 'internal'.
09508 //
09509 // Note that this operator<< takes a generic std::basic_ostream<Char,
09510 // CharTraits> type instead of the more restricted std::ostream.  If
09511 // we define it to take an std::ostream instead, we'll get an
09512 // "ambiguous overloads" compiler error when trying to print a type
09513 // Foo that supports streaming to std::basic_ostream<Char,
09514 // CharTraits>, as the compiler cannot tell whether
09515 // operator<<(std::ostream&, const T&) or
09516 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
09517 // specific.
09518 template <typename Char, typename CharTraits, typename T>
09519 ::std::basic_ostream<Char, CharTraits>& operator<<(
09520     ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
09521   TypeWithoutFormatter<T,
09522       (internal::IsAProtocolMessage<T>::value ? kProtobuf :
09523        internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
09524        kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
09525   return os;
09526 }
09527 
09528 }  // namespace internal2
09529 }  // namespace testing
09530 
09531 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
09532 // magic needed for implementing UniversalPrinter won't work.
09533 namespace testing_internal {
09534 
09535 // Used to print a value that is not an STL-style container when the
09536 // user doesn't define PrintTo() for it.
09537 template <typename T>
09538 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
09539   // With the following statement, during unqualified name lookup,
09540   // testing::internal2::operator<< appears as if it was declared in
09541   // the nearest enclosing namespace that contains both
09542   // ::testing_internal and ::testing::internal2, i.e. the global
09543   // namespace.  For more details, refer to the C++ Standard section
09544   // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
09545   // testing::internal2::operator<< in case T doesn't come with a <<
09546   // operator.
09547   //
09548   // We cannot write 'using ::testing::internal2::operator<<;', which
09549   // gcc 3.3 fails to compile due to a compiler bug.
09550   using namespace ::testing::internal2;  // NOLINT
09551 
09552   // Assuming T is defined in namespace foo, in the next statement,
09553   // the compiler will consider all of:
09554   //
09555   //   1. foo::operator<< (thanks to Koenig look-up),
09556   //   2. ::operator<< (as the current namespace is enclosed in ::),
09557   //   3. testing::internal2::operator<< (thanks to the using statement above).
09558   //
09559   // The operator<< whose type matches T best will be picked.
09560   //
09561   // We deliberately allow #2 to be a candidate, as sometimes it's
09562   // impossible to define #1 (e.g. when foo is ::std, defining
09563   // anything in it is undefined behavior unless you are a compiler
09564   // vendor.).
09565   *os << value;
09566 }
09567 
09568 }  // namespace testing_internal
09569 
09570 namespace testing {
09571 namespace internal {
09572 
09573 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
09574 // value to the given ostream.  The caller must ensure that
09575 // 'ostream_ptr' is not NULL, or the behavior is undefined.
09576 //
09577 // We define UniversalPrinter as a class template (as opposed to a
09578 // function template), as we need to partially specialize it for
09579 // reference types, which cannot be done with function templates.
09580 template <typename T>
09581 class UniversalPrinter;
09582 
09583 template <typename T>
09584 void UniversalPrint(const T& value, ::std::ostream* os);
09585 
09586 // Used to print an STL-style container when the user doesn't define
09587 // a PrintTo() for it.
09588 template <typename C>
09589 void DefaultPrintTo(IsContainer /* dummy */,
09590                     false_type /* is not a pointer */,
09591                     const C& container, ::std::ostream* os) {
09592   const size_t kMaxCount = 32;  // The maximum number of elements to print.
09593   *os << '{';
09594   size_t count = 0;
09595   for (typename C::const_iterator it = container.begin();
09596        it != container.end(); ++it, ++count) {
09597     if (count > 0) {
09598       *os << ',';
09599       if (count == kMaxCount) {  // Enough has been printed.
09600         *os << " ...";
09601         break;
09602       }
09603     }
09604     *os << ' ';
09605     // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
09606     // handle *it being a native array.
09607     internal::UniversalPrint(*it, os);
09608   }
09609 
09610   if (count > 0) {
09611     *os << ' ';
09612   }
09613   *os << '}';
09614 }
09615 
09616 // Used to print a pointer that is neither a char pointer nor a member
09617 // pointer, when the user doesn't define PrintTo() for it.  (A member
09618 // variable pointer or member function pointer doesn't really point to
09619 // a location in the address space.  Their representation is
09620 // implementation-defined.  Therefore they will be printed as raw
09621 // bytes.)
09622 template <typename T>
09623 void DefaultPrintTo(IsNotContainer /* dummy */,
09624                     true_type /* is a pointer */,
09625                     T* p, ::std::ostream* os) {
09626   if (p == NULL) {
09627     *os << "NULL";
09628   } else {
09629     // C++ doesn't allow casting from a function pointer to any object
09630     // pointer.
09631     //
09632     // IsTrue() silences warnings: "Condition is always true",
09633     // "unreachable code".
09634     if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
09635       // T is not a function type.  We just call << to print p,
09636       // relying on ADL to pick up user-defined << for their pointer
09637       // types, if any.
09638       *os << p;
09639     } else {
09640       // T is a function type, so '*os << p' doesn't do what we want
09641       // (it just prints p as bool).  We want to print p as a const
09642       // void*.  However, we cannot cast it to const void* directly,
09643       // even using reinterpret_cast, as earlier versions of gcc
09644       // (e.g. 3.4.5) cannot compile the cast when p is a function
09645       // pointer.  Casting to UInt64 first solves the problem.
09646       *os << reinterpret_cast<const void*>(
09647           reinterpret_cast<internal::UInt64>(p));
09648     }
09649   }
09650 }
09651 
09652 // Used to print a non-container, non-pointer value when the user
09653 // doesn't define PrintTo() for it.
09654 template <typename T>
09655 void DefaultPrintTo(IsNotContainer /* dummy */,
09656                     false_type /* is not a pointer */,
09657                     const T& value, ::std::ostream* os) {
09658   ::testing_internal::DefaultPrintNonContainerTo(value, os);
09659 }
09660 
09661 // Prints the given value using the << operator if it has one;
09662 // otherwise prints the bytes in it.  This is what
09663 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
09664 // or overloaded for type T.
09665 //
09666 // A user can override this behavior for a class type Foo by defining
09667 // an overload of PrintTo() in the namespace where Foo is defined.  We
09668 // give the user this option as sometimes defining a << operator for
09669 // Foo is not desirable (e.g. the coding style may prevent doing it,
09670 // or there is already a << operator but it doesn't do what the user
09671 // wants).
09672 template <typename T>
09673 void PrintTo(const T& value, ::std::ostream* os) {
09674   // DefaultPrintTo() is overloaded.  The type of its first two
09675   // arguments determine which version will be picked.  If T is an
09676   // STL-style container, the version for container will be called; if
09677   // T is a pointer, the pointer version will be called; otherwise the
09678   // generic version will be called.
09679   //
09680   // Note that we check for container types here, prior to we check
09681   // for protocol message types in our operator<<.  The rationale is:
09682   //
09683   // For protocol messages, we want to give people a chance to
09684   // override Google Mock's format by defining a PrintTo() or
09685   // operator<<.  For STL containers, other formats can be
09686   // incompatible with Google Mock's format for the container
09687   // elements; therefore we check for container types here to ensure
09688   // that our format is used.
09689   //
09690   // The second argument of DefaultPrintTo() is needed to bypass a bug
09691   // in Symbian's C++ compiler that prevents it from picking the right
09692   // overload between:
09693   //
09694   //   PrintTo(const T& x, ...);
09695   //   PrintTo(T* x, ...);
09696   DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
09697 }
09698 
09699 // The following list of PrintTo() overloads tells
09700 // UniversalPrinter<T>::Print() how to print standard types (built-in
09701 // types, strings, plain arrays, and pointers).
09702 
09703 // Overloads for various char types.
09704 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
09705 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
09706 inline void PrintTo(char c, ::std::ostream* os) {
09707   // When printing a plain char, we always treat it as unsigned.  This
09708   // way, the output won't be affected by whether the compiler thinks
09709   // char is signed or not.
09710   PrintTo(static_cast<unsigned char>(c), os);
09711 }
09712 
09713 // Overloads for other simple built-in types.
09714 inline void PrintTo(bool x, ::std::ostream* os) {
09715   *os << (x ? "true" : "false");
09716 }
09717 
09718 // Overload for wchar_t type.
09719 // Prints a wchar_t as a symbol if it is printable or as its internal
09720 // code otherwise and also as its decimal code (except for L'\0').
09721 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
09722 // as signed integer when wchar_t is implemented by the compiler
09723 // as a signed type and is printed as an unsigned integer when wchar_t
09724 // is implemented as an unsigned type.
09725 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
09726 
09727 // Overloads for C strings.
09728 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
09729 inline void PrintTo(char* s, ::std::ostream* os) {
09730   PrintTo(ImplicitCast_<const char*>(s), os);
09731 }
09732 
09733 // signed/unsigned char is often used for representing binary data, so
09734 // we print pointers to it as void* to be safe.
09735 inline void PrintTo(const signed char* s, ::std::ostream* os) {
09736   PrintTo(ImplicitCast_<const void*>(s), os);
09737 }
09738 inline void PrintTo(signed char* s, ::std::ostream* os) {
09739   PrintTo(ImplicitCast_<const void*>(s), os);
09740 }
09741 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
09742   PrintTo(ImplicitCast_<const void*>(s), os);
09743 }
09744 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
09745   PrintTo(ImplicitCast_<const void*>(s), os);
09746 }
09747 
09748 // MSVC can be configured to define wchar_t as a typedef of unsigned
09749 // short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
09750 // type.  When wchar_t is a typedef, defining an overload for const
09751 // wchar_t* would cause unsigned short* be printed as a wide string,
09752 // possibly causing invalid memory accesses.
09753 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
09754 // Overloads for wide C strings
09755 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
09756 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
09757   PrintTo(ImplicitCast_<const wchar_t*>(s), os);
09758 }
09759 #endif
09760 
09761 // Overload for C arrays.  Multi-dimensional arrays are printed
09762 // properly.
09763 
09764 // Prints the given number of elements in an array, without printing
09765 // the curly braces.
09766 template <typename T>
09767 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
09768   UniversalPrint(a[0], os);
09769   for (size_t i = 1; i != count; i++) {
09770     *os << ", ";
09771     UniversalPrint(a[i], os);
09772   }
09773 }
09774 
09775 // Overloads for ::string and ::std::string.
09776 #if GTEST_HAS_GLOBAL_STRING
09777 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
09778 inline void PrintTo(const ::string& s, ::std::ostream* os) {
09779   PrintStringTo(s, os);
09780 }
09781 #endif  // GTEST_HAS_GLOBAL_STRING
09782 
09783 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
09784 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
09785   PrintStringTo(s, os);
09786 }
09787 
09788 // Overloads for ::wstring and ::std::wstring.
09789 #if GTEST_HAS_GLOBAL_WSTRING
09790 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
09791 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
09792   PrintWideStringTo(s, os);
09793 }
09794 #endif  // GTEST_HAS_GLOBAL_WSTRING
09795 
09796 #if GTEST_HAS_STD_WSTRING
09797 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
09798 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
09799   PrintWideStringTo(s, os);
09800 }
09801 #endif  // GTEST_HAS_STD_WSTRING
09802 
09803 #if GTEST_HAS_TR1_TUPLE
09804 // Overload for ::std::tr1::tuple.  Needed for printing function arguments,
09805 // which are packed as tuples.
09806 
09807 // Helper function for printing a tuple.  T must be instantiated with
09808 // a tuple type.
09809 template <typename T>
09810 void PrintTupleTo(const T& t, ::std::ostream* os);
09811 
09812 // Overloaded PrintTo() for tuples of various arities.  We support
09813 // tuples of up-to 10 fields.  The following implementation works
09814 // regardless of whether tr1::tuple is implemented using the
09815 // non-standard variadic template feature or not.
09816 
09817 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
09818   PrintTupleTo(t, os);
09819 }
09820 
09821 template <typename T1>
09822 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
09823   PrintTupleTo(t, os);
09824 }
09825 
09826 template <typename T1, typename T2>
09827 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
09828   PrintTupleTo(t, os);
09829 }
09830 
09831 template <typename T1, typename T2, typename T3>
09832 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
09833   PrintTupleTo(t, os);
09834 }
09835 
09836 template <typename T1, typename T2, typename T3, typename T4>
09837 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
09838   PrintTupleTo(t, os);
09839 }
09840 
09841 template <typename T1, typename T2, typename T3, typename T4, typename T5>
09842 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
09843              ::std::ostream* os) {
09844   PrintTupleTo(t, os);
09845 }
09846 
09847 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09848           typename T6>
09849 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
09850              ::std::ostream* os) {
09851   PrintTupleTo(t, os);
09852 }
09853 
09854 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09855           typename T6, typename T7>
09856 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
09857              ::std::ostream* os) {
09858   PrintTupleTo(t, os);
09859 }
09860 
09861 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09862           typename T6, typename T7, typename T8>
09863 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
09864              ::std::ostream* os) {
09865   PrintTupleTo(t, os);
09866 }
09867 
09868 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09869           typename T6, typename T7, typename T8, typename T9>
09870 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
09871              ::std::ostream* os) {
09872   PrintTupleTo(t, os);
09873 }
09874 
09875 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09876           typename T6, typename T7, typename T8, typename T9, typename T10>
09877 void PrintTo(
09878     const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
09879     ::std::ostream* os) {
09880   PrintTupleTo(t, os);
09881 }
09882 #endif  // GTEST_HAS_TR1_TUPLE
09883 
09884 // Overload for std::pair.
09885 template <typename T1, typename T2>
09886 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
09887   *os << '(';
09888   // We cannot use UniversalPrint(value.first, os) here, as T1 may be
09889   // a reference type.  The same for printing value.second.
09890   UniversalPrinter<T1>::Print(value.first, os);
09891   *os << ", ";
09892   UniversalPrinter<T2>::Print(value.second, os);
09893   *os << ')';
09894 }
09895 
09896 // Implements printing a non-reference type T by letting the compiler
09897 // pick the right overload of PrintTo() for T.
09898 template <typename T>
09899 class UniversalPrinter {
09900  public:
09901   // MSVC warns about adding const to a function type, so we want to
09902   // disable the warning.
09903 #ifdef _MSC_VER
09904 # pragma warning(push)          // Saves the current warning state.
09905 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
09906 #endif  // _MSC_VER
09907 
09908   // Note: we deliberately don't call this PrintTo(), as that name
09909   // conflicts with ::testing::internal::PrintTo in the body of the
09910   // function.
09911   static void Print(const T& value, ::std::ostream* os) {
09912     // By default, ::testing::internal::PrintTo() is used for printing
09913     // the value.
09914     //
09915     // Thanks to Koenig look-up, if T is a class and has its own
09916     // PrintTo() function defined in its namespace, that function will
09917     // be visible here.  Since it is more specific than the generic ones
09918     // in ::testing::internal, it will be picked by the compiler in the
09919     // following statement - exactly what we want.
09920     PrintTo(value, os);
09921   }
09922 
09923 #ifdef _MSC_VER
09924 # pragma warning(pop)           // Restores the warning state.
09925 #endif  // _MSC_VER
09926 };
09927 
09928 // UniversalPrintArray(begin, len, os) prints an array of 'len'
09929 // elements, starting at address 'begin'.
09930 template <typename T>
09931 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
09932   if (len == 0) {
09933     *os << "{}";
09934   } else {
09935     *os << "{ ";
09936     const size_t kThreshold = 18;
09937     const size_t kChunkSize = 8;
09938     // If the array has more than kThreshold elements, we'll have to
09939     // omit some details by printing only the first and the last
09940     // kChunkSize elements.
09941     // TODO(wan@google.com): let the user control the threshold using a flag.
09942     if (len <= kThreshold) {
09943       PrintRawArrayTo(begin, len, os);
09944     } else {
09945       PrintRawArrayTo(begin, kChunkSize, os);
09946       *os << ", ..., ";
09947       PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
09948     }
09949     *os << " }";
09950   }
09951 }
09952 // This overload prints a (const) char array compactly.
09953 GTEST_API_ void UniversalPrintArray(
09954     const char* begin, size_t len, ::std::ostream* os);
09955 
09956 // This overload prints a (const) wchar_t array compactly.
09957 GTEST_API_ void UniversalPrintArray(
09958     const wchar_t* begin, size_t len, ::std::ostream* os);
09959 
09960 // Implements printing an array type T[N].
09961 template <typename T, size_t N>
09962 class UniversalPrinter<T[N]> {
09963  public:
09964   // Prints the given array, omitting some elements when there are too
09965   // many.
09966   static void Print(const T (&a)[N], ::std::ostream* os) {
09967     UniversalPrintArray(a, N, os);
09968   }
09969 };
09970 
09971 // Implements printing a reference type T&.
09972 template <typename T>
09973 class UniversalPrinter<T&> {
09974  public:
09975   // MSVC warns about adding const to a function type, so we want to
09976   // disable the warning.
09977 #ifdef _MSC_VER
09978 # pragma warning(push)          // Saves the current warning state.
09979 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
09980 #endif  // _MSC_VER
09981 
09982   static void Print(const T& value, ::std::ostream* os) {
09983     // Prints the address of the value.  We use reinterpret_cast here
09984     // as static_cast doesn't compile when T is a function type.
09985     *os << "@" << reinterpret_cast<const void*>(&value) << " ";
09986 
09987     // Then prints the value itself.
09988     UniversalPrint(value, os);
09989   }
09990 
09991 #ifdef _MSC_VER
09992 # pragma warning(pop)           // Restores the warning state.
09993 #endif  // _MSC_VER
09994 };
09995 
09996 // Prints a value tersely: for a reference type, the referenced value
09997 // (but not the address) is printed; for a (const) char pointer, the
09998 // NUL-terminated string (but not the pointer) is printed.
09999 
10000 template <typename T>
10001 class UniversalTersePrinter {
10002  public:
10003   static void Print(const T& value, ::std::ostream* os) {
10004     UniversalPrint(value, os);
10005   }
10006 };
10007 template <typename T>
10008 class UniversalTersePrinter<T&> {
10009  public:
10010   static void Print(const T& value, ::std::ostream* os) {
10011     UniversalPrint(value, os);
10012   }
10013 };
10014 template <typename T, size_t N>
10015 class UniversalTersePrinter<T[N]> {
10016  public:
10017   static void Print(const T (&value)[N], ::std::ostream* os) {
10018     UniversalPrinter<T[N]>::Print(value, os);
10019   }
10020 };
10021 template <>
10022 class UniversalTersePrinter<const char*> {
10023  public:
10024   static void Print(const char* str, ::std::ostream* os) {
10025     if (str == NULL) {
10026       *os << "NULL";
10027     } else {
10028       UniversalPrint(string(str), os);
10029     }
10030   }
10031 };
10032 template <>
10033 class UniversalTersePrinter<char*> {
10034  public:
10035   static void Print(char* str, ::std::ostream* os) {
10036     UniversalTersePrinter<const char*>::Print(str, os);
10037   }
10038 };
10039 
10040 #if GTEST_HAS_STD_WSTRING
10041 template <>
10042 class UniversalTersePrinter<const wchar_t*> {
10043  public:
10044   static void Print(const wchar_t* str, ::std::ostream* os) {
10045     if (str == NULL) {
10046       *os << "NULL";
10047     } else {
10048       UniversalPrint(::std::wstring(str), os);
10049     }
10050   }
10051 };
10052 #endif
10053 
10054 template <>
10055 class UniversalTersePrinter<wchar_t*> {
10056  public:
10057   static void Print(wchar_t* str, ::std::ostream* os) {
10058     UniversalTersePrinter<const wchar_t*>::Print(str, os);
10059   }
10060 };
10061 
10062 template <typename T>
10063 void UniversalTersePrint(const T& value, ::std::ostream* os) {
10064   UniversalTersePrinter<T>::Print(value, os);
10065 }
10066 
10067 // Prints a value using the type inferred by the compiler.  The
10068 // difference between this and UniversalTersePrint() is that for a
10069 // (const) char pointer, this prints both the pointer and the
10070 // NUL-terminated string.
10071 template <typename T>
10072 void UniversalPrint(const T& value, ::std::ostream* os) {
10073   // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
10074   // UniversalPrinter with T directly.
10075   typedef T T1;
10076   UniversalPrinter<T1>::Print(value, os);
10077 }
10078 
10079 #if GTEST_HAS_TR1_TUPLE
10080 typedef ::std::vector<string> Strings;
10081 
10082 // This helper template allows PrintTo() for tuples and
10083 // UniversalTersePrintTupleFieldsToStrings() to be defined by
10084 // induction on the number of tuple fields.  The idea is that
10085 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
10086 // fields in tuple t, and can be defined in terms of
10087 // TuplePrefixPrinter<N - 1>.
10088 
10089 // The inductive case.
10090 template <size_t N>
10091 struct TuplePrefixPrinter {
10092   // Prints the first N fields of a tuple.
10093   template <typename Tuple>
10094   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10095     TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
10096     *os << ", ";
10097     UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
10098         ::Print(::std::tr1::get<N - 1>(t), os);
10099   }
10100 
10101   // Tersely prints the first N fields of a tuple to a string vector,
10102   // one element for each field.
10103   template <typename Tuple>
10104   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10105     TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
10106     ::std::stringstream ss;
10107     UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
10108     strings->push_back(ss.str());
10109   }
10110 };
10111 
10112 // Base cases.
10113 template <>
10114 struct TuplePrefixPrinter<0> {
10115   template <typename Tuple>
10116   static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
10117 
10118   template <typename Tuple>
10119   static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
10120 };
10121 // We have to specialize the entire TuplePrefixPrinter<> class
10122 // template here, even though the definition of
10123 // TersePrintPrefixToStrings() is the same as the generic version, as
10124 // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
10125 // support specializing a method template of a class template.
10126 template <>
10127 struct TuplePrefixPrinter<1> {
10128   template <typename Tuple>
10129   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10130     UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10131         Print(::std::tr1::get<0>(t), os);
10132   }
10133 
10134   template <typename Tuple>
10135   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10136     ::std::stringstream ss;
10137     UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10138     strings->push_back(ss.str());
10139   }
10140 };
10141 
10142 // Helper function for printing a tuple.  T must be instantiated with
10143 // a tuple type.
10144 template <typename T>
10145 void PrintTupleTo(const T& t, ::std::ostream* os) {
10146   *os << "(";
10147   TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10148       PrintPrefixTo(t, os);
10149   *os << ")";
10150 }
10151 
10152 // Prints the fields of a tuple tersely to a string vector, one
10153 // element for each field.  See the comment before
10154 // UniversalTersePrint() for how we define "tersely".
10155 template <typename Tuple>
10156 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10157   Strings result;
10158   TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10159       TersePrintPrefixToStrings(value, &result);
10160   return result;
10161 }
10162 #endif  // GTEST_HAS_TR1_TUPLE
10163 
10164 }  // namespace internal
10165 
10166 template <typename T>
10167 ::std::string PrintToString(const T& value) {
10168   ::std::stringstream ss;
10169   internal::UniversalTersePrinter<T>::Print(value, &ss);
10170   return ss.str();
10171 }
10172 
10173 }  // namespace testing
10174 
10175 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10176 
10177 #if GTEST_HAS_PARAM_TEST
10178 
10179 namespace testing {
10180 namespace internal {
10181 
10182 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10183 //
10184 // Outputs a message explaining invalid registration of different
10185 // fixture class for the same test case. This may happen when
10186 // TEST_P macro is used to define two tests with the same name
10187 // but in different namespaces.
10188 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10189                                           const char* file, int line);
10190 
10191 template <typename> class ParamGeneratorInterface;
10192 template <typename> class ParamGenerator;
10193 
10194 // Interface for iterating over elements provided by an implementation
10195 // of ParamGeneratorInterface<T>.
10196 template <typename T>
10197 class ParamIteratorInterface {
10198  public:
10199   virtual ~ParamIteratorInterface() {}
10200   // A pointer to the base generator instance.
10201   // Used only for the purposes of iterator comparison
10202   // to make sure that two iterators belong to the same generator.
10203   virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10204   // Advances iterator to point to the next element
10205   // provided by the generator. The caller is responsible
10206   // for not calling Advance() on an iterator equal to
10207   // BaseGenerator()->End().
10208   virtual void Advance() = 0;
10209   // Clones the iterator object. Used for implementing copy semantics
10210   // of ParamIterator<T>.
10211   virtual ParamIteratorInterface* Clone() const = 0;
10212   // Dereferences the current iterator and provides (read-only) access
10213   // to the pointed value. It is the caller's responsibility not to call
10214   // Current() on an iterator equal to BaseGenerator()->End().
10215   // Used for implementing ParamGenerator<T>::operator*().
10216   virtual const T* Current() const = 0;
10217   // Determines whether the given iterator and other point to the same
10218   // element in the sequence generated by the generator.
10219   // Used for implementing ParamGenerator<T>::operator==().
10220   virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10221 };
10222 
10223 // Class iterating over elements provided by an implementation of
10224 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10225 // and implements the const forward iterator concept.
10226 template <typename T>
10227 class ParamIterator {
10228  public:
10229   typedef T value_type;
10230   typedef const T& reference;
10231   typedef ptrdiff_t difference_type;
10232 
10233   // ParamIterator assumes ownership of the impl_ pointer.
10234   ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10235   ParamIterator& operator=(const ParamIterator& other) {
10236     if (this != &other)
10237       impl_.reset(other.impl_->Clone());
10238     return *this;
10239   }
10240 
10241   const T& operator*() const { return *impl_->Current(); }
10242   const T* operator->() const { return impl_->Current(); }
10243   // Prefix version of operator++.
10244   ParamIterator& operator++() {
10245     impl_->Advance();
10246     return *this;
10247   }
10248   // Postfix version of operator++.
10249   ParamIterator operator++(int /*unused*/) {
10250     ParamIteratorInterface<T>* clone = impl_->Clone();
10251     impl_->Advance();
10252     return ParamIterator(clone);
10253   }
10254   bool operator==(const ParamIterator& other) const {
10255     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10256   }
10257   bool operator!=(const ParamIterator& other) const {
10258     return !(*this == other);
10259   }
10260 
10261  private:
10262   friend class ParamGenerator<T>;
10263   explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10264   scoped_ptr<ParamIteratorInterface<T> > impl_;
10265 };
10266 
10267 // ParamGeneratorInterface<T> is the binary interface to access generators
10268 // defined in other translation units.
10269 template <typename T>
10270 class ParamGeneratorInterface {
10271  public:
10272   typedef T ParamType;
10273 
10274   virtual ~ParamGeneratorInterface() {}
10275 
10276   // Generator interface definition
10277   virtual ParamIteratorInterface<T>* Begin() const = 0;
10278   virtual ParamIteratorInterface<T>* End() const = 0;
10279 };
10280 
10281 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
10282 // compatible with the STL Container concept.
10283 // This class implements copy initialization semantics and the contained
10284 // ParamGeneratorInterface<T> instance is shared among all copies
10285 // of the original object. This is possible because that instance is immutable.
10286 template<typename T>
10287 class ParamGenerator {
10288  public:
10289   typedef ParamIterator<T> iterator;
10290 
10291   explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10292   ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10293 
10294   ParamGenerator& operator=(const ParamGenerator& other) {
10295     impl_ = other.impl_;
10296     return *this;
10297   }
10298 
10299   iterator begin() const { return iterator(impl_->Begin()); }
10300   iterator end() const { return iterator(impl_->End()); }
10301 
10302  private:
10303   linked_ptr<const ParamGeneratorInterface<T> > impl_;
10304 };
10305 
10306 // Generates values from a range of two comparable values. Can be used to
10307 // generate sequences of user-defined types that implement operator+() and
10308 // operator<().
10309 // This class is used in the Range() function.
10310 template <typename T, typename IncrementT>
10311 class RangeGenerator : public ParamGeneratorInterface<T> {
10312  public:
10313   RangeGenerator(T begin, T end, IncrementT step)
10314       : begin_(begin), end_(end),
10315         step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10316   virtual ~RangeGenerator() {}
10317 
10318   virtual ParamIteratorInterface<T>* Begin() const {
10319     return new Iterator(this, begin_, 0, step_);
10320   }
10321   virtual ParamIteratorInterface<T>* End() const {
10322     return new Iterator(this, end_, end_index_, step_);
10323   }
10324 
10325  private:
10326   class Iterator : public ParamIteratorInterface<T> {
10327    public:
10328     Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10329              IncrementT step)
10330         : base_(base), value_(value), index_(index), step_(step) {}
10331     virtual ~Iterator() {}
10332 
10333     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10334       return base_;
10335     }
10336     virtual void Advance() {
10337       value_ = value_ + step_;
10338       index_++;
10339     }
10340     virtual ParamIteratorInterface<T>* Clone() const {
10341       return new Iterator(*this);
10342     }
10343     virtual const T* Current() const { return &value_; }
10344     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10345       // Having the same base generator guarantees that the other
10346       // iterator is of the same type and we can downcast.
10347       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10348           << "The program attempted to compare iterators "
10349           << "from different generators." << std::endl;
10350       const int other_index =
10351           CheckedDowncastToActualType<const Iterator>(&other)->index_;
10352       return index_ == other_index;
10353     }
10354 
10355    private:
10356     Iterator(const Iterator& other)
10357         : ParamIteratorInterface<T>(),
10358           base_(other.base_), value_(other.value_), index_(other.index_),
10359           step_(other.step_) {}
10360 
10361     // No implementation - assignment is unsupported.
10362     void operator=(const Iterator& other);
10363 
10364     const ParamGeneratorInterface<T>* const base_;
10365     T value_;
10366     int index_;
10367     const IncrementT step_;
10368   };  // class RangeGenerator::Iterator
10369 
10370   static int CalculateEndIndex(const T& begin,
10371                                const T& end,
10372                                const IncrementT& step) {
10373     int end_index = 0;
10374     for (T i = begin; i < end; i = i + step)
10375       end_index++;
10376     return end_index;
10377   }
10378 
10379   // No implementation - assignment is unsupported.
10380   void operator=(const RangeGenerator& other);
10381 
10382   const T begin_;
10383   const T end_;
10384   const IncrementT step_;
10385   // The index for the end() iterator. All the elements in the generated
10386   // sequence are indexed (0-based) to aid iterator comparison.
10387   const int end_index_;
10388 };  // class RangeGenerator
10389 
10390 
10391 // Generates values from a pair of STL-style iterators. Used in the
10392 // ValuesIn() function. The elements are copied from the source range
10393 // since the source can be located on the stack, and the generator
10394 // is likely to persist beyond that stack frame.
10395 template <typename T>
10396 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10397  public:
10398   template <typename ForwardIterator>
10399   ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10400       : container_(begin, end) {}
10401   virtual ~ValuesInIteratorRangeGenerator() {}
10402 
10403   virtual ParamIteratorInterface<T>* Begin() const {
10404     return new Iterator(this, container_.begin());
10405   }
10406   virtual ParamIteratorInterface<T>* End() const {
10407     return new Iterator(this, container_.end());
10408   }
10409 
10410  private:
10411   typedef typename ::std::vector<T> ContainerType;
10412 
10413   class Iterator : public ParamIteratorInterface<T> {
10414    public:
10415     Iterator(const ParamGeneratorInterface<T>* base,
10416              typename ContainerType::const_iterator iterator)
10417         : base_(base), iterator_(iterator) {}
10418     virtual ~Iterator() {}
10419 
10420     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10421       return base_;
10422     }
10423     virtual void Advance() {
10424       ++iterator_;
10425       value_.reset();
10426     }
10427     virtual ParamIteratorInterface<T>* Clone() const {
10428       return new Iterator(*this);
10429     }
10430     // We need to use cached value referenced by iterator_ because *iterator_
10431     // can return a temporary object (and of type other then T), so just
10432     // having "return &*iterator_;" doesn't work.
10433     // value_ is updated here and not in Advance() because Advance()
10434     // can advance iterator_ beyond the end of the range, and we cannot
10435     // detect that fact. The client code, on the other hand, is
10436     // responsible for not calling Current() on an out-of-range iterator.
10437     virtual const T* Current() const {
10438       if (value_.get() == NULL)
10439         value_.reset(new T(*iterator_));
10440       return value_.get();
10441     }
10442     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10443       // Having the same base generator guarantees that the other
10444       // iterator is of the same type and we can downcast.
10445       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10446           << "The program attempted to compare iterators "
10447           << "from different generators." << std::endl;
10448       return iterator_ ==
10449           CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10450     }
10451 
10452    private:
10453     Iterator(const Iterator& other)
10454           // The explicit constructor call suppresses a false warning
10455           // emitted by gcc when supplied with the -Wextra option.
10456         : ParamIteratorInterface<T>(),
10457           base_(other.base_),
10458           iterator_(other.iterator_) {}
10459 
10460     const ParamGeneratorInterface<T>* const base_;
10461     typename ContainerType::const_iterator iterator_;
10462     // A cached value of *iterator_. We keep it here to allow access by
10463     // pointer in the wrapping iterator's operator->().
10464     // value_ needs to be mutable to be accessed in Current().
10465     // Use of scoped_ptr helps manage cached value's lifetime,
10466     // which is bound by the lifespan of the iterator itself.
10467     mutable scoped_ptr<const T> value_;
10468   };  // class ValuesInIteratorRangeGenerator::Iterator
10469 
10470   // No implementation - assignment is unsupported.
10471   void operator=(const ValuesInIteratorRangeGenerator& other);
10472 
10473   const ContainerType container_;
10474 };  // class ValuesInIteratorRangeGenerator
10475 
10476 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10477 //
10478 // Stores a parameter value and later creates tests parameterized with that
10479 // value.
10480 template <class TestClass>
10481 class ParameterizedTestFactory : public TestFactoryBase {
10482  public:
10483   typedef typename TestClass::ParamType ParamType;
10484   explicit ParameterizedTestFactory(ParamType parameter) :
10485       parameter_(parameter) {}
10486   virtual Test* CreateTest() {
10487     TestClass::SetParam(&parameter_);
10488     return new TestClass();
10489   }
10490 
10491  private:
10492   const ParamType parameter_;
10493 
10494   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10495 };
10496 
10497 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10498 //
10499 // TestMetaFactoryBase is a base class for meta-factories that create
10500 // test factories for passing into MakeAndRegisterTestInfo function.
10501 template <class ParamType>
10502 class TestMetaFactoryBase {
10503  public:
10504   virtual ~TestMetaFactoryBase() {}
10505 
10506   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10507 };
10508 
10509 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10510 //
10511 // TestMetaFactory creates test factories for passing into
10512 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10513 // ownership of test factory pointer, same factory object cannot be passed
10514 // into that method twice. But ParameterizedTestCaseInfo is going to call
10515 // it for each Test/Parameter value combination. Thus it needs meta factory
10516 // creator class.
10517 template <class TestCase>
10518 class TestMetaFactory
10519     : public TestMetaFactoryBase<typename TestCase::ParamType> {
10520  public:
10521   typedef typename TestCase::ParamType ParamType;
10522 
10523   TestMetaFactory() {}
10524 
10525   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10526     return new ParameterizedTestFactory<TestCase>(parameter);
10527   }
10528 
10529  private:
10530   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10531 };
10532 
10533 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10534 //
10535 // ParameterizedTestCaseInfoBase is a generic interface
10536 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10537 // accumulates test information provided by TEST_P macro invocations
10538 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10539 // and uses that information to register all resulting test instances
10540 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10541 // a collection of pointers to the ParameterizedTestCaseInfo objects
10542 // and calls RegisterTests() on each of them when asked.
10543 class ParameterizedTestCaseInfoBase {
10544  public:
10545   virtual ~ParameterizedTestCaseInfoBase() {}
10546 
10547   // Base part of test case name for display purposes.
10548   virtual const string& GetTestCaseName() const = 0;
10549   // Test case id to verify identity.
10550   virtual TypeId GetTestCaseTypeId() const = 0;
10551   // UnitTest class invokes this method to register tests in this
10552   // test case right before running them in RUN_ALL_TESTS macro.
10553   // This method should not be called more then once on any single
10554   // instance of a ParameterizedTestCaseInfoBase derived class.
10555   virtual void RegisterTests() = 0;
10556 
10557  protected:
10558   ParameterizedTestCaseInfoBase() {}
10559 
10560  private:
10561   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10562 };
10563 
10564 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10565 //
10566 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10567 // macro invocations for a particular test case and generators
10568 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10569 // test case. It registers tests with all values generated by all
10570 // generators when asked.
10571 template <class TestCase>
10572 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10573  public:
10574   // ParamType and GeneratorCreationFunc are private types but are required
10575   // for declarations of public methods AddTestPattern() and
10576   // AddTestCaseInstantiation().
10577   typedef typename TestCase::ParamType ParamType;
10578   // A function that returns an instance of appropriate generator type.
10579   typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10580 
10581   explicit ParameterizedTestCaseInfo(const char* name)
10582       : test_case_name_(name) {}
10583 
10584   // Test case base name for display purposes.
10585   virtual const string& GetTestCaseName() const { return test_case_name_; }
10586   // Test case id to verify identity.
10587   virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10588   // TEST_P macro uses AddTestPattern() to record information
10589   // about a single test in a LocalTestInfo structure.
10590   // test_case_name is the base name of the test case (without invocation
10591   // prefix). test_base_name is the name of an individual test without
10592   // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10593   // test case base name and DoBar is test base name.
10594   void AddTestPattern(const char* test_case_name,
10595                       const char* test_base_name,
10596                       TestMetaFactoryBase<ParamType>* meta_factory) {
10597     tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10598                                                        test_base_name,
10599                                                        meta_factory)));
10600   }
10601   // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10602   // about a generator.
10603   int AddTestCaseInstantiation(const string& instantiation_name,
10604                                GeneratorCreationFunc* func,
10605                                const char* /* file */,
10606                                int /* line */) {
10607     instantiations_.push_back(::std::make_pair(instantiation_name, func));
10608     return 0;  // Return value used only to run this method in namespace scope.
10609   }
10610   // UnitTest class invokes this method to register tests in this test case
10611   // test cases right before running tests in RUN_ALL_TESTS macro.
10612   // This method should not be called more then once on any single
10613   // instance of a ParameterizedTestCaseInfoBase derived class.
10614   // UnitTest has a guard to prevent from calling this method more then once.
10615   virtual void RegisterTests() {
10616     for (typename TestInfoContainer::iterator test_it = tests_.begin();
10617          test_it != tests_.end(); ++test_it) {
10618       linked_ptr<TestInfo> test_info = *test_it;
10619       for (typename InstantiationContainer::iterator gen_it =
10620                instantiations_.begin(); gen_it != instantiations_.end();
10621                ++gen_it) {
10622         const string& instantiation_name = gen_it->first;
10623         ParamGenerator<ParamType> generator((*gen_it->second)());
10624 
10625         Message test_case_name_stream;
10626         if ( !instantiation_name.empty() )
10627           test_case_name_stream << instantiation_name << "/";
10628         test_case_name_stream << test_info->test_case_base_name;
10629 
10630         int i = 0;
10631         for (typename ParamGenerator<ParamType>::iterator param_it =
10632                  generator.begin();
10633              param_it != generator.end(); ++param_it, ++i) {
10634           Message test_name_stream;
10635           test_name_stream << test_info->test_base_name << "/" << i;
10636           MakeAndRegisterTestInfo(
10637               test_case_name_stream.GetString().c_str(),
10638               test_name_stream.GetString().c_str(),
10639               NULL,  // No type parameter.
10640               PrintToString(*param_it).c_str(),
10641               GetTestCaseTypeId(),
10642               TestCase::SetUpTestCase,
10643               TestCase::TearDownTestCase,
10644               test_info->test_meta_factory->CreateTestFactory(*param_it));
10645         }  // for param_it
10646       }  // for gen_it
10647     }  // for test_it
10648   }  // RegisterTests
10649 
10650  private:
10651   // LocalTestInfo structure keeps information about a single test registered
10652   // with TEST_P macro.
10653   struct TestInfo {
10654     TestInfo(const char* a_test_case_base_name,
10655              const char* a_test_base_name,
10656              TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10657         test_case_base_name(a_test_case_base_name),
10658         test_base_name(a_test_base_name),
10659         test_meta_factory(a_test_meta_factory) {}
10660 
10661     const string test_case_base_name;
10662     const string test_base_name;
10663     const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10664   };
10665   typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10666   // Keeps pairs of <Instantiation name, Sequence generator creation function>
10667   // received from INSTANTIATE_TEST_CASE_P macros.
10668   typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10669       InstantiationContainer;
10670 
10671   const string test_case_name_;
10672   TestInfoContainer tests_;
10673   InstantiationContainer instantiations_;
10674 
10675   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10676 };  // class ParameterizedTestCaseInfo
10677 
10678 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10679 //
10680 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10681 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10682 // macros use it to locate their corresponding ParameterizedTestCaseInfo
10683 // descriptors.
10684 class ParameterizedTestCaseRegistry {
10685  public:
10686   ParameterizedTestCaseRegistry() {}
10687   ~ParameterizedTestCaseRegistry() {
10688     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10689          it != test_case_infos_.end(); ++it) {
10690       delete *it;
10691     }
10692   }
10693 
10694   // Looks up or creates and returns a structure containing information about
10695   // tests and instantiations of a particular test case.
10696   template <class TestCase>
10697   ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10698       const char* test_case_name,
10699       const char* file,
10700       int line) {
10701     ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10702     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10703          it != test_case_infos_.end(); ++it) {
10704       if ((*it)->GetTestCaseName() == test_case_name) {
10705         if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10706           // Complain about incorrect usage of Google Test facilities
10707           // and terminate the program since we cannot guaranty correct
10708           // test case setup and tear-down in this case.
10709           ReportInvalidTestCaseType(test_case_name,  file, line);
10710           posix::Abort();
10711         } else {
10712           // At this point we are sure that the object we found is of the same
10713           // type we are looking for, so we downcast it to that type
10714           // without further checks.
10715           typed_test_info = CheckedDowncastToActualType<
10716               ParameterizedTestCaseInfo<TestCase> >(*it);
10717         }
10718         break;
10719       }
10720     }
10721     if (typed_test_info == NULL) {
10722       typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10723       test_case_infos_.push_back(typed_test_info);
10724     }
10725     return typed_test_info;
10726   }
10727   void RegisterTests() {
10728     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10729          it != test_case_infos_.end(); ++it) {
10730       (*it)->RegisterTests();
10731     }
10732   }
10733 
10734  private:
10735   typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10736 
10737   TestCaseInfoContainer test_case_infos_;
10738 
10739   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10740 };
10741 
10742 }  // namespace internal
10743 }  // namespace testing
10744 
10745 #endif  //  GTEST_HAS_PARAM_TEST
10746 
10747 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10748 // This file was GENERATED by command:
10749 //     pump.py gtest-param-util-generated.h.pump
10750 // DO NOT EDIT BY HAND!!!
10751 
10752 // Copyright 2008 Google Inc.
10753 // All Rights Reserved.
10754 //
10755 // Redistribution and use in source and binary forms, with or without
10756 // modification, are permitted provided that the following conditions are
10757 // met:
10758 //
10759 //     * Redistributions of source code must retain the above copyright
10760 // notice, this list of conditions and the following disclaimer.
10761 //     * Redistributions in binary form must reproduce the above
10762 // copyright notice, this list of conditions and the following disclaimer
10763 // in the documentation and/or other materials provided with the
10764 // distribution.
10765 //     * Neither the name of Google Inc. nor the names of its
10766 // contributors may be used to endorse or promote products derived from
10767 // this software without specific prior written permission.
10768 //
10769 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10770 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10771 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10772 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10773 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10774 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10775 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10776 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10777 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10778 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10779 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10780 //
10781 // Author: vladl@google.com (Vlad Losev)
10782 
10783 // Type and function utilities for implementing parameterized tests.
10784 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
10785 //
10786 // Currently Google Test supports at most 50 arguments in Values,
10787 // and at most 10 arguments in Combine. Please contact
10788 // googletestframework@googlegroups.com if you need more.
10789 // Please note that the number of arguments to Combine is limited
10790 // by the maximum arity of the implementation of tr1::tuple which is
10791 // currently set at 10.
10792 
10793 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10794 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10795 
10796 // scripts/fuse_gtest.py depends on gtest's own header being #included
10797 // *unconditionally*.  Therefore these #includes cannot be moved
10798 // inside #if GTEST_HAS_PARAM_TEST.
10799 
10800 #if GTEST_HAS_PARAM_TEST
10801 
10802 namespace testing {
10803 
10804 // Forward declarations of ValuesIn(), which is implemented in
10805 // include/gtest/gtest-param-test.h.
10806 template <typename ForwardIterator>
10807 internal::ParamGenerator<
10808   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10809 ValuesIn(ForwardIterator begin, ForwardIterator end);
10810 
10811 template <typename T, size_t N>
10812 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10813 
10814 template <class Container>
10815 internal::ParamGenerator<typename Container::value_type> ValuesIn(
10816     const Container& container);
10817 
10818 namespace internal {
10819 
10820 // Used in the Values() function to provide polymorphic capabilities.
10821 template <typename T1>
10822 class ValueArray1 {
10823  public:
10824   explicit ValueArray1(T1 v1) : v1_(v1) {}
10825 
10826   template <typename T>
10827   operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10828 
10829  private:
10830   // No implementation - assignment is unsupported.
10831   void operator=(const ValueArray1& other);
10832 
10833   const T1 v1_;
10834 };
10835 
10836 template <typename T1, typename T2>
10837 class ValueArray2 {
10838  public:
10839   ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10840 
10841   template <typename T>
10842   operator ParamGenerator<T>() const {
10843     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10844     return ValuesIn(array);
10845   }
10846 
10847  private:
10848   // No implementation - assignment is unsupported.
10849   void operator=(const ValueArray2& other);
10850 
10851   const T1 v1_;
10852   const T2 v2_;
10853 };
10854 
10855 template <typename T1, typename T2, typename T3>
10856 class ValueArray3 {
10857  public:
10858   ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10859 
10860   template <typename T>
10861   operator ParamGenerator<T>() const {
10862     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10863         static_cast<T>(v3_)};
10864     return ValuesIn(array);
10865   }
10866 
10867  private:
10868   // No implementation - assignment is unsupported.
10869   void operator=(const ValueArray3& other);
10870 
10871   const T1 v1_;
10872   const T2 v2_;
10873   const T3 v3_;
10874 };
10875 
10876 template <typename T1, typename T2, typename T3, typename T4>
10877 class ValueArray4 {
10878  public:
10879   ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10880       v4_(v4) {}
10881 
10882   template <typename T>
10883   operator ParamGenerator<T>() const {
10884     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10885         static_cast<T>(v3_), static_cast<T>(v4_)};
10886     return ValuesIn(array);
10887   }
10888 
10889  private:
10890   // No implementation - assignment is unsupported.
10891   void operator=(const ValueArray4& other);
10892 
10893   const T1 v1_;
10894   const T2 v2_;
10895   const T3 v3_;
10896   const T4 v4_;
10897 };
10898 
10899 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10900 class ValueArray5 {
10901  public:
10902   ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10903       v4_(v4), v5_(v5) {}
10904 
10905   template <typename T>
10906   operator ParamGenerator<T>() const {
10907     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10908         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10909     return ValuesIn(array);
10910   }
10911 
10912  private:
10913   // No implementation - assignment is unsupported.
10914   void operator=(const ValueArray5& other);
10915 
10916   const T1 v1_;
10917   const T2 v2_;
10918   const T3 v3_;
10919   const T4 v4_;
10920   const T5 v5_;
10921 };
10922 
10923 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10924     typename T6>
10925 class ValueArray6 {
10926  public:
10927   ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10928       v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10929 
10930   template <typename T>
10931   operator ParamGenerator<T>() const {
10932     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10933         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10934         static_cast<T>(v6_)};
10935     return ValuesIn(array);
10936   }
10937 
10938  private:
10939   // No implementation - assignment is unsupported.
10940   void operator=(const ValueArray6& other);
10941 
10942   const T1 v1_;
10943   const T2 v2_;
10944   const T3 v3_;
10945   const T4 v4_;
10946   const T5 v5_;
10947   const T6 v6_;
10948 };
10949 
10950 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10951     typename T6, typename T7>
10952 class ValueArray7 {
10953  public:
10954   ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10955       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10956 
10957   template <typename T>
10958   operator ParamGenerator<T>() const {
10959     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10960         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10961         static_cast<T>(v6_), static_cast<T>(v7_)};
10962     return ValuesIn(array);
10963   }
10964 
10965  private:
10966   // No implementation - assignment is unsupported.
10967   void operator=(const ValueArray7& other);
10968 
10969   const T1 v1_;
10970   const T2 v2_;
10971   const T3 v3_;
10972   const T4 v4_;
10973   const T5 v5_;
10974   const T6 v6_;
10975   const T7 v7_;
10976 };
10977 
10978 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10979     typename T6, typename T7, typename T8>
10980 class ValueArray8 {
10981  public:
10982   ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10983       T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10984       v8_(v8) {}
10985 
10986   template <typename T>
10987   operator ParamGenerator<T>() const {
10988     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10989         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10990         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10991     return ValuesIn(array);
10992   }
10993 
10994  private:
10995   // No implementation - assignment is unsupported.
10996   void operator=(const ValueArray8& other);
10997 
10998   const T1 v1_;
10999   const T2 v2_;
11000   const T3 v3_;
11001   const T4 v4_;
11002   const T5 v5_;
11003   const T6 v6_;
11004   const T7 v7_;
11005   const T8 v8_;
11006 };
11007 
11008 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11009     typename T6, typename T7, typename T8, typename T9>
11010 class ValueArray9 {
11011  public:
11012   ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
11013       T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11014       v8_(v8), v9_(v9) {}
11015 
11016   template <typename T>
11017   operator ParamGenerator<T>() const {
11018     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11019         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11020         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11021         static_cast<T>(v9_)};
11022     return ValuesIn(array);
11023   }
11024 
11025  private:
11026   // No implementation - assignment is unsupported.
11027   void operator=(const ValueArray9& other);
11028 
11029   const T1 v1_;
11030   const T2 v2_;
11031   const T3 v3_;
11032   const T4 v4_;
11033   const T5 v5_;
11034   const T6 v6_;
11035   const T7 v7_;
11036   const T8 v8_;
11037   const T9 v9_;
11038 };
11039 
11040 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11041     typename T6, typename T7, typename T8, typename T9, typename T10>
11042 class ValueArray10 {
11043  public:
11044   ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11045       T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11046       v8_(v8), v9_(v9), v10_(v10) {}
11047 
11048   template <typename T>
11049   operator ParamGenerator<T>() const {
11050     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11051         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11052         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11053         static_cast<T>(v9_), static_cast<T>(v10_)};
11054     return ValuesIn(array);
11055   }
11056 
11057  private:
11058   // No implementation - assignment is unsupported.
11059   void operator=(const ValueArray10& other);
11060 
11061   const T1 v1_;
11062   const T2 v2_;
11063   const T3 v3_;
11064   const T4 v4_;
11065   const T5 v5_;
11066   const T6 v6_;
11067   const T7 v7_;
11068   const T8 v8_;
11069   const T9 v9_;
11070   const T10 v10_;
11071 };
11072 
11073 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11074     typename T6, typename T7, typename T8, typename T9, typename T10,
11075     typename T11>
11076 class ValueArray11 {
11077  public:
11078   ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11079       T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11080       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
11081 
11082   template <typename T>
11083   operator ParamGenerator<T>() const {
11084     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11085         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11086         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11087         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
11088     return ValuesIn(array);
11089   }
11090 
11091  private:
11092   // No implementation - assignment is unsupported.
11093   void operator=(const ValueArray11& other);
11094 
11095   const T1 v1_;
11096   const T2 v2_;
11097   const T3 v3_;
11098   const T4 v4_;
11099   const T5 v5_;
11100   const T6 v6_;
11101   const T7 v7_;
11102   const T8 v8_;
11103   const T9 v9_;
11104   const T10 v10_;
11105   const T11 v11_;
11106 };
11107 
11108 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11109     typename T6, typename T7, typename T8, typename T9, typename T10,
11110     typename T11, typename T12>
11111 class ValueArray12 {
11112  public:
11113   ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11114       T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11115       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
11116 
11117   template <typename T>
11118   operator ParamGenerator<T>() const {
11119     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11120         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11121         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11122         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11123         static_cast<T>(v12_)};
11124     return ValuesIn(array);
11125   }
11126 
11127  private:
11128   // No implementation - assignment is unsupported.
11129   void operator=(const ValueArray12& other);
11130 
11131   const T1 v1_;
11132   const T2 v2_;
11133   const T3 v3_;
11134   const T4 v4_;
11135   const T5 v5_;
11136   const T6 v6_;
11137   const T7 v7_;
11138   const T8 v8_;
11139   const T9 v9_;
11140   const T10 v10_;
11141   const T11 v11_;
11142   const T12 v12_;
11143 };
11144 
11145 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11146     typename T6, typename T7, typename T8, typename T9, typename T10,
11147     typename T11, typename T12, typename T13>
11148 class ValueArray13 {
11149  public:
11150   ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11151       T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11152       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11153       v12_(v12), v13_(v13) {}
11154 
11155   template <typename T>
11156   operator ParamGenerator<T>() const {
11157     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11158         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11159         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11160         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11161         static_cast<T>(v12_), static_cast<T>(v13_)};
11162     return ValuesIn(array);
11163   }
11164 
11165  private:
11166   // No implementation - assignment is unsupported.
11167   void operator=(const ValueArray13& other);
11168 
11169   const T1 v1_;
11170   const T2 v2_;
11171   const T3 v3_;
11172   const T4 v4_;
11173   const T5 v5_;
11174   const T6 v6_;
11175   const T7 v7_;
11176   const T8 v8_;
11177   const T9 v9_;
11178   const T10 v10_;
11179   const T11 v11_;
11180   const T12 v12_;
11181   const T13 v13_;
11182 };
11183 
11184 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11185     typename T6, typename T7, typename T8, typename T9, typename T10,
11186     typename T11, typename T12, typename T13, typename T14>
11187 class ValueArray14 {
11188  public:
11189   ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11190       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11191       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11192       v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
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     return ValuesIn(array);
11202   }
11203 
11204  private:
11205   // No implementation - assignment is unsupported.
11206   void operator=(const ValueArray14& other);
11207 
11208   const T1 v1_;
11209   const T2 v2_;
11210   const T3 v3_;
11211   const T4 v4_;
11212   const T5 v5_;
11213   const T6 v6_;
11214   const T7 v7_;
11215   const T8 v8_;
11216   const T9 v9_;
11217   const T10 v10_;
11218   const T11 v11_;
11219   const T12 v12_;
11220   const T13 v13_;
11221   const T14 v14_;
11222 };
11223 
11224 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11225     typename T6, typename T7, typename T8, typename T9, typename T10,
11226     typename T11, typename T12, typename T13, typename T14, typename T15>
11227 class ValueArray15 {
11228  public:
11229   ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11230       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11231       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11232       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11233 
11234   template <typename T>
11235   operator ParamGenerator<T>() const {
11236     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11237         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11238         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11239         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11240         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11241         static_cast<T>(v15_)};
11242     return ValuesIn(array);
11243   }
11244 
11245  private:
11246   // No implementation - assignment is unsupported.
11247   void operator=(const ValueArray15& other);
11248 
11249   const T1 v1_;
11250   const T2 v2_;
11251   const T3 v3_;
11252   const T4 v4_;
11253   const T5 v5_;
11254   const T6 v6_;
11255   const T7 v7_;
11256   const T8 v8_;
11257   const T9 v9_;
11258   const T10 v10_;
11259   const T11 v11_;
11260   const T12 v12_;
11261   const T13 v13_;
11262   const T14 v14_;
11263   const T15 v15_;
11264 };
11265 
11266 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11267     typename T6, typename T7, typename T8, typename T9, typename T10,
11268     typename T11, typename T12, typename T13, typename T14, typename T15,
11269     typename T16>
11270 class ValueArray16 {
11271  public:
11272   ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11273       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11274       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11275       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11276       v16_(v16) {}
11277 
11278   template <typename T>
11279   operator ParamGenerator<T>() const {
11280     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11281         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11282         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11283         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11284         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11285         static_cast<T>(v15_), static_cast<T>(v16_)};
11286     return ValuesIn(array);
11287   }
11288 
11289  private:
11290   // No implementation - assignment is unsupported.
11291   void operator=(const ValueArray16& other);
11292 
11293   const T1 v1_;
11294   const T2 v2_;
11295   const T3 v3_;
11296   const T4 v4_;
11297   const T5 v5_;
11298   const T6 v6_;
11299   const T7 v7_;
11300   const T8 v8_;
11301   const T9 v9_;
11302   const T10 v10_;
11303   const T11 v11_;
11304   const T12 v12_;
11305   const T13 v13_;
11306   const T14 v14_;
11307   const T15 v15_;
11308   const T16 v16_;
11309 };
11310 
11311 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11312     typename T6, typename T7, typename T8, typename T9, typename T10,
11313     typename T11, typename T12, typename T13, typename T14, typename T15,
11314     typename T16, typename T17>
11315 class ValueArray17 {
11316  public:
11317   ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11318       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11319       T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11320       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11321       v15_(v15), v16_(v16), v17_(v17) {}
11322 
11323   template <typename T>
11324   operator ParamGenerator<T>() const {
11325     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11326         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11327         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11328         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11329         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11330         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11331     return ValuesIn(array);
11332   }
11333 
11334  private:
11335   // No implementation - assignment is unsupported.
11336   void operator=(const ValueArray17& other);
11337 
11338   const T1 v1_;
11339   const T2 v2_;
11340   const T3 v3_;
11341   const T4 v4_;
11342   const T5 v5_;
11343   const T6 v6_;
11344   const T7 v7_;
11345   const T8 v8_;
11346   const T9 v9_;
11347   const T10 v10_;
11348   const T11 v11_;
11349   const T12 v12_;
11350   const T13 v13_;
11351   const T14 v14_;
11352   const T15 v15_;
11353   const T16 v16_;
11354   const T17 v17_;
11355 };
11356 
11357 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11358     typename T6, typename T7, typename T8, typename T9, typename T10,
11359     typename T11, typename T12, typename T13, typename T14, typename T15,
11360     typename T16, typename T17, typename T18>
11361 class ValueArray18 {
11362  public:
11363   ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11364       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11365       T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11366       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11367       v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11368 
11369   template <typename T>
11370   operator ParamGenerator<T>() const {
11371     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11372         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11373         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11374         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11375         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11376         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11377         static_cast<T>(v18_)};
11378     return ValuesIn(array);
11379   }
11380 
11381  private:
11382   // No implementation - assignment is unsupported.
11383   void operator=(const ValueArray18& other);
11384 
11385   const T1 v1_;
11386   const T2 v2_;
11387   const T3 v3_;
11388   const T4 v4_;
11389   const T5 v5_;
11390   const T6 v6_;
11391   const T7 v7_;
11392   const T8 v8_;
11393   const T9 v9_;
11394   const T10 v10_;
11395   const T11 v11_;
11396   const T12 v12_;
11397   const T13 v13_;
11398   const T14 v14_;
11399   const T15 v15_;
11400   const T16 v16_;
11401   const T17 v17_;
11402   const T18 v18_;
11403 };
11404 
11405 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11406     typename T6, typename T7, typename T8, typename T9, typename T10,
11407     typename T11, typename T12, typename T13, typename T14, typename T15,
11408     typename T16, typename T17, typename T18, typename T19>
11409 class ValueArray19 {
11410  public:
11411   ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11412       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11413       T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11414       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11415       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11416 
11417   template <typename T>
11418   operator ParamGenerator<T>() const {
11419     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11420         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11421         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11422         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11423         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11424         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11425         static_cast<T>(v18_), static_cast<T>(v19_)};
11426     return ValuesIn(array);
11427   }
11428 
11429  private:
11430   // No implementation - assignment is unsupported.
11431   void operator=(const ValueArray19& other);
11432 
11433   const T1 v1_;
11434   const T2 v2_;
11435   const T3 v3_;
11436   const T4 v4_;
11437   const T5 v5_;
11438   const T6 v6_;
11439   const T7 v7_;
11440   const T8 v8_;
11441   const T9 v9_;
11442   const T10 v10_;
11443   const T11 v11_;
11444   const T12 v12_;
11445   const T13 v13_;
11446   const T14 v14_;
11447   const T15 v15_;
11448   const T16 v16_;
11449   const T17 v17_;
11450   const T18 v18_;
11451   const T19 v19_;
11452 };
11453 
11454 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11455     typename T6, typename T7, typename T8, typename T9, typename T10,
11456     typename T11, typename T12, typename T13, typename T14, typename T15,
11457     typename T16, typename T17, typename T18, typename T19, typename T20>
11458 class ValueArray20 {
11459  public:
11460   ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11461       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11462       T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11463       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11464       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11465       v19_(v19), v20_(v20) {}
11466 
11467   template <typename T>
11468   operator ParamGenerator<T>() const {
11469     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11470         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11471         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11472         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11473         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11474         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11475         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11476     return ValuesIn(array);
11477   }
11478 
11479  private:
11480   // No implementation - assignment is unsupported.
11481   void operator=(const ValueArray20& other);
11482 
11483   const T1 v1_;
11484   const T2 v2_;
11485   const T3 v3_;
11486   const T4 v4_;
11487   const T5 v5_;
11488   const T6 v6_;
11489   const T7 v7_;
11490   const T8 v8_;
11491   const T9 v9_;
11492   const T10 v10_;
11493   const T11 v11_;
11494   const T12 v12_;
11495   const T13 v13_;
11496   const T14 v14_;
11497   const T15 v15_;
11498   const T16 v16_;
11499   const T17 v17_;
11500   const T18 v18_;
11501   const T19 v19_;
11502   const T20 v20_;
11503 };
11504 
11505 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11506     typename T6, typename T7, typename T8, typename T9, typename T10,
11507     typename T11, typename T12, typename T13, typename T14, typename T15,
11508     typename T16, typename T17, typename T18, typename T19, typename T20,
11509     typename T21>
11510 class ValueArray21 {
11511  public:
11512   ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11513       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11514       T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11515       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11516       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11517       v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11518 
11519   template <typename T>
11520   operator ParamGenerator<T>() const {
11521     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11522         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11523         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11524         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11525         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11526         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11527         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11528         static_cast<T>(v21_)};
11529     return ValuesIn(array);
11530   }
11531 
11532  private:
11533   // No implementation - assignment is unsupported.
11534   void operator=(const ValueArray21& other);
11535 
11536   const T1 v1_;
11537   const T2 v2_;
11538   const T3 v3_;
11539   const T4 v4_;
11540   const T5 v5_;
11541   const T6 v6_;
11542   const T7 v7_;
11543   const T8 v8_;
11544   const T9 v9_;
11545   const T10 v10_;
11546   const T11 v11_;
11547   const T12 v12_;
11548   const T13 v13_;
11549   const T14 v14_;
11550   const T15 v15_;
11551   const T16 v16_;
11552   const T17 v17_;
11553   const T18 v18_;
11554   const T19 v19_;
11555   const T20 v20_;
11556   const T21 v21_;
11557 };
11558 
11559 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11560     typename T6, typename T7, typename T8, typename T9, typename T10,
11561     typename T11, typename T12, typename T13, typename T14, typename T15,
11562     typename T16, typename T17, typename T18, typename T19, typename T20,
11563     typename T21, typename T22>
11564 class ValueArray22 {
11565  public:
11566   ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11567       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11568       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11569       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11570       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11571       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11572 
11573   template <typename T>
11574   operator ParamGenerator<T>() const {
11575     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11576         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11577         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11578         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11579         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11580         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11581         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11582         static_cast<T>(v21_), static_cast<T>(v22_)};
11583     return ValuesIn(array);
11584   }
11585 
11586  private:
11587   // No implementation - assignment is unsupported.
11588   void operator=(const ValueArray22& other);
11589 
11590   const T1 v1_;
11591   const T2 v2_;
11592   const T3 v3_;
11593   const T4 v4_;
11594   const T5 v5_;
11595   const T6 v6_;
11596   const T7 v7_;
11597   const T8 v8_;
11598   const T9 v9_;
11599   const T10 v10_;
11600   const T11 v11_;
11601   const T12 v12_;
11602   const T13 v13_;
11603   const T14 v14_;
11604   const T15 v15_;
11605   const T16 v16_;
11606   const T17 v17_;
11607   const T18 v18_;
11608   const T19 v19_;
11609   const T20 v20_;
11610   const T21 v21_;
11611   const T22 v22_;
11612 };
11613 
11614 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11615     typename T6, typename T7, typename T8, typename T9, typename T10,
11616     typename T11, typename T12, typename T13, typename T14, typename T15,
11617     typename T16, typename T17, typename T18, typename T19, typename T20,
11618     typename T21, typename T22, typename T23>
11619 class ValueArray23 {
11620  public:
11621   ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11622       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11623       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11624       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11625       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11626       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11627       v23_(v23) {}
11628 
11629   template <typename T>
11630   operator ParamGenerator<T>() const {
11631     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11632         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11633         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11634         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11635         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11636         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11637         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11638         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11639     return ValuesIn(array);
11640   }
11641 
11642  private:
11643   // No implementation - assignment is unsupported.
11644   void operator=(const ValueArray23& other);
11645 
11646   const T1 v1_;
11647   const T2 v2_;
11648   const T3 v3_;
11649   const T4 v4_;
11650   const T5 v5_;
11651   const T6 v6_;
11652   const T7 v7_;
11653   const T8 v8_;
11654   const T9 v9_;
11655   const T10 v10_;
11656   const T11 v11_;
11657   const T12 v12_;
11658   const T13 v13_;
11659   const T14 v14_;
11660   const T15 v15_;
11661   const T16 v16_;
11662   const T17 v17_;
11663   const T18 v18_;
11664   const T19 v19_;
11665   const T20 v20_;
11666   const T21 v21_;
11667   const T22 v22_;
11668   const T23 v23_;
11669 };
11670 
11671 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11672     typename T6, typename T7, typename T8, typename T9, typename T10,
11673     typename T11, typename T12, typename T13, typename T14, typename T15,
11674     typename T16, typename T17, typename T18, typename T19, typename T20,
11675     typename T21, typename T22, typename T23, typename T24>
11676 class ValueArray24 {
11677  public:
11678   ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11679       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11680       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11681       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11682       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11683       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11684       v22_(v22), v23_(v23), v24_(v24) {}
11685 
11686   template <typename T>
11687   operator ParamGenerator<T>() const {
11688     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11689         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11690         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11691         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11692         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11693         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11694         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11695         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11696         static_cast<T>(v24_)};
11697     return ValuesIn(array);
11698   }
11699 
11700  private:
11701   // No implementation - assignment is unsupported.
11702   void operator=(const ValueArray24& other);
11703 
11704   const T1 v1_;
11705   const T2 v2_;
11706   const T3 v3_;
11707   const T4 v4_;
11708   const T5 v5_;
11709   const T6 v6_;
11710   const T7 v7_;
11711   const T8 v8_;
11712   const T9 v9_;
11713   const T10 v10_;
11714   const T11 v11_;
11715   const T12 v12_;
11716   const T13 v13_;
11717   const T14 v14_;
11718   const T15 v15_;
11719   const T16 v16_;
11720   const T17 v17_;
11721   const T18 v18_;
11722   const T19 v19_;
11723   const T20 v20_;
11724   const T21 v21_;
11725   const T22 v22_;
11726   const T23 v23_;
11727   const T24 v24_;
11728 };
11729 
11730 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11731     typename T6, typename T7, typename T8, typename T9, typename T10,
11732     typename T11, typename T12, typename T13, typename T14, typename T15,
11733     typename T16, typename T17, typename T18, typename T19, typename T20,
11734     typename T21, typename T22, typename T23, typename T24, typename T25>
11735 class ValueArray25 {
11736  public:
11737   ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11738       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11739       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11740       T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11741       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11742       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11743       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11744 
11745   template <typename T>
11746   operator ParamGenerator<T>() const {
11747     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11748         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11749         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11750         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11751         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11752         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11753         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11754         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11755         static_cast<T>(v24_), static_cast<T>(v25_)};
11756     return ValuesIn(array);
11757   }
11758 
11759  private:
11760   // No implementation - assignment is unsupported.
11761   void operator=(const ValueArray25& other);
11762 
11763   const T1 v1_;
11764   const T2 v2_;
11765   const T3 v3_;
11766   const T4 v4_;
11767   const T5 v5_;
11768   const T6 v6_;
11769   const T7 v7_;
11770   const T8 v8_;
11771   const T9 v9_;
11772   const T10 v10_;
11773   const T11 v11_;
11774   const T12 v12_;
11775   const T13 v13_;
11776   const T14 v14_;
11777   const T15 v15_;
11778   const T16 v16_;
11779   const T17 v17_;
11780   const T18 v18_;
11781   const T19 v19_;
11782   const T20 v20_;
11783   const T21 v21_;
11784   const T22 v22_;
11785   const T23 v23_;
11786   const T24 v24_;
11787   const T25 v25_;
11788 };
11789 
11790 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11791     typename T6, typename T7, typename T8, typename T9, typename T10,
11792     typename T11, typename T12, typename T13, typename T14, typename T15,
11793     typename T16, typename T17, typename T18, typename T19, typename T20,
11794     typename T21, typename T22, typename T23, typename T24, typename T25,
11795     typename T26>
11796 class ValueArray26 {
11797  public:
11798   ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11799       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11800       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11801       T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11802       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11803       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11804       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11805 
11806   template <typename T>
11807   operator ParamGenerator<T>() const {
11808     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11809         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11810         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11811         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11812         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11813         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11814         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11815         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11816         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11817     return ValuesIn(array);
11818   }
11819 
11820  private:
11821   // No implementation - assignment is unsupported.
11822   void operator=(const ValueArray26& 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 };
11851 
11852 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11853     typename T6, typename T7, typename T8, typename T9, typename T10,
11854     typename T11, typename T12, typename T13, typename T14, typename T15,
11855     typename T16, typename T17, typename T18, typename T19, typename T20,
11856     typename T21, typename T22, typename T23, typename T24, typename T25,
11857     typename T26, typename T27>
11858 class ValueArray27 {
11859  public:
11860   ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11861       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11862       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11863       T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11864       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11865       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11866       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11867       v26_(v26), v27_(v27) {}
11868 
11869   template <typename T>
11870   operator ParamGenerator<T>() const {
11871     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11872         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11873         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11874         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11875         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11876         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11877         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11878         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11879         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11880         static_cast<T>(v27_)};
11881     return ValuesIn(array);
11882   }
11883 
11884  private:
11885   // No implementation - assignment is unsupported.
11886   void operator=(const ValueArray27& other);
11887 
11888   const T1 v1_;
11889   const T2 v2_;
11890   const T3 v3_;
11891   const T4 v4_;
11892   const T5 v5_;
11893   const T6 v6_;
11894   const T7 v7_;
11895   const T8 v8_;
11896   const T9 v9_;
11897   const T10 v10_;
11898   const T11 v11_;
11899   const T12 v12_;
11900   const T13 v13_;
11901   const T14 v14_;
11902   const T15 v15_;
11903   const T16 v16_;
11904   const T17 v17_;
11905   const T18 v18_;
11906   const T19 v19_;
11907   const T20 v20_;
11908   const T21 v21_;
11909   const T22 v22_;
11910   const T23 v23_;
11911   const T24 v24_;
11912   const T25 v25_;
11913   const T26 v26_;
11914   const T27 v27_;
11915 };
11916 
11917 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11918     typename T6, typename T7, typename T8, typename T9, typename T10,
11919     typename T11, typename T12, typename T13, typename T14, typename T15,
11920     typename T16, typename T17, typename T18, typename T19, typename T20,
11921     typename T21, typename T22, typename T23, typename T24, typename T25,
11922     typename T26, typename T27, typename T28>
11923 class ValueArray28 {
11924  public:
11925   ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11926       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11927       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11928       T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11929       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11930       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11931       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11932       v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11933 
11934   template <typename T>
11935   operator ParamGenerator<T>() const {
11936     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11937         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11938         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11939         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11940         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11941         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11942         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11943         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11944         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11945         static_cast<T>(v27_), static_cast<T>(v28_)};
11946     return ValuesIn(array);
11947   }
11948 
11949  private:
11950   // No implementation - assignment is unsupported.
11951   void operator=(const ValueArray28& other);
11952 
11953   const T1 v1_;
11954   const T2 v2_;
11955   const T3 v3_;
11956   const T4 v4_;
11957   const T5 v5_;
11958   const T6 v6_;
11959   const T7 v7_;
11960   const T8 v8_;
11961   const T9 v9_;
11962   const T10 v10_;
11963   const T11 v11_;
11964   const T12 v12_;
11965   const T13 v13_;
11966   const T14 v14_;
11967   const T15 v15_;
11968   const T16 v16_;
11969   const T17 v17_;
11970   const T18 v18_;
11971   const T19 v19_;
11972   const T20 v20_;
11973   const T21 v21_;
11974   const T22 v22_;
11975   const T23 v23_;
11976   const T24 v24_;
11977   const T25 v25_;
11978   const T26 v26_;
11979   const T27 v27_;
11980   const T28 v28_;
11981 };
11982 
11983 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11984     typename T6, typename T7, typename T8, typename T9, typename T10,
11985     typename T11, typename T12, typename T13, typename T14, typename T15,
11986     typename T16, typename T17, typename T18, typename T19, typename T20,
11987     typename T21, typename T22, typename T23, typename T24, typename T25,
11988     typename T26, typename T27, typename T28, typename T29>
11989 class ValueArray29 {
11990  public:
11991   ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11992       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11993       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11994       T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11995       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11996       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11997       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11998       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11999 
12000   template <typename T>
12001   operator ParamGenerator<T>() const {
12002     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12003         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12004         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12005         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12006         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12007         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12008         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12009         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12010         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12011         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
12012     return ValuesIn(array);
12013   }
12014 
12015  private:
12016   // No implementation - assignment is unsupported.
12017   void operator=(const ValueArray29& other);
12018 
12019   const T1 v1_;
12020   const T2 v2_;
12021   const T3 v3_;
12022   const T4 v4_;
12023   const T5 v5_;
12024   const T6 v6_;
12025   const T7 v7_;
12026   const T8 v8_;
12027   const T9 v9_;
12028   const T10 v10_;
12029   const T11 v11_;
12030   const T12 v12_;
12031   const T13 v13_;
12032   const T14 v14_;
12033   const T15 v15_;
12034   const T16 v16_;
12035   const T17 v17_;
12036   const T18 v18_;
12037   const T19 v19_;
12038   const T20 v20_;
12039   const T21 v21_;
12040   const T22 v22_;
12041   const T23 v23_;
12042   const T24 v24_;
12043   const T25 v25_;
12044   const T26 v26_;
12045   const T27 v27_;
12046   const T28 v28_;
12047   const T29 v29_;
12048 };
12049 
12050 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12051     typename T6, typename T7, typename T8, typename T9, typename T10,
12052     typename T11, typename T12, typename T13, typename T14, typename T15,
12053     typename T16, typename T17, typename T18, typename T19, typename T20,
12054     typename T21, typename T22, typename T23, typename T24, typename T25,
12055     typename T26, typename T27, typename T28, typename T29, typename T30>
12056 class ValueArray30 {
12057  public:
12058   ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12059       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12060       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12061       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
12062       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12063       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12064       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12065       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12066       v29_(v29), v30_(v30) {}
12067 
12068   template <typename T>
12069   operator ParamGenerator<T>() const {
12070     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12071         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12072         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12073         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12074         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12075         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12076         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12077         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12078         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12079         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12080         static_cast<T>(v30_)};
12081     return ValuesIn(array);
12082   }
12083 
12084  private:
12085   // No implementation - assignment is unsupported.
12086   void operator=(const ValueArray30& other);
12087 
12088   const T1 v1_;
12089   const T2 v2_;
12090   const T3 v3_;
12091   const T4 v4_;
12092   const T5 v5_;
12093   const T6 v6_;
12094   const T7 v7_;
12095   const T8 v8_;
12096   const T9 v9_;
12097   const T10 v10_;
12098   const T11 v11_;
12099   const T12 v12_;
12100   const T13 v13_;
12101   const T14 v14_;
12102   const T15 v15_;
12103   const T16 v16_;
12104   const T17 v17_;
12105   const T18 v18_;
12106   const T19 v19_;
12107   const T20 v20_;
12108   const T21 v21_;
12109   const T22 v22_;
12110   const T23 v23_;
12111   const T24 v24_;
12112   const T25 v25_;
12113   const T26 v26_;
12114   const T27 v27_;
12115   const T28 v28_;
12116   const T29 v29_;
12117   const T30 v30_;
12118 };
12119 
12120 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12121     typename T6, typename T7, typename T8, typename T9, typename T10,
12122     typename T11, typename T12, typename T13, typename T14, typename T15,
12123     typename T16, typename T17, typename T18, typename T19, typename T20,
12124     typename T21, typename T22, typename T23, typename T24, typename T25,
12125     typename T26, typename T27, typename T28, typename T29, typename T30,
12126     typename T31>
12127 class ValueArray31 {
12128  public:
12129   ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12130       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12131       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12132       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12133       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12134       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12135       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12136       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12137       v29_(v29), v30_(v30), v31_(v31) {}
12138 
12139   template <typename T>
12140   operator ParamGenerator<T>() const {
12141     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12142         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12143         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12144         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12145         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12146         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12147         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12148         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12149         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12150         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12151         static_cast<T>(v30_), static_cast<T>(v31_)};
12152     return ValuesIn(array);
12153   }
12154 
12155  private:
12156   // No implementation - assignment is unsupported.
12157   void operator=(const ValueArray31& other);
12158 
12159   const T1 v1_;
12160   const T2 v2_;
12161   const T3 v3_;
12162   const T4 v4_;
12163   const T5 v5_;
12164   const T6 v6_;
12165   const T7 v7_;
12166   const T8 v8_;
12167   const T9 v9_;
12168   const T10 v10_;
12169   const T11 v11_;
12170   const T12 v12_;
12171   const T13 v13_;
12172   const T14 v14_;
12173   const T15 v15_;
12174   const T16 v16_;
12175   const T17 v17_;
12176   const T18 v18_;
12177   const T19 v19_;
12178   const T20 v20_;
12179   const T21 v21_;
12180   const T22 v22_;
12181   const T23 v23_;
12182   const T24 v24_;
12183   const T25 v25_;
12184   const T26 v26_;
12185   const T27 v27_;
12186   const T28 v28_;
12187   const T29 v29_;
12188   const T30 v30_;
12189   const T31 v31_;
12190 };
12191 
12192 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12193     typename T6, typename T7, typename T8, typename T9, typename T10,
12194     typename T11, typename T12, typename T13, typename T14, typename T15,
12195     typename T16, typename T17, typename T18, typename T19, typename T20,
12196     typename T21, typename T22, typename T23, typename T24, typename T25,
12197     typename T26, typename T27, typename T28, typename T29, typename T30,
12198     typename T31, typename T32>
12199 class ValueArray32 {
12200  public:
12201   ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12202       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12203       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12204       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12205       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12206       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12207       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12208       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12209       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12210 
12211   template <typename T>
12212   operator ParamGenerator<T>() const {
12213     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12214         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12215         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12216         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12217         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12218         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12219         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12220         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12221         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12222         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12223         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12224     return ValuesIn(array);
12225   }
12226 
12227  private:
12228   // No implementation - assignment is unsupported.
12229   void operator=(const ValueArray32& other);
12230 
12231   const T1 v1_;
12232   const T2 v2_;
12233   const T3 v3_;
12234   const T4 v4_;
12235   const T5 v5_;
12236   const T6 v6_;
12237   const T7 v7_;
12238   const T8 v8_;
12239   const T9 v9_;
12240   const T10 v10_;
12241   const T11 v11_;
12242   const T12 v12_;
12243   const T13 v13_;
12244   const T14 v14_;
12245   const T15 v15_;
12246   const T16 v16_;
12247   const T17 v17_;
12248   const T18 v18_;
12249   const T19 v19_;
12250   const T20 v20_;
12251   const T21 v21_;
12252   const T22 v22_;
12253   const T23 v23_;
12254   const T24 v24_;
12255   const T25 v25_;
12256   const T26 v26_;
12257   const T27 v27_;
12258   const T28 v28_;
12259   const T29 v29_;
12260   const T30 v30_;
12261   const T31 v31_;
12262   const T32 v32_;
12263 };
12264 
12265 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12266     typename T6, typename T7, typename T8, typename T9, typename T10,
12267     typename T11, typename T12, typename T13, typename T14, typename T15,
12268     typename T16, typename T17, typename T18, typename T19, typename T20,
12269     typename T21, typename T22, typename T23, typename T24, typename T25,
12270     typename T26, typename T27, typename T28, typename T29, typename T30,
12271     typename T31, typename T32, typename T33>
12272 class ValueArray33 {
12273  public:
12274   ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12275       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12276       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12277       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12278       T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12279       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12280       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12281       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12282       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12283       v33_(v33) {}
12284 
12285   template <typename T>
12286   operator ParamGenerator<T>() const {
12287     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12288         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12289         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12290         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12291         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12292         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12293         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12294         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12295         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12296         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12297         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12298         static_cast<T>(v33_)};
12299     return ValuesIn(array);
12300   }
12301 
12302  private:
12303   // No implementation - assignment is unsupported.
12304   void operator=(const ValueArray33& other);
12305 
12306   const T1 v1_;
12307   const T2 v2_;
12308   const T3 v3_;
12309   const T4 v4_;
12310   const T5 v5_;
12311   const T6 v6_;
12312   const T7 v7_;
12313   const T8 v8_;
12314   const T9 v9_;
12315   const T10 v10_;
12316   const T11 v11_;
12317   const T12 v12_;
12318   const T13 v13_;
12319   const T14 v14_;
12320   const T15 v15_;
12321   const T16 v16_;
12322   const T17 v17_;
12323   const T18 v18_;
12324   const T19 v19_;
12325   const T20 v20_;
12326   const T21 v21_;
12327   const T22 v22_;
12328   const T23 v23_;
12329   const T24 v24_;
12330   const T25 v25_;
12331   const T26 v26_;
12332   const T27 v27_;
12333   const T28 v28_;
12334   const T29 v29_;
12335   const T30 v30_;
12336   const T31 v31_;
12337   const T32 v32_;
12338   const T33 v33_;
12339 };
12340 
12341 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12342     typename T6, typename T7, typename T8, typename T9, typename T10,
12343     typename T11, typename T12, typename T13, typename T14, typename T15,
12344     typename T16, typename T17, typename T18, typename T19, typename T20,
12345     typename T21, typename T22, typename T23, typename T24, typename T25,
12346     typename T26, typename T27, typename T28, typename T29, typename T30,
12347     typename T31, typename T32, typename T33, typename T34>
12348 class ValueArray34 {
12349  public:
12350   ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12351       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12352       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12353       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12354       T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12355       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12356       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12357       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12358       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12359       v33_(v33), v34_(v34) {}
12360 
12361   template <typename T>
12362   operator ParamGenerator<T>() const {
12363     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12364         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12365         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12366         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12367         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12368         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12369         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12370         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12371         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12372         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12373         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12374         static_cast<T>(v33_), static_cast<T>(v34_)};
12375     return ValuesIn(array);
12376   }
12377 
12378  private:
12379   // No implementation - assignment is unsupported.
12380   void operator=(const ValueArray34& other);
12381 
12382   const T1 v1_;
12383   const T2 v2_;
12384   const T3 v3_;
12385   const T4 v4_;
12386   const T5 v5_;
12387   const T6 v6_;
12388   const T7 v7_;
12389   const T8 v8_;
12390   const T9 v9_;
12391   const T10 v10_;
12392   const T11 v11_;
12393   const T12 v12_;
12394   const T13 v13_;
12395   const T14 v14_;
12396   const T15 v15_;
12397   const T16 v16_;
12398   const T17 v17_;
12399   const T18 v18_;
12400   const T19 v19_;
12401   const T20 v20_;
12402   const T21 v21_;
12403   const T22 v22_;
12404   const T23 v23_;
12405   const T24 v24_;
12406   const T25 v25_;
12407   const T26 v26_;
12408   const T27 v27_;
12409   const T28 v28_;
12410   const T29 v29_;
12411   const T30 v30_;
12412   const T31 v31_;
12413   const T32 v32_;
12414   const T33 v33_;
12415   const T34 v34_;
12416 };
12417 
12418 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12419     typename T6, typename T7, typename T8, typename T9, typename T10,
12420     typename T11, typename T12, typename T13, typename T14, typename T15,
12421     typename T16, typename T17, typename T18, typename T19, typename T20,
12422     typename T21, typename T22, typename T23, typename T24, typename T25,
12423     typename T26, typename T27, typename T28, typename T29, typename T30,
12424     typename T31, typename T32, typename T33, typename T34, typename T35>
12425 class ValueArray35 {
12426  public:
12427   ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12428       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12429       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12430       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12431       T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12432       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12433       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12434       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12435       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12436       v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12437 
12438   template <typename T>
12439   operator ParamGenerator<T>() const {
12440     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12441         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12442         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12443         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12444         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12445         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12446         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12447         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12448         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12449         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12450         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12451         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12452     return ValuesIn(array);
12453   }
12454 
12455  private:
12456   // No implementation - assignment is unsupported.
12457   void operator=(const ValueArray35& other);
12458 
12459   const T1 v1_;
12460   const T2 v2_;
12461   const T3 v3_;
12462   const T4 v4_;
12463   const T5 v5_;
12464   const T6 v6_;
12465   const T7 v7_;
12466   const T8 v8_;
12467   const T9 v9_;
12468   const T10 v10_;
12469   const T11 v11_;
12470   const T12 v12_;
12471   const T13 v13_;
12472   const T14 v14_;
12473   const T15 v15_;
12474   const T16 v16_;
12475   const T17 v17_;
12476   const T18 v18_;
12477   const T19 v19_;
12478   const T20 v20_;
12479   const T21 v21_;
12480   const T22 v22_;
12481   const T23 v23_;
12482   const T24 v24_;
12483   const T25 v25_;
12484   const T26 v26_;
12485   const T27 v27_;
12486   const T28 v28_;
12487   const T29 v29_;
12488   const T30 v30_;
12489   const T31 v31_;
12490   const T32 v32_;
12491   const T33 v33_;
12492   const T34 v34_;
12493   const T35 v35_;
12494 };
12495 
12496 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12497     typename T6, typename T7, typename T8, typename T9, typename T10,
12498     typename T11, typename T12, typename T13, typename T14, typename T15,
12499     typename T16, typename T17, typename T18, typename T19, typename T20,
12500     typename T21, typename T22, typename T23, typename T24, typename T25,
12501     typename T26, typename T27, typename T28, typename T29, typename T30,
12502     typename T31, typename T32, typename T33, typename T34, typename T35,
12503     typename T36>
12504 class ValueArray36 {
12505  public:
12506   ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12507       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12508       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12509       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12510       T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12511       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12512       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12513       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12514       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12515       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12516 
12517   template <typename T>
12518   operator ParamGenerator<T>() const {
12519     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12520         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12521         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12522         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12523         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12524         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12525         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12526         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12527         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12528         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12529         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12530         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12531         static_cast<T>(v36_)};
12532     return ValuesIn(array);
12533   }
12534 
12535  private:
12536   // No implementation - assignment is unsupported.
12537   void operator=(const ValueArray36& other);
12538 
12539   const T1 v1_;
12540   const T2 v2_;
12541   const T3 v3_;
12542   const T4 v4_;
12543   const T5 v5_;
12544   const T6 v6_;
12545   const T7 v7_;
12546   const T8 v8_;
12547   const T9 v9_;
12548   const T10 v10_;
12549   const T11 v11_;
12550   const T12 v12_;
12551   const T13 v13_;
12552   const T14 v14_;
12553   const T15 v15_;
12554   const T16 v16_;
12555   const T17 v17_;
12556   const T18 v18_;
12557   const T19 v19_;
12558   const T20 v20_;
12559   const T21 v21_;
12560   const T22 v22_;
12561   const T23 v23_;
12562   const T24 v24_;
12563   const T25 v25_;
12564   const T26 v26_;
12565   const T27 v27_;
12566   const T28 v28_;
12567   const T29 v29_;
12568   const T30 v30_;
12569   const T31 v31_;
12570   const T32 v32_;
12571   const T33 v33_;
12572   const T34 v34_;
12573   const T35 v35_;
12574   const T36 v36_;
12575 };
12576 
12577 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12578     typename T6, typename T7, typename T8, typename T9, typename T10,
12579     typename T11, typename T12, typename T13, typename T14, typename T15,
12580     typename T16, typename T17, typename T18, typename T19, typename T20,
12581     typename T21, typename T22, typename T23, typename T24, typename T25,
12582     typename T26, typename T27, typename T28, typename T29, typename T30,
12583     typename T31, typename T32, typename T33, typename T34, typename T35,
12584     typename T36, typename T37>
12585 class ValueArray37 {
12586  public:
12587   ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12588       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12589       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12590       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12591       T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12592       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12593       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12594       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12595       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12596       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12597       v36_(v36), v37_(v37) {}
12598 
12599   template <typename T>
12600   operator ParamGenerator<T>() const {
12601     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12602         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12603         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12604         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12605         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12606         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12607         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12608         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12609         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12610         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12611         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12612         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12613         static_cast<T>(v36_), static_cast<T>(v37_)};
12614     return ValuesIn(array);
12615   }
12616 
12617  private:
12618   // No implementation - assignment is unsupported.
12619   void operator=(const ValueArray37& other);
12620 
12621   const T1 v1_;
12622   const T2 v2_;
12623   const T3 v3_;
12624   const T4 v4_;
12625   const T5 v5_;
12626   const T6 v6_;
12627   const T7 v7_;
12628   const T8 v8_;
12629   const T9 v9_;
12630   const T10 v10_;
12631   const T11 v11_;
12632   const T12 v12_;
12633   const T13 v13_;
12634   const T14 v14_;
12635   const T15 v15_;
12636   const T16 v16_;
12637   const T17 v17_;
12638   const T18 v18_;
12639   const T19 v19_;
12640   const T20 v20_;
12641   const T21 v21_;
12642   const T22 v22_;
12643   const T23 v23_;
12644   const T24 v24_;
12645   const T25 v25_;
12646   const T26 v26_;
12647   const T27 v27_;
12648   const T28 v28_;
12649   const T29 v29_;
12650   const T30 v30_;
12651   const T31 v31_;
12652   const T32 v32_;
12653   const T33 v33_;
12654   const T34 v34_;
12655   const T35 v35_;
12656   const T36 v36_;
12657   const T37 v37_;
12658 };
12659 
12660 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12661     typename T6, typename T7, typename T8, typename T9, typename T10,
12662     typename T11, typename T12, typename T13, typename T14, typename T15,
12663     typename T16, typename T17, typename T18, typename T19, typename T20,
12664     typename T21, typename T22, typename T23, typename T24, typename T25,
12665     typename T26, typename T27, typename T28, typename T29, typename T30,
12666     typename T31, typename T32, typename T33, typename T34, typename T35,
12667     typename T36, typename T37, typename T38>
12668 class ValueArray38 {
12669  public:
12670   ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12671       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12672       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12673       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12674       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12675       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12676       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12677       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12678       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12679       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12680       v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12681 
12682   template <typename T>
12683   operator ParamGenerator<T>() const {
12684     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12685         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12686         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12687         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12688         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12689         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12690         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12691         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12692         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12693         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12694         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12695         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12696         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12697     return ValuesIn(array);
12698   }
12699 
12700  private:
12701   // No implementation - assignment is unsupported.
12702   void operator=(const ValueArray38& other);
12703 
12704   const T1 v1_;
12705   const T2 v2_;
12706   const T3 v3_;
12707   const T4 v4_;
12708   const T5 v5_;
12709   const T6 v6_;
12710   const T7 v7_;
12711   const T8 v8_;
12712   const T9 v9_;
12713   const T10 v10_;
12714   const T11 v11_;
12715   const T12 v12_;
12716   const T13 v13_;
12717   const T14 v14_;
12718   const T15 v15_;
12719   const T16 v16_;
12720   const T17 v17_;
12721   const T18 v18_;
12722   const T19 v19_;
12723   const T20 v20_;
12724   const T21 v21_;
12725   const T22 v22_;
12726   const T23 v23_;
12727   const T24 v24_;
12728   const T25 v25_;
12729   const T26 v26_;
12730   const T27 v27_;
12731   const T28 v28_;
12732   const T29 v29_;
12733   const T30 v30_;
12734   const T31 v31_;
12735   const T32 v32_;
12736   const T33 v33_;
12737   const T34 v34_;
12738   const T35 v35_;
12739   const T36 v36_;
12740   const T37 v37_;
12741   const T38 v38_;
12742 };
12743 
12744 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12745     typename T6, typename T7, typename T8, typename T9, typename T10,
12746     typename T11, typename T12, typename T13, typename T14, typename T15,
12747     typename T16, typename T17, typename T18, typename T19, typename T20,
12748     typename T21, typename T22, typename T23, typename T24, typename T25,
12749     typename T26, typename T27, typename T28, typename T29, typename T30,
12750     typename T31, typename T32, typename T33, typename T34, typename T35,
12751     typename T36, typename T37, typename T38, typename T39>
12752 class ValueArray39 {
12753  public:
12754   ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12755       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12756       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12757       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12758       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12759       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12760       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12761       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12762       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12763       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12764       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12765 
12766   template <typename T>
12767   operator ParamGenerator<T>() const {
12768     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12769         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12770         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12771         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12772         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12773         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12774         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12775         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12776         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12777         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12778         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12779         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12780         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12781         static_cast<T>(v39_)};
12782     return ValuesIn(array);
12783   }
12784 
12785  private:
12786   // No implementation - assignment is unsupported.
12787   void operator=(const ValueArray39& other);
12788 
12789   const T1 v1_;
12790   const T2 v2_;
12791   const T3 v3_;
12792   const T4 v4_;
12793   const T5 v5_;
12794   const T6 v6_;
12795   const T7 v7_;
12796   const T8 v8_;
12797   const T9 v9_;
12798   const T10 v10_;
12799   const T11 v11_;
12800   const T12 v12_;
12801   const T13 v13_;
12802   const T14 v14_;
12803   const T15 v15_;
12804   const T16 v16_;
12805   const T17 v17_;
12806   const T18 v18_;
12807   const T19 v19_;
12808   const T20 v20_;
12809   const T21 v21_;
12810   const T22 v22_;
12811   const T23 v23_;
12812   const T24 v24_;
12813   const T25 v25_;
12814   const T26 v26_;
12815   const T27 v27_;
12816   const T28 v28_;
12817   const T29 v29_;
12818   const T30 v30_;
12819   const T31 v31_;
12820   const T32 v32_;
12821   const T33 v33_;
12822   const T34 v34_;
12823   const T35 v35_;
12824   const T36 v36_;
12825   const T37 v37_;
12826   const T38 v38_;
12827   const T39 v39_;
12828 };
12829 
12830 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12831     typename T6, typename T7, typename T8, typename T9, typename T10,
12832     typename T11, typename T12, typename T13, typename T14, typename T15,
12833     typename T16, typename T17, typename T18, typename T19, typename T20,
12834     typename T21, typename T22, typename T23, typename T24, typename T25,
12835     typename T26, typename T27, typename T28, typename T29, typename T30,
12836     typename T31, typename T32, typename T33, typename T34, typename T35,
12837     typename T36, typename T37, typename T38, typename T39, typename T40>
12838 class ValueArray40 {
12839  public:
12840   ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12841       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12842       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12843       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12844       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12845       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12846       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12847       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12848       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12849       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12850       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12851       v40_(v40) {}
12852 
12853   template <typename T>
12854   operator ParamGenerator<T>() const {
12855     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12856         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12857         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12858         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12859         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12860         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12861         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12862         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12863         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12864         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12865         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12866         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12867         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12868         static_cast<T>(v39_), static_cast<T>(v40_)};
12869     return ValuesIn(array);
12870   }
12871 
12872  private:
12873   // No implementation - assignment is unsupported.
12874   void operator=(const ValueArray40& other);
12875 
12876   const T1 v1_;
12877   const T2 v2_;
12878   const T3 v3_;
12879   const T4 v4_;
12880   const T5 v5_;
12881   const T6 v6_;
12882   const T7 v7_;
12883   const T8 v8_;
12884   const T9 v9_;
12885   const T10 v10_;
12886   const T11 v11_;
12887   const T12 v12_;
12888   const T13 v13_;
12889   const T14 v14_;
12890   const T15 v15_;
12891   const T16 v16_;
12892   const T17 v17_;
12893   const T18 v18_;
12894   const T19 v19_;
12895   const T20 v20_;
12896   const T21 v21_;
12897   const T22 v22_;
12898   const T23 v23_;
12899   const T24 v24_;
12900   const T25 v25_;
12901   const T26 v26_;
12902   const T27 v27_;
12903   const T28 v28_;
12904   const T29 v29_;
12905   const T30 v30_;
12906   const T31 v31_;
12907   const T32 v32_;
12908   const T33 v33_;
12909   const T34 v34_;
12910   const T35 v35_;
12911   const T36 v36_;
12912   const T37 v37_;
12913   const T38 v38_;
12914   const T39 v39_;
12915   const T40 v40_;
12916 };
12917 
12918 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12919     typename T6, typename T7, typename T8, typename T9, typename T10,
12920     typename T11, typename T12, typename T13, typename T14, typename T15,
12921     typename T16, typename T17, typename T18, typename T19, typename T20,
12922     typename T21, typename T22, typename T23, typename T24, typename T25,
12923     typename T26, typename T27, typename T28, typename T29, typename T30,
12924     typename T31, typename T32, typename T33, typename T34, typename T35,
12925     typename T36, typename T37, typename T38, typename T39, typename T40,
12926     typename T41>
12927 class ValueArray41 {
12928  public:
12929   ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12930       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12931       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12932       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12933       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12934       T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12935       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12936       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12937       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12938       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12939       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12940       v39_(v39), v40_(v40), v41_(v41) {}
12941 
12942   template <typename T>
12943   operator ParamGenerator<T>() const {
12944     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12945         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12946         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12947         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12948         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12949         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12950         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12951         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12952         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12953         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12954         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12955         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12956         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12957         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12958     return ValuesIn(array);
12959   }
12960 
12961  private:
12962   // No implementation - assignment is unsupported.
12963   void operator=(const ValueArray41& other);
12964 
12965   const T1 v1_;
12966   const T2 v2_;
12967   const T3 v3_;
12968   const T4 v4_;
12969   const T5 v5_;
12970   const T6 v6_;
12971   const T7 v7_;
12972   const T8 v8_;
12973   const T9 v9_;
12974   const T10 v10_;
12975   const T11 v11_;
12976   const T12 v12_;
12977   const T13 v13_;
12978   const T14 v14_;
12979   const T15 v15_;
12980   const T16 v16_;
12981   const T17 v17_;
12982   const T18 v18_;
12983   const T19 v19_;
12984   const T20 v20_;
12985   const T21 v21_;
12986   const T22 v22_;
12987   const T23 v23_;
12988   const T24 v24_;
12989   const T25 v25_;
12990   const T26 v26_;
12991   const T27 v27_;
12992   const T28 v28_;
12993   const T29 v29_;
12994   const T30 v30_;
12995   const T31 v31_;
12996   const T32 v32_;
12997   const T33 v33_;
12998   const T34 v34_;
12999   const T35 v35_;
13000   const T36 v36_;
13001   const T37 v37_;
13002   const T38 v38_;
13003   const T39 v39_;
13004   const T40 v40_;
13005   const T41 v41_;
13006 };
13007 
13008 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13009     typename T6, typename T7, typename T8, typename T9, typename T10,
13010     typename T11, typename T12, typename T13, typename T14, typename T15,
13011     typename T16, typename T17, typename T18, typename T19, typename T20,
13012     typename T21, typename T22, typename T23, typename T24, typename T25,
13013     typename T26, typename T27, typename T28, typename T29, typename T30,
13014     typename T31, typename T32, typename T33, typename T34, typename T35,
13015     typename T36, typename T37, typename T38, typename T39, typename T40,
13016     typename T41, typename T42>
13017 class ValueArray42 {
13018  public:
13019   ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13020       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13021       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13022       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13023       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13024       T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13025       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13026       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13027       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13028       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13029       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13030       v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
13031 
13032   template <typename T>
13033   operator ParamGenerator<T>() const {
13034     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13035         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13036         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13037         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13038         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13039         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13040         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13041         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13042         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13043         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13044         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13045         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13046         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13047         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13048         static_cast<T>(v42_)};
13049     return ValuesIn(array);
13050   }
13051 
13052  private:
13053   // No implementation - assignment is unsupported.
13054   void operator=(const ValueArray42& other);
13055 
13056   const T1 v1_;
13057   const T2 v2_;
13058   const T3 v3_;
13059   const T4 v4_;
13060   const T5 v5_;
13061   const T6 v6_;
13062   const T7 v7_;
13063   const T8 v8_;
13064   const T9 v9_;
13065   const T10 v10_;
13066   const T11 v11_;
13067   const T12 v12_;
13068   const T13 v13_;
13069   const T14 v14_;
13070   const T15 v15_;
13071   const T16 v16_;
13072   const T17 v17_;
13073   const T18 v18_;
13074   const T19 v19_;
13075   const T20 v20_;
13076   const T21 v21_;
13077   const T22 v22_;
13078   const T23 v23_;
13079   const T24 v24_;
13080   const T25 v25_;
13081   const T26 v26_;
13082   const T27 v27_;
13083   const T28 v28_;
13084   const T29 v29_;
13085   const T30 v30_;
13086   const T31 v31_;
13087   const T32 v32_;
13088   const T33 v33_;
13089   const T34 v34_;
13090   const T35 v35_;
13091   const T36 v36_;
13092   const T37 v37_;
13093   const T38 v38_;
13094   const T39 v39_;
13095   const T40 v40_;
13096   const T41 v41_;
13097   const T42 v42_;
13098 };
13099 
13100 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13101     typename T6, typename T7, typename T8, typename T9, typename T10,
13102     typename T11, typename T12, typename T13, typename T14, typename T15,
13103     typename T16, typename T17, typename T18, typename T19, typename T20,
13104     typename T21, typename T22, typename T23, typename T24, typename T25,
13105     typename T26, typename T27, typename T28, typename T29, typename T30,
13106     typename T31, typename T32, typename T33, typename T34, typename T35,
13107     typename T36, typename T37, typename T38, typename T39, typename T40,
13108     typename T41, typename T42, typename T43>
13109 class ValueArray43 {
13110  public:
13111   ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13112       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13113       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13114       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13115       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13116       T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
13117       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
13118       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
13119       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
13120       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
13121       v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
13122       v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
13123 
13124   template <typename T>
13125   operator ParamGenerator<T>() const {
13126     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13127         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13128         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13129         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13130         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13131         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13132         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13133         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13134         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13135         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13136         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13137         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13138         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13139         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13140         static_cast<T>(v42_), static_cast<T>(v43_)};
13141     return ValuesIn(array);
13142   }
13143 
13144  private:
13145   // No implementation - assignment is unsupported.
13146   void operator=(const ValueArray43& other);
13147 
13148   const T1 v1_;
13149   const T2 v2_;
13150   const T3 v3_;
13151   const T4 v4_;
13152   const T5 v5_;
13153   const T6 v6_;
13154   const T7 v7_;
13155   const T8 v8_;
13156   const T9 v9_;
13157   const T10 v10_;
13158   const T11 v11_;
13159   const T12 v12_;
13160   const T13 v13_;
13161   const T14 v14_;
13162   const T15 v15_;
13163   const T16 v16_;
13164   const T17 v17_;
13165   const T18 v18_;
13166   const T19 v19_;
13167   const T20 v20_;
13168   const T21 v21_;
13169   const T22 v22_;
13170   const T23 v23_;
13171   const T24 v24_;
13172   const T25 v25_;
13173   const T26 v26_;
13174   const T27 v27_;
13175   const T28 v28_;
13176   const T29 v29_;
13177   const T30 v30_;
13178   const T31 v31_;
13179   const T32 v32_;
13180   const T33 v33_;
13181   const T34 v34_;
13182   const T35 v35_;
13183   const T36 v36_;
13184   const T37 v37_;
13185   const T38 v38_;
13186   const T39 v39_;
13187   const T40 v40_;
13188   const T41 v41_;
13189   const T42 v42_;
13190   const T43 v43_;
13191 };
13192 
13193 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13194     typename T6, typename T7, typename T8, typename T9, typename T10,
13195     typename T11, typename T12, typename T13, typename T14, typename T15,
13196     typename T16, typename T17, typename T18, typename T19, typename T20,
13197     typename T21, typename T22, typename T23, typename T24, typename T25,
13198     typename T26, typename T27, typename T28, typename T29, typename T30,
13199     typename T31, typename T32, typename T33, typename T34, typename T35,
13200     typename T36, typename T37, typename T38, typename T39, typename T40,
13201     typename T41, typename T42, typename T43, typename T44>
13202 class ValueArray44 {
13203  public:
13204   ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13205       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13206       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13207       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13208       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13209       T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13210       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13211       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13212       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13213       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13214       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13215       v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13216       v43_(v43), v44_(v44) {}
13217 
13218   template <typename T>
13219   operator ParamGenerator<T>() const {
13220     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13221         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13222         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13223         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13224         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13225         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13226         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13227         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13228         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13229         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13230         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13231         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13232         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13233         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13234         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13235     return ValuesIn(array);
13236   }
13237 
13238  private:
13239   // No implementation - assignment is unsupported.
13240   void operator=(const ValueArray44& other);
13241 
13242   const T1 v1_;
13243   const T2 v2_;
13244   const T3 v3_;
13245   const T4 v4_;
13246   const T5 v5_;
13247   const T6 v6_;
13248   const T7 v7_;
13249   const T8 v8_;
13250   const T9 v9_;
13251   const T10 v10_;
13252   const T11 v11_;
13253   const T12 v12_;
13254   const T13 v13_;
13255   const T14 v14_;
13256   const T15 v15_;
13257   const T16 v16_;
13258   const T17 v17_;
13259   const T18 v18_;
13260   const T19 v19_;
13261   const T20 v20_;
13262   const T21 v21_;
13263   const T22 v22_;
13264   const T23 v23_;
13265   const T24 v24_;
13266   const T25 v25_;
13267   const T26 v26_;
13268   const T27 v27_;
13269   const T28 v28_;
13270   const T29 v29_;
13271   const T30 v30_;
13272   const T31 v31_;
13273   const T32 v32_;
13274   const T33 v33_;
13275   const T34 v34_;
13276   const T35 v35_;
13277   const T36 v36_;
13278   const T37 v37_;
13279   const T38 v38_;
13280   const T39 v39_;
13281   const T40 v40_;
13282   const T41 v41_;
13283   const T42 v42_;
13284   const T43 v43_;
13285   const T44 v44_;
13286 };
13287 
13288 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13289     typename T6, typename T7, typename T8, typename T9, typename T10,
13290     typename T11, typename T12, typename T13, typename T14, typename T15,
13291     typename T16, typename T17, typename T18, typename T19, typename T20,
13292     typename T21, typename T22, typename T23, typename T24, typename T25,
13293     typename T26, typename T27, typename T28, typename T29, typename T30,
13294     typename T31, typename T32, typename T33, typename T34, typename T35,
13295     typename T36, typename T37, typename T38, typename T39, typename T40,
13296     typename T41, typename T42, typename T43, typename T44, typename T45>
13297 class ValueArray45 {
13298  public:
13299   ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13300       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13301       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13302       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13303       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13304       T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13305       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13306       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13307       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13308       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13309       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13310       v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13311       v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13312 
13313   template <typename T>
13314   operator ParamGenerator<T>() const {
13315     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13316         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13317         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13318         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13319         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13320         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13321         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13322         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13323         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13324         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13325         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13326         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13327         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13328         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13329         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13330         static_cast<T>(v45_)};
13331     return ValuesIn(array);
13332   }
13333 
13334  private:
13335   // No implementation - assignment is unsupported.
13336   void operator=(const ValueArray45& other);
13337 
13338   const T1 v1_;
13339   const T2 v2_;
13340   const T3 v3_;
13341   const T4 v4_;
13342   const T5 v5_;
13343   const T6 v6_;
13344   const T7 v7_;
13345   const T8 v8_;
13346   const T9 v9_;
13347   const T10 v10_;
13348   const T11 v11_;
13349   const T12 v12_;
13350   const T13 v13_;
13351   const T14 v14_;
13352   const T15 v15_;
13353   const T16 v16_;
13354   const T17 v17_;
13355   const T18 v18_;
13356   const T19 v19_;
13357   const T20 v20_;
13358   const T21 v21_;
13359   const T22 v22_;
13360   const T23 v23_;
13361   const T24 v24_;
13362   const T25 v25_;
13363   const T26 v26_;
13364   const T27 v27_;
13365   const T28 v28_;
13366   const T29 v29_;
13367   const T30 v30_;
13368   const T31 v31_;
13369   const T32 v32_;
13370   const T33 v33_;
13371   const T34 v34_;
13372   const T35 v35_;
13373   const T36 v36_;
13374   const T37 v37_;
13375   const T38 v38_;
13376   const T39 v39_;
13377   const T40 v40_;
13378   const T41 v41_;
13379   const T42 v42_;
13380   const T43 v43_;
13381   const T44 v44_;
13382   const T45 v45_;
13383 };
13384 
13385 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13386     typename T6, typename T7, typename T8, typename T9, typename T10,
13387     typename T11, typename T12, typename T13, typename T14, typename T15,
13388     typename T16, typename T17, typename T18, typename T19, typename T20,
13389     typename T21, typename T22, typename T23, typename T24, typename T25,
13390     typename T26, typename T27, typename T28, typename T29, typename T30,
13391     typename T31, typename T32, typename T33, typename T34, typename T35,
13392     typename T36, typename T37, typename T38, typename T39, typename T40,
13393     typename T41, typename T42, typename T43, typename T44, typename T45,
13394     typename T46>
13395 class ValueArray46 {
13396  public:
13397   ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13398       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13399       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13400       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13401       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13402       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13403       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13404       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13405       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13406       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13407       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13408       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13409       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13410 
13411   template <typename T>
13412   operator ParamGenerator<T>() const {
13413     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13414         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13415         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13416         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13417         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13418         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13419         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13420         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13421         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13422         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13423         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13424         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13425         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13426         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13427         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13428         static_cast<T>(v45_), static_cast<T>(v46_)};
13429     return ValuesIn(array);
13430   }
13431 
13432  private:
13433   // No implementation - assignment is unsupported.
13434   void operator=(const ValueArray46& other);
13435 
13436   const T1 v1_;
13437   const T2 v2_;
13438   const T3 v3_;
13439   const T4 v4_;
13440   const T5 v5_;
13441   const T6 v6_;
13442   const T7 v7_;
13443   const T8 v8_;
13444   const T9 v9_;
13445   const T10 v10_;
13446   const T11 v11_;
13447   const T12 v12_;
13448   const T13 v13_;
13449   const T14 v14_;
13450   const T15 v15_;
13451   const T16 v16_;
13452   const T17 v17_;
13453   const T18 v18_;
13454   const T19 v19_;
13455   const T20 v20_;
13456   const T21 v21_;
13457   const T22 v22_;
13458   const T23 v23_;
13459   const T24 v24_;
13460   const T25 v25_;
13461   const T26 v26_;
13462   const T27 v27_;
13463   const T28 v28_;
13464   const T29 v29_;
13465   const T30 v30_;
13466   const T31 v31_;
13467   const T32 v32_;
13468   const T33 v33_;
13469   const T34 v34_;
13470   const T35 v35_;
13471   const T36 v36_;
13472   const T37 v37_;
13473   const T38 v38_;
13474   const T39 v39_;
13475   const T40 v40_;
13476   const T41 v41_;
13477   const T42 v42_;
13478   const T43 v43_;
13479   const T44 v44_;
13480   const T45 v45_;
13481   const T46 v46_;
13482 };
13483 
13484 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13485     typename T6, typename T7, typename T8, typename T9, typename T10,
13486     typename T11, typename T12, typename T13, typename T14, typename T15,
13487     typename T16, typename T17, typename T18, typename T19, typename T20,
13488     typename T21, typename T22, typename T23, typename T24, typename T25,
13489     typename T26, typename T27, typename T28, typename T29, typename T30,
13490     typename T31, typename T32, typename T33, typename T34, typename T35,
13491     typename T36, typename T37, typename T38, typename T39, typename T40,
13492     typename T41, typename T42, typename T43, typename T44, typename T45,
13493     typename T46, typename T47>
13494 class ValueArray47 {
13495  public:
13496   ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13497       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13498       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13499       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13500       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13501       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13502       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13503       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13504       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13505       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13506       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13507       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13508       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13509       v47_(v47) {}
13510 
13511   template <typename T>
13512   operator ParamGenerator<T>() const {
13513     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13514         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13515         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13516         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13517         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13518         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13519         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13520         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13521         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13522         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13523         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13524         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13525         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13526         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13527         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13528         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13529     return ValuesIn(array);
13530   }
13531 
13532  private:
13533   // No implementation - assignment is unsupported.
13534   void operator=(const ValueArray47& other);
13535 
13536   const T1 v1_;
13537   const T2 v2_;
13538   const T3 v3_;
13539   const T4 v4_;
13540   const T5 v5_;
13541   const T6 v6_;
13542   const T7 v7_;
13543   const T8 v8_;
13544   const T9 v9_;
13545   const T10 v10_;
13546   const T11 v11_;
13547   const T12 v12_;
13548   const T13 v13_;
13549   const T14 v14_;
13550   const T15 v15_;
13551   const T16 v16_;
13552   const T17 v17_;
13553   const T18 v18_;
13554   const T19 v19_;
13555   const T20 v20_;
13556   const T21 v21_;
13557   const T22 v22_;
13558   const T23 v23_;
13559   const T24 v24_;
13560   const T25 v25_;
13561   const T26 v26_;
13562   const T27 v27_;
13563   const T28 v28_;
13564   const T29 v29_;
13565   const T30 v30_;
13566   const T31 v31_;
13567   const T32 v32_;
13568   const T33 v33_;
13569   const T34 v34_;
13570   const T35 v35_;
13571   const T36 v36_;
13572   const T37 v37_;
13573   const T38 v38_;
13574   const T39 v39_;
13575   const T40 v40_;
13576   const T41 v41_;
13577   const T42 v42_;
13578   const T43 v43_;
13579   const T44 v44_;
13580   const T45 v45_;
13581   const T46 v46_;
13582   const T47 v47_;
13583 };
13584 
13585 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13586     typename T6, typename T7, typename T8, typename T9, typename T10,
13587     typename T11, typename T12, typename T13, typename T14, typename T15,
13588     typename T16, typename T17, typename T18, typename T19, typename T20,
13589     typename T21, typename T22, typename T23, typename T24, typename T25,
13590     typename T26, typename T27, typename T28, typename T29, typename T30,
13591     typename T31, typename T32, typename T33, typename T34, typename T35,
13592     typename T36, typename T37, typename T38, typename T39, typename T40,
13593     typename T41, typename T42, typename T43, typename T44, typename T45,
13594     typename T46, typename T47, typename T48>
13595 class ValueArray48 {
13596  public:
13597   ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13598       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13599       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13600       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13601       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13602       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13603       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13604       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13605       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13606       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13607       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13608       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13609       v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13610       v46_(v46), v47_(v47), v48_(v48) {}
13611 
13612   template <typename T>
13613   operator ParamGenerator<T>() const {
13614     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13615         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13616         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13617         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13618         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13619         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13620         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13621         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13622         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13623         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13624         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13625         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13626         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13627         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13628         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13629         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13630         static_cast<T>(v48_)};
13631     return ValuesIn(array);
13632   }
13633 
13634  private:
13635   // No implementation - assignment is unsupported.
13636   void operator=(const ValueArray48& other);
13637 
13638   const T1 v1_;
13639   const T2 v2_;
13640   const T3 v3_;
13641   const T4 v4_;
13642   const T5 v5_;
13643   const T6 v6_;
13644   const T7 v7_;
13645   const T8 v8_;
13646   const T9 v9_;
13647   const T10 v10_;
13648   const T11 v11_;
13649   const T12 v12_;
13650   const T13 v13_;
13651   const T14 v14_;
13652   const T15 v15_;
13653   const T16 v16_;
13654   const T17 v17_;
13655   const T18 v18_;
13656   const T19 v19_;
13657   const T20 v20_;
13658   const T21 v21_;
13659   const T22 v22_;
13660   const T23 v23_;
13661   const T24 v24_;
13662   const T25 v25_;
13663   const T26 v26_;
13664   const T27 v27_;
13665   const T28 v28_;
13666   const T29 v29_;
13667   const T30 v30_;
13668   const T31 v31_;
13669   const T32 v32_;
13670   const T33 v33_;
13671   const T34 v34_;
13672   const T35 v35_;
13673   const T36 v36_;
13674   const T37 v37_;
13675   const T38 v38_;
13676   const T39 v39_;
13677   const T40 v40_;
13678   const T41 v41_;
13679   const T42 v42_;
13680   const T43 v43_;
13681   const T44 v44_;
13682   const T45 v45_;
13683   const T46 v46_;
13684   const T47 v47_;
13685   const T48 v48_;
13686 };
13687 
13688 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13689     typename T6, typename T7, typename T8, typename T9, typename T10,
13690     typename T11, typename T12, typename T13, typename T14, typename T15,
13691     typename T16, typename T17, typename T18, typename T19, typename T20,
13692     typename T21, typename T22, typename T23, typename T24, typename T25,
13693     typename T26, typename T27, typename T28, typename T29, typename T30,
13694     typename T31, typename T32, typename T33, typename T34, typename T35,
13695     typename T36, typename T37, typename T38, typename T39, typename T40,
13696     typename T41, typename T42, typename T43, typename T44, typename T45,
13697     typename T46, typename T47, typename T48, typename T49>
13698 class ValueArray49 {
13699  public:
13700   ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13701       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13702       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13703       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13704       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13705       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13706       T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13707       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13708       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13709       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13710       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13711       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13712       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13713       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13714 
13715   template <typename T>
13716   operator ParamGenerator<T>() const {
13717     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13718         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13719         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13720         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13721         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13722         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13723         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13724         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13725         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13726         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13727         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13728         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13729         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13730         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13731         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13732         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13733         static_cast<T>(v48_), static_cast<T>(v49_)};
13734     return ValuesIn(array);
13735   }
13736 
13737  private:
13738   // No implementation - assignment is unsupported.
13739   void operator=(const ValueArray49& other);
13740 
13741   const T1 v1_;
13742   const T2 v2_;
13743   const T3 v3_;
13744   const T4 v4_;
13745   const T5 v5_;
13746   const T6 v6_;
13747   const T7 v7_;
13748   const T8 v8_;
13749   const T9 v9_;
13750   const T10 v10_;
13751   const T11 v11_;
13752   const T12 v12_;
13753   const T13 v13_;
13754   const T14 v14_;
13755   const T15 v15_;
13756   const T16 v16_;
13757   const T17 v17_;
13758   const T18 v18_;
13759   const T19 v19_;
13760   const T20 v20_;
13761   const T21 v21_;
13762   const T22 v22_;
13763   const T23 v23_;
13764   const T24 v24_;
13765   const T25 v25_;
13766   const T26 v26_;
13767   const T27 v27_;
13768   const T28 v28_;
13769   const T29 v29_;
13770   const T30 v30_;
13771   const T31 v31_;
13772   const T32 v32_;
13773   const T33 v33_;
13774   const T34 v34_;
13775   const T35 v35_;
13776   const T36 v36_;
13777   const T37 v37_;
13778   const T38 v38_;
13779   const T39 v39_;
13780   const T40 v40_;
13781   const T41 v41_;
13782   const T42 v42_;
13783   const T43 v43_;
13784   const T44 v44_;
13785   const T45 v45_;
13786   const T46 v46_;
13787   const T47 v47_;
13788   const T48 v48_;
13789   const T49 v49_;
13790 };
13791 
13792 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13793     typename T6, typename T7, typename T8, typename T9, typename T10,
13794     typename T11, typename T12, typename T13, typename T14, typename T15,
13795     typename T16, typename T17, typename T18, typename T19, typename T20,
13796     typename T21, typename T22, typename T23, typename T24, typename T25,
13797     typename T26, typename T27, typename T28, typename T29, typename T30,
13798     typename T31, typename T32, typename T33, typename T34, typename T35,
13799     typename T36, typename T37, typename T38, typename T39, typename T40,
13800     typename T41, typename T42, typename T43, typename T44, typename T45,
13801     typename T46, typename T47, typename T48, typename T49, typename T50>
13802 class ValueArray50 {
13803  public:
13804   ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13805       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13806       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13807       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13808       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13809       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13810       T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13811       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13812       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13813       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13814       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13815       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13816       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13817       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13818 
13819   template <typename T>
13820   operator ParamGenerator<T>() const {
13821     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13822         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13823         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13824         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13825         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13826         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13827         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13828         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13829         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13830         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13831         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13832         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13833         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13834         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13835         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13836         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13837         static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13838     return ValuesIn(array);
13839   }
13840 
13841  private:
13842   // No implementation - assignment is unsupported.
13843   void operator=(const ValueArray50& other);
13844 
13845   const T1 v1_;
13846   const T2 v2_;
13847   const T3 v3_;
13848   const T4 v4_;
13849   const T5 v5_;
13850   const T6 v6_;
13851   const T7 v7_;
13852   const T8 v8_;
13853   const T9 v9_;
13854   const T10 v10_;
13855   const T11 v11_;
13856   const T12 v12_;
13857   const T13 v13_;
13858   const T14 v14_;
13859   const T15 v15_;
13860   const T16 v16_;
13861   const T17 v17_;
13862   const T18 v18_;
13863   const T19 v19_;
13864   const T20 v20_;
13865   const T21 v21_;
13866   const T22 v22_;
13867   const T23 v23_;
13868   const T24 v24_;
13869   const T25 v25_;
13870   const T26 v26_;
13871   const T27 v27_;
13872   const T28 v28_;
13873   const T29 v29_;
13874   const T30 v30_;
13875   const T31 v31_;
13876   const T32 v32_;
13877   const T33 v33_;
13878   const T34 v34_;
13879   const T35 v35_;
13880   const T36 v36_;
13881   const T37 v37_;
13882   const T38 v38_;
13883   const T39 v39_;
13884   const T40 v40_;
13885   const T41 v41_;
13886   const T42 v42_;
13887   const T43 v43_;
13888   const T44 v44_;
13889   const T45 v45_;
13890   const T46 v46_;
13891   const T47 v47_;
13892   const T48 v48_;
13893   const T49 v49_;
13894   const T50 v50_;
13895 };
13896 
13897 # if GTEST_HAS_COMBINE
13898 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13899 //
13900 // Generates values from the Cartesian product of values produced
13901 // by the argument generators.
13902 //
13903 template <typename T1, typename T2>
13904 class CartesianProductGenerator2
13905     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13906  public:
13907   typedef ::std::tr1::tuple<T1, T2> ParamType;
13908 
13909   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13910       const ParamGenerator<T2>& g2)
13911       : g1_(g1), g2_(g2) {}
13912   virtual ~CartesianProductGenerator2() {}
13913 
13914   virtual ParamIteratorInterface<ParamType>* Begin() const {
13915     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13916   }
13917   virtual ParamIteratorInterface<ParamType>* End() const {
13918     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13919   }
13920 
13921  private:
13922   class Iterator : public ParamIteratorInterface<ParamType> {
13923    public:
13924     Iterator(const ParamGeneratorInterface<ParamType>* base,
13925       const ParamGenerator<T1>& g1,
13926       const typename ParamGenerator<T1>::iterator& current1,
13927       const ParamGenerator<T2>& g2,
13928       const typename ParamGenerator<T2>::iterator& current2)
13929         : base_(base),
13930           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13931           begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
13932       ComputeCurrentValue();
13933     }
13934     virtual ~Iterator() {}
13935 
13936     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13937       return base_;
13938     }
13939     // Advance should not be called on beyond-of-range iterators
13940     // so no component iterators must be beyond end of range, either.
13941     virtual void Advance() {
13942       assert(!AtEnd());
13943       ++current2_;
13944       if (current2_ == end2_) {
13945         current2_ = begin2_;
13946         ++current1_;
13947       }
13948       ComputeCurrentValue();
13949     }
13950     virtual ParamIteratorInterface<ParamType>* Clone() const {
13951       return new Iterator(*this);
13952     }
13953     virtual const ParamType* Current() const { return &current_value_; }
13954     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13955       // Having the same base generator guarantees that the other
13956       // iterator is of the same type and we can downcast.
13957       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13958           << "The program attempted to compare iterators "
13959           << "from different generators." << std::endl;
13960       const Iterator* typed_other =
13961           CheckedDowncastToActualType<const Iterator>(&other);
13962       // We must report iterators equal if they both point beyond their
13963       // respective ranges. That can happen in a variety of fashions,
13964       // so we have to consult AtEnd().
13965       return (AtEnd() && typed_other->AtEnd()) ||
13966          (
13967           current1_ == typed_other->current1_ &&
13968           current2_ == typed_other->current2_);
13969     }
13970 
13971    private:
13972     Iterator(const Iterator& other)
13973         : base_(other.base_),
13974         begin1_(other.begin1_),
13975         end1_(other.end1_),
13976         current1_(other.current1_),
13977         begin2_(other.begin2_),
13978         end2_(other.end2_),
13979         current2_(other.current2_) {
13980       ComputeCurrentValue();
13981     }
13982 
13983     void ComputeCurrentValue() {
13984       if (!AtEnd())
13985         current_value_ = ParamType(*current1_, *current2_);
13986     }
13987     bool AtEnd() const {
13988       // We must report iterator past the end of the range when either of the
13989       // component iterators has reached the end of its range.
13990       return
13991           current1_ == end1_ ||
13992           current2_ == end2_;
13993     }
13994 
13995     // No implementation - assignment is unsupported.
13996     void operator=(const Iterator& other);
13997 
13998     const ParamGeneratorInterface<ParamType>* const base_;
13999     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14000     // current[i]_ is the actual traversing iterator.
14001     const typename ParamGenerator<T1>::iterator begin1_;
14002     const typename ParamGenerator<T1>::iterator end1_;
14003     typename ParamGenerator<T1>::iterator current1_;
14004     const typename ParamGenerator<T2>::iterator begin2_;
14005     const typename ParamGenerator<T2>::iterator end2_;
14006     typename ParamGenerator<T2>::iterator current2_;
14007     ParamType current_value_;
14008   };  // class CartesianProductGenerator2::Iterator
14009 
14010   // No implementation - assignment is unsupported.
14011   void operator=(const CartesianProductGenerator2& other);
14012 
14013   const ParamGenerator<T1> g1_;
14014   const ParamGenerator<T2> g2_;
14015 };  // class CartesianProductGenerator2
14016 
14017 
14018 template <typename T1, typename T2, typename T3>
14019 class CartesianProductGenerator3
14020     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
14021  public:
14022   typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
14023 
14024   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
14025       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
14026       : g1_(g1), g2_(g2), g3_(g3) {}
14027   virtual ~CartesianProductGenerator3() {}
14028 
14029   virtual ParamIteratorInterface<ParamType>* Begin() const {
14030     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14031         g3_.begin());
14032   }
14033   virtual ParamIteratorInterface<ParamType>* End() const {
14034     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
14035   }
14036 
14037  private:
14038   class Iterator : public ParamIteratorInterface<ParamType> {
14039    public:
14040     Iterator(const ParamGeneratorInterface<ParamType>* base,
14041       const ParamGenerator<T1>& g1,
14042       const typename ParamGenerator<T1>::iterator& current1,
14043       const ParamGenerator<T2>& g2,
14044       const typename ParamGenerator<T2>::iterator& current2,
14045       const ParamGenerator<T3>& g3,
14046       const typename ParamGenerator<T3>::iterator& current3)
14047         : base_(base),
14048           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14049           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14050           begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
14051       ComputeCurrentValue();
14052     }
14053     virtual ~Iterator() {}
14054 
14055     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14056       return base_;
14057     }
14058     // Advance should not be called on beyond-of-range iterators
14059     // so no component iterators must be beyond end of range, either.
14060     virtual void Advance() {
14061       assert(!AtEnd());
14062       ++current3_;
14063       if (current3_ == end3_) {
14064         current3_ = begin3_;
14065         ++current2_;
14066       }
14067       if (current2_ == end2_) {
14068         current2_ = begin2_;
14069         ++current1_;
14070       }
14071       ComputeCurrentValue();
14072     }
14073     virtual ParamIteratorInterface<ParamType>* Clone() const {
14074       return new Iterator(*this);
14075     }
14076     virtual const ParamType* Current() const { return &current_value_; }
14077     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14078       // Having the same base generator guarantees that the other
14079       // iterator is of the same type and we can downcast.
14080       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14081           << "The program attempted to compare iterators "
14082           << "from different generators." << std::endl;
14083       const Iterator* typed_other =
14084           CheckedDowncastToActualType<const Iterator>(&other);
14085       // We must report iterators equal if they both point beyond their
14086       // respective ranges. That can happen in a variety of fashions,
14087       // so we have to consult AtEnd().
14088       return (AtEnd() && typed_other->AtEnd()) ||
14089          (
14090           current1_ == typed_other->current1_ &&
14091           current2_ == typed_other->current2_ &&
14092           current3_ == typed_other->current3_);
14093     }
14094 
14095    private:
14096     Iterator(const Iterator& other)
14097         : base_(other.base_),
14098         begin1_(other.begin1_),
14099         end1_(other.end1_),
14100         current1_(other.current1_),
14101         begin2_(other.begin2_),
14102         end2_(other.end2_),
14103         current2_(other.current2_),
14104         begin3_(other.begin3_),
14105         end3_(other.end3_),
14106         current3_(other.current3_) {
14107       ComputeCurrentValue();
14108     }
14109 
14110     void ComputeCurrentValue() {
14111       if (!AtEnd())
14112         current_value_ = ParamType(*current1_, *current2_, *current3_);
14113     }
14114     bool AtEnd() const {
14115       // We must report iterator past the end of the range when either of the
14116       // component iterators has reached the end of its range.
14117       return
14118           current1_ == end1_ ||
14119           current2_ == end2_ ||
14120           current3_ == end3_;
14121     }
14122 
14123     // No implementation - assignment is unsupported.
14124     void operator=(const Iterator& other);
14125 
14126     const ParamGeneratorInterface<ParamType>* const base_;
14127     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14128     // current[i]_ is the actual traversing iterator.
14129     const typename ParamGenerator<T1>::iterator begin1_;
14130     const typename ParamGenerator<T1>::iterator end1_;
14131     typename ParamGenerator<T1>::iterator current1_;
14132     const typename ParamGenerator<T2>::iterator begin2_;
14133     const typename ParamGenerator<T2>::iterator end2_;
14134     typename ParamGenerator<T2>::iterator current2_;
14135     const typename ParamGenerator<T3>::iterator begin3_;
14136     const typename ParamGenerator<T3>::iterator end3_;
14137     typename ParamGenerator<T3>::iterator current3_;
14138     ParamType current_value_;
14139   };  // class CartesianProductGenerator3::Iterator
14140 
14141   // No implementation - assignment is unsupported.
14142   void operator=(const CartesianProductGenerator3& other);
14143 
14144   const ParamGenerator<T1> g1_;
14145   const ParamGenerator<T2> g2_;
14146   const ParamGenerator<T3> g3_;
14147 };  // class CartesianProductGenerator3
14148 
14149 
14150 template <typename T1, typename T2, typename T3, typename T4>
14151 class CartesianProductGenerator4
14152     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14153  public:
14154   typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14155 
14156   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14157       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14158       const ParamGenerator<T4>& g4)
14159       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14160   virtual ~CartesianProductGenerator4() {}
14161 
14162   virtual ParamIteratorInterface<ParamType>* Begin() const {
14163     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14164         g3_.begin(), g4_, g4_.begin());
14165   }
14166   virtual ParamIteratorInterface<ParamType>* End() const {
14167     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14168         g4_, g4_.end());
14169   }
14170 
14171  private:
14172   class Iterator : public ParamIteratorInterface<ParamType> {
14173    public:
14174     Iterator(const ParamGeneratorInterface<ParamType>* base,
14175       const ParamGenerator<T1>& g1,
14176       const typename ParamGenerator<T1>::iterator& current1,
14177       const ParamGenerator<T2>& g2,
14178       const typename ParamGenerator<T2>::iterator& current2,
14179       const ParamGenerator<T3>& g3,
14180       const typename ParamGenerator<T3>::iterator& current3,
14181       const ParamGenerator<T4>& g4,
14182       const typename ParamGenerator<T4>::iterator& current4)
14183         : base_(base),
14184           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14185           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14186           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14187           begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
14188       ComputeCurrentValue();
14189     }
14190     virtual ~Iterator() {}
14191 
14192     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14193       return base_;
14194     }
14195     // Advance should not be called on beyond-of-range iterators
14196     // so no component iterators must be beyond end of range, either.
14197     virtual void Advance() {
14198       assert(!AtEnd());
14199       ++current4_;
14200       if (current4_ == end4_) {
14201         current4_ = begin4_;
14202         ++current3_;
14203       }
14204       if (current3_ == end3_) {
14205         current3_ = begin3_;
14206         ++current2_;
14207       }
14208       if (current2_ == end2_) {
14209         current2_ = begin2_;
14210         ++current1_;
14211       }
14212       ComputeCurrentValue();
14213     }
14214     virtual ParamIteratorInterface<ParamType>* Clone() const {
14215       return new Iterator(*this);
14216     }
14217     virtual const ParamType* Current() const { return &current_value_; }
14218     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14219       // Having the same base generator guarantees that the other
14220       // iterator is of the same type and we can downcast.
14221       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14222           << "The program attempted to compare iterators "
14223           << "from different generators." << std::endl;
14224       const Iterator* typed_other =
14225           CheckedDowncastToActualType<const Iterator>(&other);
14226       // We must report iterators equal if they both point beyond their
14227       // respective ranges. That can happen in a variety of fashions,
14228       // so we have to consult AtEnd().
14229       return (AtEnd() && typed_other->AtEnd()) ||
14230          (
14231           current1_ == typed_other->current1_ &&
14232           current2_ == typed_other->current2_ &&
14233           current3_ == typed_other->current3_ &&
14234           current4_ == typed_other->current4_);
14235     }
14236 
14237    private:
14238     Iterator(const Iterator& other)
14239         : base_(other.base_),
14240         begin1_(other.begin1_),
14241         end1_(other.end1_),
14242         current1_(other.current1_),
14243         begin2_(other.begin2_),
14244         end2_(other.end2_),
14245         current2_(other.current2_),
14246         begin3_(other.begin3_),
14247         end3_(other.end3_),
14248         current3_(other.current3_),
14249         begin4_(other.begin4_),
14250         end4_(other.end4_),
14251         current4_(other.current4_) {
14252       ComputeCurrentValue();
14253     }
14254 
14255     void ComputeCurrentValue() {
14256       if (!AtEnd())
14257         current_value_ = ParamType(*current1_, *current2_, *current3_,
14258             *current4_);
14259     }
14260     bool AtEnd() const {
14261       // We must report iterator past the end of the range when either of the
14262       // component iterators has reached the end of its range.
14263       return
14264           current1_ == end1_ ||
14265           current2_ == end2_ ||
14266           current3_ == end3_ ||
14267           current4_ == end4_;
14268     }
14269 
14270     // No implementation - assignment is unsupported.
14271     void operator=(const Iterator& other);
14272 
14273     const ParamGeneratorInterface<ParamType>* const base_;
14274     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14275     // current[i]_ is the actual traversing iterator.
14276     const typename ParamGenerator<T1>::iterator begin1_;
14277     const typename ParamGenerator<T1>::iterator end1_;
14278     typename ParamGenerator<T1>::iterator current1_;
14279     const typename ParamGenerator<T2>::iterator begin2_;
14280     const typename ParamGenerator<T2>::iterator end2_;
14281     typename ParamGenerator<T2>::iterator current2_;
14282     const typename ParamGenerator<T3>::iterator begin3_;
14283     const typename ParamGenerator<T3>::iterator end3_;
14284     typename ParamGenerator<T3>::iterator current3_;
14285     const typename ParamGenerator<T4>::iterator begin4_;
14286     const typename ParamGenerator<T4>::iterator end4_;
14287     typename ParamGenerator<T4>::iterator current4_;
14288     ParamType current_value_;
14289   };  // class CartesianProductGenerator4::Iterator
14290 
14291   // No implementation - assignment is unsupported.
14292   void operator=(const CartesianProductGenerator4& other);
14293 
14294   const ParamGenerator<T1> g1_;
14295   const ParamGenerator<T2> g2_;
14296   const ParamGenerator<T3> g3_;
14297   const ParamGenerator<T4> g4_;
14298 };  // class CartesianProductGenerator4
14299 
14300 
14301 template <typename T1, typename T2, typename T3, typename T4, typename T5>
14302 class CartesianProductGenerator5
14303     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14304  public:
14305   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14306 
14307   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14308       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14309       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14310       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14311   virtual ~CartesianProductGenerator5() {}
14312 
14313   virtual ParamIteratorInterface<ParamType>* Begin() const {
14314     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14315         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14316   }
14317   virtual ParamIteratorInterface<ParamType>* End() const {
14318     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14319         g4_, g4_.end(), g5_, g5_.end());
14320   }
14321 
14322  private:
14323   class Iterator : public ParamIteratorInterface<ParamType> {
14324    public:
14325     Iterator(const ParamGeneratorInterface<ParamType>* base,
14326       const ParamGenerator<T1>& g1,
14327       const typename ParamGenerator<T1>::iterator& current1,
14328       const ParamGenerator<T2>& g2,
14329       const typename ParamGenerator<T2>::iterator& current2,
14330       const ParamGenerator<T3>& g3,
14331       const typename ParamGenerator<T3>::iterator& current3,
14332       const ParamGenerator<T4>& g4,
14333       const typename ParamGenerator<T4>::iterator& current4,
14334       const ParamGenerator<T5>& g5,
14335       const typename ParamGenerator<T5>::iterator& current5)
14336         : base_(base),
14337           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14338           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14339           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14340           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14341           begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
14342       ComputeCurrentValue();
14343     }
14344     virtual ~Iterator() {}
14345 
14346     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14347       return base_;
14348     }
14349     // Advance should not be called on beyond-of-range iterators
14350     // so no component iterators must be beyond end of range, either.
14351     virtual void Advance() {
14352       assert(!AtEnd());
14353       ++current5_;
14354       if (current5_ == end5_) {
14355         current5_ = begin5_;
14356         ++current4_;
14357       }
14358       if (current4_ == end4_) {
14359         current4_ = begin4_;
14360         ++current3_;
14361       }
14362       if (current3_ == end3_) {
14363         current3_ = begin3_;
14364         ++current2_;
14365       }
14366       if (current2_ == end2_) {
14367         current2_ = begin2_;
14368         ++current1_;
14369       }
14370       ComputeCurrentValue();
14371     }
14372     virtual ParamIteratorInterface<ParamType>* Clone() const {
14373       return new Iterator(*this);
14374     }
14375     virtual const ParamType* Current() const { return &current_value_; }
14376     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14377       // Having the same base generator guarantees that the other
14378       // iterator is of the same type and we can downcast.
14379       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14380           << "The program attempted to compare iterators "
14381           << "from different generators." << std::endl;
14382       const Iterator* typed_other =
14383           CheckedDowncastToActualType<const Iterator>(&other);
14384       // We must report iterators equal if they both point beyond their
14385       // respective ranges. That can happen in a variety of fashions,
14386       // so we have to consult AtEnd().
14387       return (AtEnd() && typed_other->AtEnd()) ||
14388          (
14389           current1_ == typed_other->current1_ &&
14390           current2_ == typed_other->current2_ &&
14391           current3_ == typed_other->current3_ &&
14392           current4_ == typed_other->current4_ &&
14393           current5_ == typed_other->current5_);
14394     }
14395 
14396    private:
14397     Iterator(const Iterator& other)
14398         : base_(other.base_),
14399         begin1_(other.begin1_),
14400         end1_(other.end1_),
14401         current1_(other.current1_),
14402         begin2_(other.begin2_),
14403         end2_(other.end2_),
14404         current2_(other.current2_),
14405         begin3_(other.begin3_),
14406         end3_(other.end3_),
14407         current3_(other.current3_),
14408         begin4_(other.begin4_),
14409         end4_(other.end4_),
14410         current4_(other.current4_),
14411         begin5_(other.begin5_),
14412         end5_(other.end5_),
14413         current5_(other.current5_) {
14414       ComputeCurrentValue();
14415     }
14416 
14417     void ComputeCurrentValue() {
14418       if (!AtEnd())
14419         current_value_ = ParamType(*current1_, *current2_, *current3_,
14420             *current4_, *current5_);
14421     }
14422     bool AtEnd() const {
14423       // We must report iterator past the end of the range when either of the
14424       // component iterators has reached the end of its range.
14425       return
14426           current1_ == end1_ ||
14427           current2_ == end2_ ||
14428           current3_ == end3_ ||
14429           current4_ == end4_ ||
14430           current5_ == end5_;
14431     }
14432 
14433     // No implementation - assignment is unsupported.
14434     void operator=(const Iterator& other);
14435 
14436     const ParamGeneratorInterface<ParamType>* const base_;
14437     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14438     // current[i]_ is the actual traversing iterator.
14439     const typename ParamGenerator<T1>::iterator begin1_;
14440     const typename ParamGenerator<T1>::iterator end1_;
14441     typename ParamGenerator<T1>::iterator current1_;
14442     const typename ParamGenerator<T2>::iterator begin2_;
14443     const typename ParamGenerator<T2>::iterator end2_;
14444     typename ParamGenerator<T2>::iterator current2_;
14445     const typename ParamGenerator<T3>::iterator begin3_;
14446     const typename ParamGenerator<T3>::iterator end3_;
14447     typename ParamGenerator<T3>::iterator current3_;
14448     const typename ParamGenerator<T4>::iterator begin4_;
14449     const typename ParamGenerator<T4>::iterator end4_;
14450     typename ParamGenerator<T4>::iterator current4_;
14451     const typename ParamGenerator<T5>::iterator begin5_;
14452     const typename ParamGenerator<T5>::iterator end5_;
14453     typename ParamGenerator<T5>::iterator current5_;
14454     ParamType current_value_;
14455   };  // class CartesianProductGenerator5::Iterator
14456 
14457   // No implementation - assignment is unsupported.
14458   void operator=(const CartesianProductGenerator5& other);
14459 
14460   const ParamGenerator<T1> g1_;
14461   const ParamGenerator<T2> g2_;
14462   const ParamGenerator<T3> g3_;
14463   const ParamGenerator<T4> g4_;
14464   const ParamGenerator<T5> g5_;
14465 };  // class CartesianProductGenerator5
14466 
14467 
14468 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14469     typename T6>
14470 class CartesianProductGenerator6
14471     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14472         T6> > {
14473  public:
14474   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14475 
14476   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14477       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14478       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14479       const ParamGenerator<T6>& g6)
14480       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14481   virtual ~CartesianProductGenerator6() {}
14482 
14483   virtual ParamIteratorInterface<ParamType>* Begin() const {
14484     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14485         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14486   }
14487   virtual ParamIteratorInterface<ParamType>* End() const {
14488     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14489         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14490   }
14491 
14492  private:
14493   class Iterator : public ParamIteratorInterface<ParamType> {
14494    public:
14495     Iterator(const ParamGeneratorInterface<ParamType>* base,
14496       const ParamGenerator<T1>& g1,
14497       const typename ParamGenerator<T1>::iterator& current1,
14498       const ParamGenerator<T2>& g2,
14499       const typename ParamGenerator<T2>::iterator& current2,
14500       const ParamGenerator<T3>& g3,
14501       const typename ParamGenerator<T3>::iterator& current3,
14502       const ParamGenerator<T4>& g4,
14503       const typename ParamGenerator<T4>::iterator& current4,
14504       const ParamGenerator<T5>& g5,
14505       const typename ParamGenerator<T5>::iterator& current5,
14506       const ParamGenerator<T6>& g6,
14507       const typename ParamGenerator<T6>::iterator& current6)
14508         : base_(base),
14509           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14510           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14511           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14512           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14513           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14514           begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
14515       ComputeCurrentValue();
14516     }
14517     virtual ~Iterator() {}
14518 
14519     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14520       return base_;
14521     }
14522     // Advance should not be called on beyond-of-range iterators
14523     // so no component iterators must be beyond end of range, either.
14524     virtual void Advance() {
14525       assert(!AtEnd());
14526       ++current6_;
14527       if (current6_ == end6_) {
14528         current6_ = begin6_;
14529         ++current5_;
14530       }
14531       if (current5_ == end5_) {
14532         current5_ = begin5_;
14533         ++current4_;
14534       }
14535       if (current4_ == end4_) {
14536         current4_ = begin4_;
14537         ++current3_;
14538       }
14539       if (current3_ == end3_) {
14540         current3_ = begin3_;
14541         ++current2_;
14542       }
14543       if (current2_ == end2_) {
14544         current2_ = begin2_;
14545         ++current1_;
14546       }
14547       ComputeCurrentValue();
14548     }
14549     virtual ParamIteratorInterface<ParamType>* Clone() const {
14550       return new Iterator(*this);
14551     }
14552     virtual const ParamType* Current() const { return &current_value_; }
14553     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14554       // Having the same base generator guarantees that the other
14555       // iterator is of the same type and we can downcast.
14556       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14557           << "The program attempted to compare iterators "
14558           << "from different generators." << std::endl;
14559       const Iterator* typed_other =
14560           CheckedDowncastToActualType<const Iterator>(&other);
14561       // We must report iterators equal if they both point beyond their
14562       // respective ranges. That can happen in a variety of fashions,
14563       // so we have to consult AtEnd().
14564       return (AtEnd() && typed_other->AtEnd()) ||
14565          (
14566           current1_ == typed_other->current1_ &&
14567           current2_ == typed_other->current2_ &&
14568           current3_ == typed_other->current3_ &&
14569           current4_ == typed_other->current4_ &&
14570           current5_ == typed_other->current5_ &&
14571           current6_ == typed_other->current6_);
14572     }
14573 
14574    private:
14575     Iterator(const Iterator& other)
14576         : base_(other.base_),
14577         begin1_(other.begin1_),
14578         end1_(other.end1_),
14579         current1_(other.current1_),
14580         begin2_(other.begin2_),
14581         end2_(other.end2_),
14582         current2_(other.current2_),
14583         begin3_(other.begin3_),
14584         end3_(other.end3_),
14585         current3_(other.current3_),
14586         begin4_(other.begin4_),
14587         end4_(other.end4_),
14588         current4_(other.current4_),
14589         begin5_(other.begin5_),
14590         end5_(other.end5_),
14591         current5_(other.current5_),
14592         begin6_(other.begin6_),
14593         end6_(other.end6_),
14594         current6_(other.current6_) {
14595       ComputeCurrentValue();
14596     }
14597 
14598     void ComputeCurrentValue() {
14599       if (!AtEnd())
14600         current_value_ = ParamType(*current1_, *current2_, *current3_,
14601             *current4_, *current5_, *current6_);
14602     }
14603     bool AtEnd() const {
14604       // We must report iterator past the end of the range when either of the
14605       // component iterators has reached the end of its range.
14606       return
14607           current1_ == end1_ ||
14608           current2_ == end2_ ||
14609           current3_ == end3_ ||
14610           current4_ == end4_ ||
14611           current5_ == end5_ ||
14612           current6_ == end6_;
14613     }
14614 
14615     // No implementation - assignment is unsupported.
14616     void operator=(const Iterator& other);
14617 
14618     const ParamGeneratorInterface<ParamType>* const base_;
14619     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14620     // current[i]_ is the actual traversing iterator.
14621     const typename ParamGenerator<T1>::iterator begin1_;
14622     const typename ParamGenerator<T1>::iterator end1_;
14623     typename ParamGenerator<T1>::iterator current1_;
14624     const typename ParamGenerator<T2>::iterator begin2_;
14625     const typename ParamGenerator<T2>::iterator end2_;
14626     typename ParamGenerator<T2>::iterator current2_;
14627     const typename ParamGenerator<T3>::iterator begin3_;
14628     const typename ParamGenerator<T3>::iterator end3_;
14629     typename ParamGenerator<T3>::iterator current3_;
14630     const typename ParamGenerator<T4>::iterator begin4_;
14631     const typename ParamGenerator<T4>::iterator end4_;
14632     typename ParamGenerator<T4>::iterator current4_;
14633     const typename ParamGenerator<T5>::iterator begin5_;
14634     const typename ParamGenerator<T5>::iterator end5_;
14635     typename ParamGenerator<T5>::iterator current5_;
14636     const typename ParamGenerator<T6>::iterator begin6_;
14637     const typename ParamGenerator<T6>::iterator end6_;
14638     typename ParamGenerator<T6>::iterator current6_;
14639     ParamType current_value_;
14640   };  // class CartesianProductGenerator6::Iterator
14641 
14642   // No implementation - assignment is unsupported.
14643   void operator=(const CartesianProductGenerator6& other);
14644 
14645   const ParamGenerator<T1> g1_;
14646   const ParamGenerator<T2> g2_;
14647   const ParamGenerator<T3> g3_;
14648   const ParamGenerator<T4> g4_;
14649   const ParamGenerator<T5> g5_;
14650   const ParamGenerator<T6> g6_;
14651 };  // class CartesianProductGenerator6
14652 
14653 
14654 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14655     typename T6, typename T7>
14656 class CartesianProductGenerator7
14657     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14658         T7> > {
14659  public:
14660   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14661 
14662   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14663       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14664       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14665       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14666       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14667   virtual ~CartesianProductGenerator7() {}
14668 
14669   virtual ParamIteratorInterface<ParamType>* Begin() const {
14670     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14671         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14672         g7_.begin());
14673   }
14674   virtual ParamIteratorInterface<ParamType>* End() const {
14675     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14676         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14677   }
14678 
14679  private:
14680   class Iterator : public ParamIteratorInterface<ParamType> {
14681    public:
14682     Iterator(const ParamGeneratorInterface<ParamType>* base,
14683       const ParamGenerator<T1>& g1,
14684       const typename ParamGenerator<T1>::iterator& current1,
14685       const ParamGenerator<T2>& g2,
14686       const typename ParamGenerator<T2>::iterator& current2,
14687       const ParamGenerator<T3>& g3,
14688       const typename ParamGenerator<T3>::iterator& current3,
14689       const ParamGenerator<T4>& g4,
14690       const typename ParamGenerator<T4>::iterator& current4,
14691       const ParamGenerator<T5>& g5,
14692       const typename ParamGenerator<T5>::iterator& current5,
14693       const ParamGenerator<T6>& g6,
14694       const typename ParamGenerator<T6>::iterator& current6,
14695       const ParamGenerator<T7>& g7,
14696       const typename ParamGenerator<T7>::iterator& current7)
14697         : base_(base),
14698           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14699           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14700           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14701           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14702           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14703           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14704           begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
14705       ComputeCurrentValue();
14706     }
14707     virtual ~Iterator() {}
14708 
14709     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14710       return base_;
14711     }
14712     // Advance should not be called on beyond-of-range iterators
14713     // so no component iterators must be beyond end of range, either.
14714     virtual void Advance() {
14715       assert(!AtEnd());
14716       ++current7_;
14717       if (current7_ == end7_) {
14718         current7_ = begin7_;
14719         ++current6_;
14720       }
14721       if (current6_ == end6_) {
14722         current6_ = begin6_;
14723         ++current5_;
14724       }
14725       if (current5_ == end5_) {
14726         current5_ = begin5_;
14727         ++current4_;
14728       }
14729       if (current4_ == end4_) {
14730         current4_ = begin4_;
14731         ++current3_;
14732       }
14733       if (current3_ == end3_) {
14734         current3_ = begin3_;
14735         ++current2_;
14736       }
14737       if (current2_ == end2_) {
14738         current2_ = begin2_;
14739         ++current1_;
14740       }
14741       ComputeCurrentValue();
14742     }
14743     virtual ParamIteratorInterface<ParamType>* Clone() const {
14744       return new Iterator(*this);
14745     }
14746     virtual const ParamType* Current() const { return &current_value_; }
14747     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14748       // Having the same base generator guarantees that the other
14749       // iterator is of the same type and we can downcast.
14750       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14751           << "The program attempted to compare iterators "
14752           << "from different generators." << std::endl;
14753       const Iterator* typed_other =
14754           CheckedDowncastToActualType<const Iterator>(&other);
14755       // We must report iterators equal if they both point beyond their
14756       // respective ranges. That can happen in a variety of fashions,
14757       // so we have to consult AtEnd().
14758       return (AtEnd() && typed_other->AtEnd()) ||
14759          (
14760           current1_ == typed_other->current1_ &&
14761           current2_ == typed_other->current2_ &&
14762           current3_ == typed_other->current3_ &&
14763           current4_ == typed_other->current4_ &&
14764           current5_ == typed_other->current5_ &&
14765           current6_ == typed_other->current6_ &&
14766           current7_ == typed_other->current7_);
14767     }
14768 
14769    private:
14770     Iterator(const Iterator& other)
14771         : base_(other.base_),
14772         begin1_(other.begin1_),
14773         end1_(other.end1_),
14774         current1_(other.current1_),
14775         begin2_(other.begin2_),
14776         end2_(other.end2_),
14777         current2_(other.current2_),
14778         begin3_(other.begin3_),
14779         end3_(other.end3_),
14780         current3_(other.current3_),
14781         begin4_(other.begin4_),
14782         end4_(other.end4_),
14783         current4_(other.current4_),
14784         begin5_(other.begin5_),
14785         end5_(other.end5_),
14786         current5_(other.current5_),
14787         begin6_(other.begin6_),
14788         end6_(other.end6_),
14789         current6_(other.current6_),
14790         begin7_(other.begin7_),
14791         end7_(other.end7_),
14792         current7_(other.current7_) {
14793       ComputeCurrentValue();
14794     }
14795 
14796     void ComputeCurrentValue() {
14797       if (!AtEnd())
14798         current_value_ = ParamType(*current1_, *current2_, *current3_,
14799             *current4_, *current5_, *current6_, *current7_);
14800     }
14801     bool AtEnd() const {
14802       // We must report iterator past the end of the range when either of the
14803       // component iterators has reached the end of its range.
14804       return
14805           current1_ == end1_ ||
14806           current2_ == end2_ ||
14807           current3_ == end3_ ||
14808           current4_ == end4_ ||
14809           current5_ == end5_ ||
14810           current6_ == end6_ ||
14811           current7_ == end7_;
14812     }
14813 
14814     // No implementation - assignment is unsupported.
14815     void operator=(const Iterator& other);
14816 
14817     const ParamGeneratorInterface<ParamType>* const base_;
14818     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14819     // current[i]_ is the actual traversing iterator.
14820     const typename ParamGenerator<T1>::iterator begin1_;
14821     const typename ParamGenerator<T1>::iterator end1_;
14822     typename ParamGenerator<T1>::iterator current1_;
14823     const typename ParamGenerator<T2>::iterator begin2_;
14824     const typename ParamGenerator<T2>::iterator end2_;
14825     typename ParamGenerator<T2>::iterator current2_;
14826     const typename ParamGenerator<T3>::iterator begin3_;
14827     const typename ParamGenerator<T3>::iterator end3_;
14828     typename ParamGenerator<T3>::iterator current3_;
14829     const typename ParamGenerator<T4>::iterator begin4_;
14830     const typename ParamGenerator<T4>::iterator end4_;
14831     typename ParamGenerator<T4>::iterator current4_;
14832     const typename ParamGenerator<T5>::iterator begin5_;
14833     const typename ParamGenerator<T5>::iterator end5_;
14834     typename ParamGenerator<T5>::iterator current5_;
14835     const typename ParamGenerator<T6>::iterator begin6_;
14836     const typename ParamGenerator<T6>::iterator end6_;
14837     typename ParamGenerator<T6>::iterator current6_;
14838     const typename ParamGenerator<T7>::iterator begin7_;
14839     const typename ParamGenerator<T7>::iterator end7_;
14840     typename ParamGenerator<T7>::iterator current7_;
14841     ParamType current_value_;
14842   };  // class CartesianProductGenerator7::Iterator
14843 
14844   // No implementation - assignment is unsupported.
14845   void operator=(const CartesianProductGenerator7& other);
14846 
14847   const ParamGenerator<T1> g1_;
14848   const ParamGenerator<T2> g2_;
14849   const ParamGenerator<T3> g3_;
14850   const ParamGenerator<T4> g4_;
14851   const ParamGenerator<T5> g5_;
14852   const ParamGenerator<T6> g6_;
14853   const ParamGenerator<T7> g7_;
14854 };  // class CartesianProductGenerator7
14855 
14856 
14857 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14858     typename T6, typename T7, typename T8>
14859 class CartesianProductGenerator8
14860     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14861         T7, T8> > {
14862  public:
14863   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14864 
14865   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14866       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14867       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14868       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14869       const ParamGenerator<T8>& g8)
14870       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14871           g8_(g8) {}
14872   virtual ~CartesianProductGenerator8() {}
14873 
14874   virtual ParamIteratorInterface<ParamType>* Begin() const {
14875     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14876         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14877         g7_.begin(), g8_, g8_.begin());
14878   }
14879   virtual ParamIteratorInterface<ParamType>* End() const {
14880     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14881         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14882         g8_.end());
14883   }
14884 
14885  private:
14886   class Iterator : public ParamIteratorInterface<ParamType> {
14887    public:
14888     Iterator(const ParamGeneratorInterface<ParamType>* base,
14889       const ParamGenerator<T1>& g1,
14890       const typename ParamGenerator<T1>::iterator& current1,
14891       const ParamGenerator<T2>& g2,
14892       const typename ParamGenerator<T2>::iterator& current2,
14893       const ParamGenerator<T3>& g3,
14894       const typename ParamGenerator<T3>::iterator& current3,
14895       const ParamGenerator<T4>& g4,
14896       const typename ParamGenerator<T4>::iterator& current4,
14897       const ParamGenerator<T5>& g5,
14898       const typename ParamGenerator<T5>::iterator& current5,
14899       const ParamGenerator<T6>& g6,
14900       const typename ParamGenerator<T6>::iterator& current6,
14901       const ParamGenerator<T7>& g7,
14902       const typename ParamGenerator<T7>::iterator& current7,
14903       const ParamGenerator<T8>& g8,
14904       const typename ParamGenerator<T8>::iterator& current8)
14905         : base_(base),
14906           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14907           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14908           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14909           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14910           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14911           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14912           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14913           begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
14914       ComputeCurrentValue();
14915     }
14916     virtual ~Iterator() {}
14917 
14918     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14919       return base_;
14920     }
14921     // Advance should not be called on beyond-of-range iterators
14922     // so no component iterators must be beyond end of range, either.
14923     virtual void Advance() {
14924       assert(!AtEnd());
14925       ++current8_;
14926       if (current8_ == end8_) {
14927         current8_ = begin8_;
14928         ++current7_;
14929       }
14930       if (current7_ == end7_) {
14931         current7_ = begin7_;
14932         ++current6_;
14933       }
14934       if (current6_ == end6_) {
14935         current6_ = begin6_;
14936         ++current5_;
14937       }
14938       if (current5_ == end5_) {
14939         current5_ = begin5_;
14940         ++current4_;
14941       }
14942       if (current4_ == end4_) {
14943         current4_ = begin4_;
14944         ++current3_;
14945       }
14946       if (current3_ == end3_) {
14947         current3_ = begin3_;
14948         ++current2_;
14949       }
14950       if (current2_ == end2_) {
14951         current2_ = begin2_;
14952         ++current1_;
14953       }
14954       ComputeCurrentValue();
14955     }
14956     virtual ParamIteratorInterface<ParamType>* Clone() const {
14957       return new Iterator(*this);
14958     }
14959     virtual const ParamType* Current() const { return &current_value_; }
14960     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14961       // Having the same base generator guarantees that the other
14962       // iterator is of the same type and we can downcast.
14963       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14964           << "The program attempted to compare iterators "
14965           << "from different generators." << std::endl;
14966       const Iterator* typed_other =
14967           CheckedDowncastToActualType<const Iterator>(&other);
14968       // We must report iterators equal if they both point beyond their
14969       // respective ranges. That can happen in a variety of fashions,
14970       // so we have to consult AtEnd().
14971       return (AtEnd() && typed_other->AtEnd()) ||
14972          (
14973           current1_ == typed_other->current1_ &&
14974           current2_ == typed_other->current2_ &&
14975           current3_ == typed_other->current3_ &&
14976           current4_ == typed_other->current4_ &&
14977           current5_ == typed_other->current5_ &&
14978           current6_ == typed_other->current6_ &&
14979           current7_ == typed_other->current7_ &&
14980           current8_ == typed_other->current8_);
14981     }
14982 
14983    private:
14984     Iterator(const Iterator& other)
14985         : base_(other.base_),
14986         begin1_(other.begin1_),
14987         end1_(other.end1_),
14988         current1_(other.current1_),
14989         begin2_(other.begin2_),
14990         end2_(other.end2_),
14991         current2_(other.current2_),
14992         begin3_(other.begin3_),
14993         end3_(other.end3_),
14994         current3_(other.current3_),
14995         begin4_(other.begin4_),
14996         end4_(other.end4_),
14997         current4_(other.current4_),
14998         begin5_(other.begin5_),
14999         end5_(other.end5_),
15000         current5_(other.current5_),
15001         begin6_(other.begin6_),
15002         end6_(other.end6_),
15003         current6_(other.current6_),
15004         begin7_(other.begin7_),
15005         end7_(other.end7_),
15006         current7_(other.current7_),
15007         begin8_(other.begin8_),
15008         end8_(other.end8_),
15009         current8_(other.current8_) {
15010       ComputeCurrentValue();
15011     }
15012 
15013     void ComputeCurrentValue() {
15014       if (!AtEnd())
15015         current_value_ = ParamType(*current1_, *current2_, *current3_,
15016             *current4_, *current5_, *current6_, *current7_, *current8_);
15017     }
15018     bool AtEnd() const {
15019       // We must report iterator past the end of the range when either of the
15020       // component iterators has reached the end of its range.
15021       return
15022           current1_ == end1_ ||
15023           current2_ == end2_ ||
15024           current3_ == end3_ ||
15025           current4_ == end4_ ||
15026           current5_ == end5_ ||
15027           current6_ == end6_ ||
15028           current7_ == end7_ ||
15029           current8_ == end8_;
15030     }
15031 
15032     // No implementation - assignment is unsupported.
15033     void operator=(const Iterator& other);
15034 
15035     const ParamGeneratorInterface<ParamType>* const base_;
15036     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15037     // current[i]_ is the actual traversing iterator.
15038     const typename ParamGenerator<T1>::iterator begin1_;
15039     const typename ParamGenerator<T1>::iterator end1_;
15040     typename ParamGenerator<T1>::iterator current1_;
15041     const typename ParamGenerator<T2>::iterator begin2_;
15042     const typename ParamGenerator<T2>::iterator end2_;
15043     typename ParamGenerator<T2>::iterator current2_;
15044     const typename ParamGenerator<T3>::iterator begin3_;
15045     const typename ParamGenerator<T3>::iterator end3_;
15046     typename ParamGenerator<T3>::iterator current3_;
15047     const typename ParamGenerator<T4>::iterator begin4_;
15048     const typename ParamGenerator<T4>::iterator end4_;
15049     typename ParamGenerator<T4>::iterator current4_;
15050     const typename ParamGenerator<T5>::iterator begin5_;
15051     const typename ParamGenerator<T5>::iterator end5_;
15052     typename ParamGenerator<T5>::iterator current5_;
15053     const typename ParamGenerator<T6>::iterator begin6_;
15054     const typename ParamGenerator<T6>::iterator end6_;
15055     typename ParamGenerator<T6>::iterator current6_;
15056     const typename ParamGenerator<T7>::iterator begin7_;
15057     const typename ParamGenerator<T7>::iterator end7_;
15058     typename ParamGenerator<T7>::iterator current7_;
15059     const typename ParamGenerator<T8>::iterator begin8_;
15060     const typename ParamGenerator<T8>::iterator end8_;
15061     typename ParamGenerator<T8>::iterator current8_;
15062     ParamType current_value_;
15063   };  // class CartesianProductGenerator8::Iterator
15064 
15065   // No implementation - assignment is unsupported.
15066   void operator=(const CartesianProductGenerator8& other);
15067 
15068   const ParamGenerator<T1> g1_;
15069   const ParamGenerator<T2> g2_;
15070   const ParamGenerator<T3> g3_;
15071   const ParamGenerator<T4> g4_;
15072   const ParamGenerator<T5> g5_;
15073   const ParamGenerator<T6> g6_;
15074   const ParamGenerator<T7> g7_;
15075   const ParamGenerator<T8> g8_;
15076 };  // class CartesianProductGenerator8
15077 
15078 
15079 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15080     typename T6, typename T7, typename T8, typename T9>
15081 class CartesianProductGenerator9
15082     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15083         T7, T8, T9> > {
15084  public:
15085   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
15086 
15087   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
15088       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15089       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15090       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15091       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
15092       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15093           g9_(g9) {}
15094   virtual ~CartesianProductGenerator9() {}
15095 
15096   virtual ParamIteratorInterface<ParamType>* Begin() const {
15097     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15098         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15099         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
15100   }
15101   virtual ParamIteratorInterface<ParamType>* End() const {
15102     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15103         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15104         g8_.end(), g9_, g9_.end());
15105   }
15106 
15107  private:
15108   class Iterator : public ParamIteratorInterface<ParamType> {
15109    public:
15110     Iterator(const ParamGeneratorInterface<ParamType>* base,
15111       const ParamGenerator<T1>& g1,
15112       const typename ParamGenerator<T1>::iterator& current1,
15113       const ParamGenerator<T2>& g2,
15114       const typename ParamGenerator<T2>::iterator& current2,
15115       const ParamGenerator<T3>& g3,
15116       const typename ParamGenerator<T3>::iterator& current3,
15117       const ParamGenerator<T4>& g4,
15118       const typename ParamGenerator<T4>::iterator& current4,
15119       const ParamGenerator<T5>& g5,
15120       const typename ParamGenerator<T5>::iterator& current5,
15121       const ParamGenerator<T6>& g6,
15122       const typename ParamGenerator<T6>::iterator& current6,
15123       const ParamGenerator<T7>& g7,
15124       const typename ParamGenerator<T7>::iterator& current7,
15125       const ParamGenerator<T8>& g8,
15126       const typename ParamGenerator<T8>::iterator& current8,
15127       const ParamGenerator<T9>& g9,
15128       const typename ParamGenerator<T9>::iterator& current9)
15129         : base_(base),
15130           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15131           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15132           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15133           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15134           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15135           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15136           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15137           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15138           begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
15139       ComputeCurrentValue();
15140     }
15141     virtual ~Iterator() {}
15142 
15143     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15144       return base_;
15145     }
15146     // Advance should not be called on beyond-of-range iterators
15147     // so no component iterators must be beyond end of range, either.
15148     virtual void Advance() {
15149       assert(!AtEnd());
15150       ++current9_;
15151       if (current9_ == end9_) {
15152         current9_ = begin9_;
15153         ++current8_;
15154       }
15155       if (current8_ == end8_) {
15156         current8_ = begin8_;
15157         ++current7_;
15158       }
15159       if (current7_ == end7_) {
15160         current7_ = begin7_;
15161         ++current6_;
15162       }
15163       if (current6_ == end6_) {
15164         current6_ = begin6_;
15165         ++current5_;
15166       }
15167       if (current5_ == end5_) {
15168         current5_ = begin5_;
15169         ++current4_;
15170       }
15171       if (current4_ == end4_) {
15172         current4_ = begin4_;
15173         ++current3_;
15174       }
15175       if (current3_ == end3_) {
15176         current3_ = begin3_;
15177         ++current2_;
15178       }
15179       if (current2_ == end2_) {
15180         current2_ = begin2_;
15181         ++current1_;
15182       }
15183       ComputeCurrentValue();
15184     }
15185     virtual ParamIteratorInterface<ParamType>* Clone() const {
15186       return new Iterator(*this);
15187     }
15188     virtual const ParamType* Current() const { return &current_value_; }
15189     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15190       // Having the same base generator guarantees that the other
15191       // iterator is of the same type and we can downcast.
15192       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15193           << "The program attempted to compare iterators "
15194           << "from different generators." << std::endl;
15195       const Iterator* typed_other =
15196           CheckedDowncastToActualType<const Iterator>(&other);
15197       // We must report iterators equal if they both point beyond their
15198       // respective ranges. That can happen in a variety of fashions,
15199       // so we have to consult AtEnd().
15200       return (AtEnd() && typed_other->AtEnd()) ||
15201          (
15202           current1_ == typed_other->current1_ &&
15203           current2_ == typed_other->current2_ &&
15204           current3_ == typed_other->current3_ &&
15205           current4_ == typed_other->current4_ &&
15206           current5_ == typed_other->current5_ &&
15207           current6_ == typed_other->current6_ &&
15208           current7_ == typed_other->current7_ &&
15209           current8_ == typed_other->current8_ &&
15210           current9_ == typed_other->current9_);
15211     }
15212 
15213    private:
15214     Iterator(const Iterator& other)
15215         : base_(other.base_),
15216         begin1_(other.begin1_),
15217         end1_(other.end1_),
15218         current1_(other.current1_),
15219         begin2_(other.begin2_),
15220         end2_(other.end2_),
15221         current2_(other.current2_),
15222         begin3_(other.begin3_),
15223         end3_(other.end3_),
15224         current3_(other.current3_),
15225         begin4_(other.begin4_),
15226         end4_(other.end4_),
15227         current4_(other.current4_),
15228         begin5_(other.begin5_),
15229         end5_(other.end5_),
15230         current5_(other.current5_),
15231         begin6_(other.begin6_),
15232         end6_(other.end6_),
15233         current6_(other.current6_),
15234         begin7_(other.begin7_),
15235         end7_(other.end7_),
15236         current7_(other.current7_),
15237         begin8_(other.begin8_),
15238         end8_(other.end8_),
15239         current8_(other.current8_),
15240         begin9_(other.begin9_),
15241         end9_(other.end9_),
15242         current9_(other.current9_) {
15243       ComputeCurrentValue();
15244     }
15245 
15246     void ComputeCurrentValue() {
15247       if (!AtEnd())
15248         current_value_ = ParamType(*current1_, *current2_, *current3_,
15249             *current4_, *current5_, *current6_, *current7_, *current8_,
15250             *current9_);
15251     }
15252     bool AtEnd() const {
15253       // We must report iterator past the end of the range when either of the
15254       // component iterators has reached the end of its range.
15255       return
15256           current1_ == end1_ ||
15257           current2_ == end2_ ||
15258           current3_ == end3_ ||
15259           current4_ == end4_ ||
15260           current5_ == end5_ ||
15261           current6_ == end6_ ||
15262           current7_ == end7_ ||
15263           current8_ == end8_ ||
15264           current9_ == end9_;
15265     }
15266 
15267     // No implementation - assignment is unsupported.
15268     void operator=(const Iterator& other);
15269 
15270     const ParamGeneratorInterface<ParamType>* const base_;
15271     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15272     // current[i]_ is the actual traversing iterator.
15273     const typename ParamGenerator<T1>::iterator begin1_;
15274     const typename ParamGenerator<T1>::iterator end1_;
15275     typename ParamGenerator<T1>::iterator current1_;
15276     const typename ParamGenerator<T2>::iterator begin2_;
15277     const typename ParamGenerator<T2>::iterator end2_;
15278     typename ParamGenerator<T2>::iterator current2_;
15279     const typename ParamGenerator<T3>::iterator begin3_;
15280     const typename ParamGenerator<T3>::iterator end3_;
15281     typename ParamGenerator<T3>::iterator current3_;
15282     const typename ParamGenerator<T4>::iterator begin4_;
15283     const typename ParamGenerator<T4>::iterator end4_;
15284     typename ParamGenerator<T4>::iterator current4_;
15285     const typename ParamGenerator<T5>::iterator begin5_;
15286     const typename ParamGenerator<T5>::iterator end5_;
15287     typename ParamGenerator<T5>::iterator current5_;
15288     const typename ParamGenerator<T6>::iterator begin6_;
15289     const typename ParamGenerator<T6>::iterator end6_;
15290     typename ParamGenerator<T6>::iterator current6_;
15291     const typename ParamGenerator<T7>::iterator begin7_;
15292     const typename ParamGenerator<T7>::iterator end7_;
15293     typename ParamGenerator<T7>::iterator current7_;
15294     const typename ParamGenerator<T8>::iterator begin8_;
15295     const typename ParamGenerator<T8>::iterator end8_;
15296     typename ParamGenerator<T8>::iterator current8_;
15297     const typename ParamGenerator<T9>::iterator begin9_;
15298     const typename ParamGenerator<T9>::iterator end9_;
15299     typename ParamGenerator<T9>::iterator current9_;
15300     ParamType current_value_;
15301   };  // class CartesianProductGenerator9::Iterator
15302 
15303   // No implementation - assignment is unsupported.
15304   void operator=(const CartesianProductGenerator9& other);
15305 
15306   const ParamGenerator<T1> g1_;
15307   const ParamGenerator<T2> g2_;
15308   const ParamGenerator<T3> g3_;
15309   const ParamGenerator<T4> g4_;
15310   const ParamGenerator<T5> g5_;
15311   const ParamGenerator<T6> g6_;
15312   const ParamGenerator<T7> g7_;
15313   const ParamGenerator<T8> g8_;
15314   const ParamGenerator<T9> g9_;
15315 };  // class CartesianProductGenerator9
15316 
15317 
15318 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15319     typename T6, typename T7, typename T8, typename T9, typename T10>
15320 class CartesianProductGenerator10
15321     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15322         T7, T8, T9, T10> > {
15323  public:
15324   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15325 
15326   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15327       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15328       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15329       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15330       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15331       const ParamGenerator<T10>& g10)
15332       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15333           g9_(g9), g10_(g10) {}
15334   virtual ~CartesianProductGenerator10() {}
15335 
15336   virtual ParamIteratorInterface<ParamType>* Begin() const {
15337     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15338         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15339         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15340   }
15341   virtual ParamIteratorInterface<ParamType>* End() const {
15342     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15343         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15344         g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15345   }
15346 
15347  private:
15348   class Iterator : public ParamIteratorInterface<ParamType> {
15349    public:
15350     Iterator(const ParamGeneratorInterface<ParamType>* base,
15351       const ParamGenerator<T1>& g1,
15352       const typename ParamGenerator<T1>::iterator& current1,
15353       const ParamGenerator<T2>& g2,
15354       const typename ParamGenerator<T2>::iterator& current2,
15355       const ParamGenerator<T3>& g3,
15356       const typename ParamGenerator<T3>::iterator& current3,
15357       const ParamGenerator<T4>& g4,
15358       const typename ParamGenerator<T4>::iterator& current4,
15359       const ParamGenerator<T5>& g5,
15360       const typename ParamGenerator<T5>::iterator& current5,
15361       const ParamGenerator<T6>& g6,
15362       const typename ParamGenerator<T6>::iterator& current6,
15363       const ParamGenerator<T7>& g7,
15364       const typename ParamGenerator<T7>::iterator& current7,
15365       const ParamGenerator<T8>& g8,
15366       const typename ParamGenerator<T8>::iterator& current8,
15367       const ParamGenerator<T9>& g9,
15368       const typename ParamGenerator<T9>::iterator& current9,
15369       const ParamGenerator<T10>& g10,
15370       const typename ParamGenerator<T10>::iterator& current10)
15371         : base_(base),
15372           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15373           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15374           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15375           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15376           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15377           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15378           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15379           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15380           begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15381           begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
15382       ComputeCurrentValue();
15383     }
15384     virtual ~Iterator() {}
15385 
15386     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15387       return base_;
15388     }
15389     // Advance should not be called on beyond-of-range iterators
15390     // so no component iterators must be beyond end of range, either.
15391     virtual void Advance() {
15392       assert(!AtEnd());
15393       ++current10_;
15394       if (current10_ == end10_) {
15395         current10_ = begin10_;
15396         ++current9_;
15397       }
15398       if (current9_ == end9_) {
15399         current9_ = begin9_;
15400         ++current8_;
15401       }
15402       if (current8_ == end8_) {
15403         current8_ = begin8_;
15404         ++current7_;
15405       }
15406       if (current7_ == end7_) {
15407         current7_ = begin7_;
15408         ++current6_;
15409       }
15410       if (current6_ == end6_) {
15411         current6_ = begin6_;
15412         ++current5_;
15413       }
15414       if (current5_ == end5_) {
15415         current5_ = begin5_;
15416         ++current4_;
15417       }
15418       if (current4_ == end4_) {
15419         current4_ = begin4_;
15420         ++current3_;
15421       }
15422       if (current3_ == end3_) {
15423         current3_ = begin3_;
15424         ++current2_;
15425       }
15426       if (current2_ == end2_) {
15427         current2_ = begin2_;
15428         ++current1_;
15429       }
15430       ComputeCurrentValue();
15431     }
15432     virtual ParamIteratorInterface<ParamType>* Clone() const {
15433       return new Iterator(*this);
15434     }
15435     virtual const ParamType* Current() const { return &current_value_; }
15436     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15437       // Having the same base generator guarantees that the other
15438       // iterator is of the same type and we can downcast.
15439       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15440           << "The program attempted to compare iterators "
15441           << "from different generators." << std::endl;
15442       const Iterator* typed_other =
15443           CheckedDowncastToActualType<const Iterator>(&other);
15444       // We must report iterators equal if they both point beyond their
15445       // respective ranges. That can happen in a variety of fashions,
15446       // so we have to consult AtEnd().
15447       return (AtEnd() && typed_other->AtEnd()) ||
15448          (
15449           current1_ == typed_other->current1_ &&
15450           current2_ == typed_other->current2_ &&
15451           current3_ == typed_other->current3_ &&
15452           current4_ == typed_other->current4_ &&
15453           current5_ == typed_other->current5_ &&
15454           current6_ == typed_other->current6_ &&
15455           current7_ == typed_other->current7_ &&
15456           current8_ == typed_other->current8_ &&
15457           current9_ == typed_other->current9_ &&
15458           current10_ == typed_other->current10_);
15459     }
15460 
15461    private:
15462     Iterator(const Iterator& other)
15463         : base_(other.base_),
15464         begin1_(other.begin1_),
15465         end1_(other.end1_),
15466         current1_(other.current1_),
15467         begin2_(other.begin2_),
15468         end2_(other.end2_),
15469         current2_(other.current2_),
15470         begin3_(other.begin3_),
15471         end3_(other.end3_),
15472         current3_(other.current3_),
15473         begin4_(other.begin4_),
15474         end4_(other.end4_),
15475         current4_(other.current4_),
15476         begin5_(other.begin5_),
15477         end5_(other.end5_),
15478         current5_(other.current5_),
15479         begin6_(other.begin6_),
15480         end6_(other.end6_),
15481         current6_(other.current6_),
15482         begin7_(other.begin7_),
15483         end7_(other.end7_),
15484         current7_(other.current7_),
15485         begin8_(other.begin8_),
15486         end8_(other.end8_),
15487         current8_(other.current8_),
15488         begin9_(other.begin9_),
15489         end9_(other.end9_),
15490         current9_(other.current9_),
15491         begin10_(other.begin10_),
15492         end10_(other.end10_),
15493         current10_(other.current10_) {
15494       ComputeCurrentValue();
15495     }
15496 
15497     void ComputeCurrentValue() {
15498       if (!AtEnd())
15499         current_value_ = ParamType(*current1_, *current2_, *current3_,
15500             *current4_, *current5_, *current6_, *current7_, *current8_,
15501             *current9_, *current10_);
15502     }
15503     bool AtEnd() const {
15504       // We must report iterator past the end of the range when either of the
15505       // component iterators has reached the end of its range.
15506       return
15507           current1_ == end1_ ||
15508           current2_ == end2_ ||
15509           current3_ == end3_ ||
15510           current4_ == end4_ ||
15511           current5_ == end5_ ||
15512           current6_ == end6_ ||
15513           current7_ == end7_ ||
15514           current8_ == end8_ ||
15515           current9_ == end9_ ||
15516           current10_ == end10_;
15517     }
15518 
15519     // No implementation - assignment is unsupported.
15520     void operator=(const Iterator& other);
15521 
15522     const ParamGeneratorInterface<ParamType>* const base_;
15523     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15524     // current[i]_ is the actual traversing iterator.
15525     const typename ParamGenerator<T1>::iterator begin1_;
15526     const typename ParamGenerator<T1>::iterator end1_;
15527     typename ParamGenerator<T1>::iterator current1_;
15528     const typename ParamGenerator<T2>::iterator begin2_;
15529     const typename ParamGenerator<T2>::iterator end2_;
15530     typename ParamGenerator<T2>::iterator current2_;
15531     const typename ParamGenerator<T3>::iterator begin3_;
15532     const typename ParamGenerator<T3>::iterator end3_;
15533     typename ParamGenerator<T3>::iterator current3_;
15534     const typename ParamGenerator<T4>::iterator begin4_;
15535     const typename ParamGenerator<T4>::iterator end4_;
15536     typename ParamGenerator<T4>::iterator current4_;
15537     const typename ParamGenerator<T5>::iterator begin5_;
15538     const typename ParamGenerator<T5>::iterator end5_;
15539     typename ParamGenerator<T5>::iterator current5_;
15540     const typename ParamGenerator<T6>::iterator begin6_;
15541     const typename ParamGenerator<T6>::iterator end6_;
15542     typename ParamGenerator<T6>::iterator current6_;
15543     const typename ParamGenerator<T7>::iterator begin7_;
15544     const typename ParamGenerator<T7>::iterator end7_;
15545     typename ParamGenerator<T7>::iterator current7_;
15546     const typename ParamGenerator<T8>::iterator begin8_;
15547     const typename ParamGenerator<T8>::iterator end8_;
15548     typename ParamGenerator<T8>::iterator current8_;
15549     const typename ParamGenerator<T9>::iterator begin9_;
15550     const typename ParamGenerator<T9>::iterator end9_;
15551     typename ParamGenerator<T9>::iterator current9_;
15552     const typename ParamGenerator<T10>::iterator begin10_;
15553     const typename ParamGenerator<T10>::iterator end10_;
15554     typename ParamGenerator<T10>::iterator current10_;
15555     ParamType current_value_;
15556   };  // class CartesianProductGenerator10::Iterator
15557 
15558   // No implementation - assignment is unsupported.
15559   void operator=(const CartesianProductGenerator10& other);
15560 
15561   const ParamGenerator<T1> g1_;
15562   const ParamGenerator<T2> g2_;
15563   const ParamGenerator<T3> g3_;
15564   const ParamGenerator<T4> g4_;
15565   const ParamGenerator<T5> g5_;
15566   const ParamGenerator<T6> g6_;
15567   const ParamGenerator<T7> g7_;
15568   const ParamGenerator<T8> g8_;
15569   const ParamGenerator<T9> g9_;
15570   const ParamGenerator<T10> g10_;
15571 };  // class CartesianProductGenerator10
15572 
15573 
15574 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15575 //
15576 // Helper classes providing Combine() with polymorphic features. They allow
15577 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15578 // convertible to U.
15579 //
15580 template <class Generator1, class Generator2>
15581 class CartesianProductHolder2 {
15582  public:
15583 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15584       : g1_(g1), g2_(g2) {}
15585   template <typename T1, typename T2>
15586   operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15587     return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15588         new CartesianProductGenerator2<T1, T2>(
15589         static_cast<ParamGenerator<T1> >(g1_),
15590         static_cast<ParamGenerator<T2> >(g2_)));
15591   }
15592 
15593  private:
15594   // No implementation - assignment is unsupported.
15595   void operator=(const CartesianProductHolder2& other);
15596 
15597   const Generator1 g1_;
15598   const Generator2 g2_;
15599 };  // class CartesianProductHolder2
15600 
15601 template <class Generator1, class Generator2, class Generator3>
15602 class CartesianProductHolder3 {
15603  public:
15604 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15605     const Generator3& g3)
15606       : g1_(g1), g2_(g2), g3_(g3) {}
15607   template <typename T1, typename T2, typename T3>
15608   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15609     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15610         new CartesianProductGenerator3<T1, T2, T3>(
15611         static_cast<ParamGenerator<T1> >(g1_),
15612         static_cast<ParamGenerator<T2> >(g2_),
15613         static_cast<ParamGenerator<T3> >(g3_)));
15614   }
15615 
15616  private:
15617   // No implementation - assignment is unsupported.
15618   void operator=(const CartesianProductHolder3& other);
15619 
15620   const Generator1 g1_;
15621   const Generator2 g2_;
15622   const Generator3 g3_;
15623 };  // class CartesianProductHolder3
15624 
15625 template <class Generator1, class Generator2, class Generator3,
15626     class Generator4>
15627 class CartesianProductHolder4 {
15628  public:
15629 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15630     const Generator3& g3, const Generator4& g4)
15631       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15632   template <typename T1, typename T2, typename T3, typename T4>
15633   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15634     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15635         new CartesianProductGenerator4<T1, T2, T3, T4>(
15636         static_cast<ParamGenerator<T1> >(g1_),
15637         static_cast<ParamGenerator<T2> >(g2_),
15638         static_cast<ParamGenerator<T3> >(g3_),
15639         static_cast<ParamGenerator<T4> >(g4_)));
15640   }
15641 
15642  private:
15643   // No implementation - assignment is unsupported.
15644   void operator=(const CartesianProductHolder4& other);
15645 
15646   const Generator1 g1_;
15647   const Generator2 g2_;
15648   const Generator3 g3_;
15649   const Generator4 g4_;
15650 };  // class CartesianProductHolder4
15651 
15652 template <class Generator1, class Generator2, class Generator3,
15653     class Generator4, class Generator5>
15654 class CartesianProductHolder5 {
15655  public:
15656 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15657     const Generator3& g3, const Generator4& g4, const Generator5& g5)
15658       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15659   template <typename T1, typename T2, typename T3, typename T4, typename T5>
15660   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15661     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15662         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15663         static_cast<ParamGenerator<T1> >(g1_),
15664         static_cast<ParamGenerator<T2> >(g2_),
15665         static_cast<ParamGenerator<T3> >(g3_),
15666         static_cast<ParamGenerator<T4> >(g4_),
15667         static_cast<ParamGenerator<T5> >(g5_)));
15668   }
15669 
15670  private:
15671   // No implementation - assignment is unsupported.
15672   void operator=(const CartesianProductHolder5& other);
15673 
15674   const Generator1 g1_;
15675   const Generator2 g2_;
15676   const Generator3 g3_;
15677   const Generator4 g4_;
15678   const Generator5 g5_;
15679 };  // class CartesianProductHolder5
15680 
15681 template <class Generator1, class Generator2, class Generator3,
15682     class Generator4, class Generator5, class Generator6>
15683 class CartesianProductHolder6 {
15684  public:
15685 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15686     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15687     const Generator6& g6)
15688       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15689   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15690       typename T6>
15691   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15692     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15693         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15694         static_cast<ParamGenerator<T1> >(g1_),
15695         static_cast<ParamGenerator<T2> >(g2_),
15696         static_cast<ParamGenerator<T3> >(g3_),
15697         static_cast<ParamGenerator<T4> >(g4_),
15698         static_cast<ParamGenerator<T5> >(g5_),
15699         static_cast<ParamGenerator<T6> >(g6_)));
15700   }
15701 
15702  private:
15703   // No implementation - assignment is unsupported.
15704   void operator=(const CartesianProductHolder6& other);
15705 
15706   const Generator1 g1_;
15707   const Generator2 g2_;
15708   const Generator3 g3_;
15709   const Generator4 g4_;
15710   const Generator5 g5_;
15711   const Generator6 g6_;
15712 };  // class CartesianProductHolder6
15713 
15714 template <class Generator1, class Generator2, class Generator3,
15715     class Generator4, class Generator5, class Generator6, class Generator7>
15716 class CartesianProductHolder7 {
15717  public:
15718 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15719     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15720     const Generator6& g6, const Generator7& g7)
15721       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15722   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15723       typename T6, typename T7>
15724   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15725       T7> >() const {
15726     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15727         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15728         static_cast<ParamGenerator<T1> >(g1_),
15729         static_cast<ParamGenerator<T2> >(g2_),
15730         static_cast<ParamGenerator<T3> >(g3_),
15731         static_cast<ParamGenerator<T4> >(g4_),
15732         static_cast<ParamGenerator<T5> >(g5_),
15733         static_cast<ParamGenerator<T6> >(g6_),
15734         static_cast<ParamGenerator<T7> >(g7_)));
15735   }
15736 
15737  private:
15738   // No implementation - assignment is unsupported.
15739   void operator=(const CartesianProductHolder7& other);
15740 
15741   const Generator1 g1_;
15742   const Generator2 g2_;
15743   const Generator3 g3_;
15744   const Generator4 g4_;
15745   const Generator5 g5_;
15746   const Generator6 g6_;
15747   const Generator7 g7_;
15748 };  // class CartesianProductHolder7
15749 
15750 template <class Generator1, class Generator2, class Generator3,
15751     class Generator4, class Generator5, class Generator6, class Generator7,
15752     class Generator8>
15753 class CartesianProductHolder8 {
15754  public:
15755 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15756     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15757     const Generator6& g6, const Generator7& g7, const Generator8& g8)
15758       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15759           g8_(g8) {}
15760   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15761       typename T6, typename T7, typename T8>
15762   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15763       T8> >() const {
15764     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15765         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15766         static_cast<ParamGenerator<T1> >(g1_),
15767         static_cast<ParamGenerator<T2> >(g2_),
15768         static_cast<ParamGenerator<T3> >(g3_),
15769         static_cast<ParamGenerator<T4> >(g4_),
15770         static_cast<ParamGenerator<T5> >(g5_),
15771         static_cast<ParamGenerator<T6> >(g6_),
15772         static_cast<ParamGenerator<T7> >(g7_),
15773         static_cast<ParamGenerator<T8> >(g8_)));
15774   }
15775 
15776  private:
15777   // No implementation - assignment is unsupported.
15778   void operator=(const CartesianProductHolder8& other);
15779 
15780   const Generator1 g1_;
15781   const Generator2 g2_;
15782   const Generator3 g3_;
15783   const Generator4 g4_;
15784   const Generator5 g5_;
15785   const Generator6 g6_;
15786   const Generator7 g7_;
15787   const Generator8 g8_;
15788 };  // class CartesianProductHolder8
15789 
15790 template <class Generator1, class Generator2, class Generator3,
15791     class Generator4, class Generator5, class Generator6, class Generator7,
15792     class Generator8, class Generator9>
15793 class CartesianProductHolder9 {
15794  public:
15795 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15796     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15797     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15798     const Generator9& g9)
15799       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15800           g9_(g9) {}
15801   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15802       typename T6, typename T7, typename T8, typename T9>
15803   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15804       T9> >() const {
15805     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15806         T9> >(
15807         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15808         static_cast<ParamGenerator<T1> >(g1_),
15809         static_cast<ParamGenerator<T2> >(g2_),
15810         static_cast<ParamGenerator<T3> >(g3_),
15811         static_cast<ParamGenerator<T4> >(g4_),
15812         static_cast<ParamGenerator<T5> >(g5_),
15813         static_cast<ParamGenerator<T6> >(g6_),
15814         static_cast<ParamGenerator<T7> >(g7_),
15815         static_cast<ParamGenerator<T8> >(g8_),
15816         static_cast<ParamGenerator<T9> >(g9_)));
15817   }
15818 
15819  private:
15820   // No implementation - assignment is unsupported.
15821   void operator=(const CartesianProductHolder9& other);
15822 
15823   const Generator1 g1_;
15824   const Generator2 g2_;
15825   const Generator3 g3_;
15826   const Generator4 g4_;
15827   const Generator5 g5_;
15828   const Generator6 g6_;
15829   const Generator7 g7_;
15830   const Generator8 g8_;
15831   const Generator9 g9_;
15832 };  // class CartesianProductHolder9
15833 
15834 template <class Generator1, class Generator2, class Generator3,
15835     class Generator4, class Generator5, class Generator6, class Generator7,
15836     class Generator8, class Generator9, class Generator10>
15837 class CartesianProductHolder10 {
15838  public:
15839 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15840     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15841     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15842     const Generator9& g9, const Generator10& g10)
15843       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15844           g9_(g9), g10_(g10) {}
15845   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15846       typename T6, typename T7, typename T8, typename T9, typename T10>
15847   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15848       T9, T10> >() const {
15849     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15850         T9, T10> >(
15851         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15852             T10>(
15853         static_cast<ParamGenerator<T1> >(g1_),
15854         static_cast<ParamGenerator<T2> >(g2_),
15855         static_cast<ParamGenerator<T3> >(g3_),
15856         static_cast<ParamGenerator<T4> >(g4_),
15857         static_cast<ParamGenerator<T5> >(g5_),
15858         static_cast<ParamGenerator<T6> >(g6_),
15859         static_cast<ParamGenerator<T7> >(g7_),
15860         static_cast<ParamGenerator<T8> >(g8_),
15861         static_cast<ParamGenerator<T9> >(g9_),
15862         static_cast<ParamGenerator<T10> >(g10_)));
15863   }
15864 
15865  private:
15866   // No implementation - assignment is unsupported.
15867   void operator=(const CartesianProductHolder10& other);
15868 
15869   const Generator1 g1_;
15870   const Generator2 g2_;
15871   const Generator3 g3_;
15872   const Generator4 g4_;
15873   const Generator5 g5_;
15874   const Generator6 g6_;
15875   const Generator7 g7_;
15876   const Generator8 g8_;
15877   const Generator9 g9_;
15878   const Generator10 g10_;
15879 };  // class CartesianProductHolder10
15880 
15881 # endif  // GTEST_HAS_COMBINE
15882 
15883 }  // namespace internal
15884 }  // namespace testing
15885 
15886 #endif  //  GTEST_HAS_PARAM_TEST
15887 
15888 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15889 
15890 #if GTEST_HAS_PARAM_TEST
15891 
15892 namespace testing {
15893 
15894 // Functions producing parameter generators.
15895 //
15896 // Google Test uses these generators to produce parameters for value-
15897 // parameterized tests. When a parameterized test case is instantiated
15898 // with a particular generator, Google Test creates and runs tests
15899 // for each element in the sequence produced by the generator.
15900 //
15901 // In the following sample, tests from test case FooTest are instantiated
15902 // each three times with parameter values 3, 5, and 8:
15903 //
15904 // class FooTest : public TestWithParam<int> { ... };
15905 //
15906 // TEST_P(FooTest, TestThis) {
15907 // }
15908 // TEST_P(FooTest, TestThat) {
15909 // }
15910 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15911 //
15912 
15913 // Range() returns generators providing sequences of values in a range.
15914 //
15915 // Synopsis:
15916 // Range(start, end)
15917 //   - returns a generator producing a sequence of values {start, start+1,
15918 //     start+2, ..., }.
15919 // Range(start, end, step)
15920 //   - returns a generator producing a sequence of values {start, start+step,
15921 //     start+step+step, ..., }.
15922 // Notes:
15923 //   * The generated sequences never include end. For example, Range(1, 5)
15924 //     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15925 //     returns a generator producing {1, 3, 5, 7}.
15926 //   * start and end must have the same type. That type may be any integral or
15927 //     floating-point type or a user defined type satisfying these conditions:
15928 //     * It must be assignable (have operator=() defined).
15929 //     * It must have operator+() (operator+(int-compatible type) for
15930 //       two-operand version).
15931 //     * It must have operator<() defined.
15932 //     Elements in the resulting sequences will also have that type.
15933 //   * Condition start < end must be satisfied in order for resulting sequences
15934 //     to contain any elements.
15935 //
15936 template <typename T, typename IncrementT>
15937 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15938   return internal::ParamGenerator<T>(
15939       new internal::RangeGenerator<T, IncrementT>(start, end, step));
15940 }
15941 
15942 template <typename T>
15943 internal::ParamGenerator<T> Range(T start, T end) {
15944   return Range(start, end, 1);
15945 }
15946 
15947 // ValuesIn() function allows generation of tests with parameters coming from
15948 // a container.
15949 //
15950 // Synopsis:
15951 // ValuesIn(const T (&array)[N])
15952 //   - returns a generator producing sequences with elements from
15953 //     a C-style array.
15954 // ValuesIn(const Container& container)
15955 //   - returns a generator producing sequences with elements from
15956 //     an STL-style container.
15957 // ValuesIn(Iterator begin, Iterator end)
15958 //   - returns a generator producing sequences with elements from
15959 //     a range [begin, end) defined by a pair of STL-style iterators. These
15960 //     iterators can also be plain C pointers.
15961 //
15962 // Please note that ValuesIn copies the values from the containers
15963 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
15964 //
15965 // Examples:
15966 //
15967 // This instantiates tests from test case StringTest
15968 // each with C-string values of "foo", "bar", and "baz":
15969 //
15970 // const char* strings[] = {"foo", "bar", "baz"};
15971 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15972 //
15973 // This instantiates tests from test case StlStringTest
15974 // each with STL strings with values "a" and "b":
15975 //
15976 // ::std::vector< ::std::string> GetParameterStrings() {
15977 //   ::std::vector< ::std::string> v;
15978 //   v.push_back("a");
15979 //   v.push_back("b");
15980 //   return v;
15981 // }
15982 //
15983 // INSTANTIATE_TEST_CASE_P(CharSequence,
15984 //                         StlStringTest,
15985 //                         ValuesIn(GetParameterStrings()));
15986 //
15987 //
15988 // This will also instantiate tests from CharTest
15989 // each with parameter values 'a' and 'b':
15990 //
15991 // ::std::list<char> GetParameterChars() {
15992 //   ::std::list<char> list;
15993 //   list.push_back('a');
15994 //   list.push_back('b');
15995 //   return list;
15996 // }
15997 // ::std::list<char> l = GetParameterChars();
15998 // INSTANTIATE_TEST_CASE_P(CharSequence2,
15999 //                         CharTest,
16000 //                         ValuesIn(l.begin(), l.end()));
16001 //
16002 template <typename ForwardIterator>
16003 internal::ParamGenerator<
16004   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
16005 ValuesIn(ForwardIterator begin, ForwardIterator end) {
16006   typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
16007       ::value_type ParamType;
16008   return internal::ParamGenerator<ParamType>(
16009       new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
16010 }
16011 
16012 template <typename T, size_t N>
16013 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
16014   return ValuesIn(array, array + N);
16015 }
16016 
16017 template <class Container>
16018 internal::ParamGenerator<typename Container::value_type> ValuesIn(
16019     const Container& container) {
16020   return ValuesIn(container.begin(), container.end());
16021 }
16022 
16023 // Values() allows generating tests from explicitly specified list of
16024 // parameters.
16025 //
16026 // Synopsis:
16027 // Values(T v1, T v2, ..., T vN)
16028 //   - returns a generator producing sequences with elements v1, v2, ..., vN.
16029 //
16030 // For example, this instantiates tests from test case BarTest each
16031 // with values "one", "two", and "three":
16032 //
16033 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
16034 //
16035 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
16036 // The exact type of values will depend on the type of parameter in BazTest.
16037 //
16038 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
16039 //
16040 // Currently, Values() supports from 1 to 50 parameters.
16041 //
16042 template <typename T1>
16043 internal::ValueArray1<T1> Values(T1 v1) {
16044   return internal::ValueArray1<T1>(v1);
16045 }
16046 
16047 template <typename T1, typename T2>
16048 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
16049   return internal::ValueArray2<T1, T2>(v1, v2);
16050 }
16051 
16052 template <typename T1, typename T2, typename T3>
16053 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
16054   return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
16055 }
16056 
16057 template <typename T1, typename T2, typename T3, typename T4>
16058 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
16059   return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
16060 }
16061 
16062 template <typename T1, typename T2, typename T3, typename T4, typename T5>
16063 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16064     T5 v5) {
16065   return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
16066 }
16067 
16068 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16069     typename T6>
16070 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
16071     T4 v4, T5 v5, T6 v6) {
16072   return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
16073 }
16074 
16075 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16076     typename T6, typename T7>
16077 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
16078     T4 v4, T5 v5, T6 v6, T7 v7) {
16079   return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
16080       v6, v7);
16081 }
16082 
16083 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16084     typename T6, typename T7, typename T8>
16085 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
16086     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
16087   return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
16088       v5, v6, v7, v8);
16089 }
16090 
16091 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16092     typename T6, typename T7, typename T8, typename T9>
16093 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
16094     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
16095   return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
16096       v4, v5, v6, v7, v8, v9);
16097 }
16098 
16099 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16100     typename T6, typename T7, typename T8, typename T9, typename T10>
16101 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
16102     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
16103   return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
16104       v2, v3, v4, v5, v6, v7, v8, v9, v10);
16105 }
16106 
16107 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16108     typename T6, typename T7, typename T8, typename T9, typename T10,
16109     typename T11>
16110 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
16111     T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16112     T10 v10, T11 v11) {
16113   return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
16114       T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
16115 }
16116 
16117 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16118     typename T6, typename T7, typename T8, typename T9, typename T10,
16119     typename T11, typename T12>
16120 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16121     T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16122     T10 v10, T11 v11, T12 v12) {
16123   return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16124       T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
16125 }
16126 
16127 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16128     typename T6, typename T7, typename T8, typename T9, typename T10,
16129     typename T11, typename T12, typename T13>
16130 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16131     T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16132     T10 v10, T11 v11, T12 v12, T13 v13) {
16133   return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16134       T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16135 }
16136 
16137 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16138     typename T6, typename T7, typename T8, typename T9, typename T10,
16139     typename T11, typename T12, typename T13, typename T14>
16140 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16141     T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16142     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16143   return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16144       T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16145       v14);
16146 }
16147 
16148 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16149     typename T6, typename T7, typename T8, typename T9, typename T10,
16150     typename T11, typename T12, typename T13, typename T14, typename T15>
16151 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16152     T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16153     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16154   return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16155       T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16156       v13, v14, v15);
16157 }
16158 
16159 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16160     typename T6, typename T7, typename T8, typename T9, typename T10,
16161     typename T11, typename T12, typename T13, typename T14, typename T15,
16162     typename T16>
16163 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16164     T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16165     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16166     T16 v16) {
16167   return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16168       T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16169       v12, v13, v14, v15, v16);
16170 }
16171 
16172 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16173     typename T6, typename T7, typename T8, typename T9, typename T10,
16174     typename T11, typename T12, typename T13, typename T14, typename T15,
16175     typename T16, typename T17>
16176 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16177     T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16178     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16179     T16 v16, T17 v17) {
16180   return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16181       T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16182       v11, v12, v13, v14, v15, v16, v17);
16183 }
16184 
16185 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16186     typename T6, typename T7, typename T8, typename T9, typename T10,
16187     typename T11, typename T12, typename T13, typename T14, typename T15,
16188     typename T16, typename T17, typename T18>
16189 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16190     T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16191     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16192     T16 v16, T17 v17, T18 v18) {
16193   return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16194       T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16195       v10, v11, v12, v13, v14, v15, v16, v17, v18);
16196 }
16197 
16198 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16199     typename T6, typename T7, typename T8, typename T9, typename T10,
16200     typename T11, typename T12, typename T13, typename T14, typename T15,
16201     typename T16, typename T17, typename T18, typename T19>
16202 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16203     T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16204     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16205     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16206   return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16207       T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16208       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16209 }
16210 
16211 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16212     typename T6, typename T7, typename T8, typename T9, typename T10,
16213     typename T11, typename T12, typename T13, typename T14, typename T15,
16214     typename T16, typename T17, typename T18, typename T19, typename T20>
16215 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16216     T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16217     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16218     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16219   return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16220       T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16221       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16222 }
16223 
16224 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16225     typename T6, typename T7, typename T8, typename T9, typename T10,
16226     typename T11, typename T12, typename T13, typename T14, typename T15,
16227     typename T16, typename T17, typename T18, typename T19, typename T20,
16228     typename T21>
16229 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16230     T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16231     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16232     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16233   return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16234       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16235       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16236 }
16237 
16238 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16239     typename T6, typename T7, typename T8, typename T9, typename T10,
16240     typename T11, typename T12, typename T13, typename T14, typename T15,
16241     typename T16, typename T17, typename T18, typename T19, typename T20,
16242     typename T21, typename T22>
16243 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16244     T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16245     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16246     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16247     T21 v21, T22 v22) {
16248   return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16249       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16250       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16251       v20, v21, v22);
16252 }
16253 
16254 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16255     typename T6, typename T7, typename T8, typename T9, typename T10,
16256     typename T11, typename T12, typename T13, typename T14, typename T15,
16257     typename T16, typename T17, typename T18, typename T19, typename T20,
16258     typename T21, typename T22, typename T23>
16259 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16260     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16261     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16262     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16263     T21 v21, T22 v22, T23 v23) {
16264   return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16265       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16266       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16267       v20, v21, v22, v23);
16268 }
16269 
16270 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16271     typename T6, typename T7, typename T8, typename T9, typename T10,
16272     typename T11, typename T12, typename T13, typename T14, typename T15,
16273     typename T16, typename T17, typename T18, typename T19, typename T20,
16274     typename T21, typename T22, typename T23, typename T24>
16275 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16276     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16277     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16278     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16279     T21 v21, T22 v22, T23 v23, T24 v24) {
16280   return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16281       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16282       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16283       v19, v20, v21, v22, v23, v24);
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 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16292     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16293     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16294     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16295     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16296   return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16297       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16298       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16299       v18, v19, v20, v21, v22, v23, v24, v25);
16300 }
16301 
16302 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16303     typename T6, typename T7, typename T8, typename T9, typename T10,
16304     typename T11, typename T12, typename T13, typename T14, typename T15,
16305     typename T16, typename T17, typename T18, typename T19, typename T20,
16306     typename T21, typename T22, typename T23, typename T24, typename T25,
16307     typename T26>
16308 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16309     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16310     T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16311     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16312     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16313     T26 v26) {
16314   return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16315       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16316       T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16317       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16318 }
16319 
16320 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16321     typename T6, typename T7, typename T8, typename T9, typename T10,
16322     typename T11, typename T12, typename T13, typename T14, typename T15,
16323     typename T16, typename T17, typename T18, typename T19, typename T20,
16324     typename T21, typename T22, typename T23, typename T24, typename T25,
16325     typename T26, typename T27>
16326 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16327     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16328     T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16329     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16330     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16331     T26 v26, T27 v27) {
16332   return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16333       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16334       T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16335       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16336 }
16337 
16338 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16339     typename T6, typename T7, typename T8, typename T9, typename T10,
16340     typename T11, typename T12, typename T13, typename T14, typename T15,
16341     typename T16, typename T17, typename T18, typename T19, typename T20,
16342     typename T21, typename T22, typename T23, typename T24, typename T25,
16343     typename T26, typename T27, typename T28>
16344 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16345     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16346     T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16347     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16348     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16349     T26 v26, T27 v27, T28 v28) {
16350   return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16351       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16352       T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16353       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16354       v28);
16355 }
16356 
16357 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16358     typename T6, typename T7, typename T8, typename T9, typename T10,
16359     typename T11, typename T12, typename T13, typename T14, typename T15,
16360     typename T16, typename T17, typename T18, typename T19, typename T20,
16361     typename T21, typename T22, typename T23, typename T24, typename T25,
16362     typename T26, typename T27, typename T28, typename T29>
16363 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16364     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16365     T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16366     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16367     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16368     T26 v26, T27 v27, T28 v28, T29 v29) {
16369   return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16370       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16371       T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16372       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16373       v27, v28, v29);
16374 }
16375 
16376 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16377     typename T6, typename T7, typename T8, typename T9, typename T10,
16378     typename T11, typename T12, typename T13, typename T14, typename T15,
16379     typename T16, typename T17, typename T18, typename T19, typename T20,
16380     typename T21, typename T22, typename T23, typename T24, typename T25,
16381     typename T26, typename T27, typename T28, typename T29, typename T30>
16382 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16383     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16384     T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16385     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16386     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16387     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16388   return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16389       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16390       T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16391       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16392       v26, v27, v28, v29, v30);
16393 }
16394 
16395 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16396     typename T6, typename T7, typename T8, typename T9, typename T10,
16397     typename T11, typename T12, typename T13, typename T14, typename T15,
16398     typename T16, typename T17, typename T18, typename T19, typename T20,
16399     typename T21, typename T22, typename T23, typename T24, typename T25,
16400     typename T26, typename T27, typename T28, typename T29, typename T30,
16401     typename T31>
16402 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16403     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16404     T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16405     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16406     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16407     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16408   return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16409       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16410       T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16411       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16412       v25, v26, v27, v28, v29, v30, v31);
16413 }
16414 
16415 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16416     typename T6, typename T7, typename T8, typename T9, typename T10,
16417     typename T11, typename T12, typename T13, typename T14, typename T15,
16418     typename T16, typename T17, typename T18, typename T19, typename T20,
16419     typename T21, typename T22, typename T23, typename T24, typename T25,
16420     typename T26, typename T27, typename T28, typename T29, typename T30,
16421     typename T31, typename T32>
16422 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16423     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16424     T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16425     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16426     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16427     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16428     T32 v32) {
16429   return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16430       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16431       T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16432       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16433       v24, v25, v26, v27, v28, v29, v30, v31, v32);
16434 }
16435 
16436 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16437     typename T6, typename T7, typename T8, typename T9, typename T10,
16438     typename T11, typename T12, typename T13, typename T14, typename T15,
16439     typename T16, typename T17, typename T18, typename T19, typename T20,
16440     typename T21, typename T22, typename T23, typename T24, typename T25,
16441     typename T26, typename T27, typename T28, typename T29, typename T30,
16442     typename T31, typename T32, typename T33>
16443 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16444     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16445     T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16446     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16447     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16448     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16449     T32 v32, T33 v33) {
16450   return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16451       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16452       T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16453       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16454       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16455 }
16456 
16457 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16458     typename T6, typename T7, typename T8, typename T9, typename T10,
16459     typename T11, typename T12, typename T13, typename T14, typename T15,
16460     typename T16, typename T17, typename T18, typename T19, typename T20,
16461     typename T21, typename T22, typename T23, typename T24, typename T25,
16462     typename T26, typename T27, typename T28, typename T29, typename T30,
16463     typename T31, typename T32, typename T33, typename T34>
16464 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16465     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16466     T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16467     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16468     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16469     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16470     T31 v31, T32 v32, T33 v33, T34 v34) {
16471   return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16472       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16473       T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16474       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16475       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16476 }
16477 
16478 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16479     typename T6, typename T7, typename T8, typename T9, typename T10,
16480     typename T11, typename T12, typename T13, typename T14, typename T15,
16481     typename T16, typename T17, typename T18, typename T19, typename T20,
16482     typename T21, typename T22, typename T23, typename T24, typename T25,
16483     typename T26, typename T27, typename T28, typename T29, typename T30,
16484     typename T31, typename T32, typename T33, typename T34, typename T35>
16485 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16486     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16487     T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16488     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16489     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16490     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16491     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16492   return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16493       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16494       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16495       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16496       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16497 }
16498 
16499 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16500     typename T6, typename T7, typename T8, typename T9, typename T10,
16501     typename T11, typename T12, typename T13, typename T14, typename T15,
16502     typename T16, typename T17, typename T18, typename T19, typename T20,
16503     typename T21, typename T22, typename T23, typename T24, typename T25,
16504     typename T26, typename T27, typename T28, typename T29, typename T30,
16505     typename T31, typename T32, typename T33, typename T34, typename T35,
16506     typename T36>
16507 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16508     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16509     T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16510     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16511     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16512     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16513     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16514   return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16515       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16516       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16517       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16518       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16519       v34, v35, v36);
16520 }
16521 
16522 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16523     typename T6, typename T7, typename T8, typename T9, typename T10,
16524     typename T11, typename T12, typename T13, typename T14, typename T15,
16525     typename T16, typename T17, typename T18, typename T19, typename T20,
16526     typename T21, typename T22, typename T23, typename T24, typename T25,
16527     typename T26, typename T27, typename T28, typename T29, typename T30,
16528     typename T31, typename T32, typename T33, typename T34, typename T35,
16529     typename T36, typename T37>
16530 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16531     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16532     T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16533     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16534     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16535     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16536     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16537     T37 v37) {
16538   return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16539       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16540       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16541       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16542       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16543       v34, v35, v36, v37);
16544 }
16545 
16546 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16547     typename T6, typename T7, typename T8, typename T9, typename T10,
16548     typename T11, typename T12, typename T13, typename T14, typename T15,
16549     typename T16, typename T17, typename T18, typename T19, typename T20,
16550     typename T21, typename T22, typename T23, typename T24, typename T25,
16551     typename T26, typename T27, typename T28, typename T29, typename T30,
16552     typename T31, typename T32, typename T33, typename T34, typename T35,
16553     typename T36, typename T37, typename T38>
16554 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16555     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16556     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16557     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16558     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16559     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16560     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16561     T37 v37, T38 v38) {
16562   return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16563       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16564       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16565       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16566       v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16567       v33, v34, v35, v36, v37, v38);
16568 }
16569 
16570 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16571     typename T6, typename T7, typename T8, typename T9, typename T10,
16572     typename T11, typename T12, typename T13, typename T14, typename T15,
16573     typename T16, typename T17, typename T18, typename T19, typename T20,
16574     typename T21, typename T22, typename T23, typename T24, typename T25,
16575     typename T26, typename T27, typename T28, typename T29, typename T30,
16576     typename T31, typename T32, typename T33, typename T34, typename T35,
16577     typename T36, typename T37, typename T38, typename T39>
16578 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16579     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16580     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16581     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16582     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16583     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16584     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16585     T37 v37, T38 v38, T39 v39) {
16586   return internal::ValueArray39<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>(v1,
16589       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16590       v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16591       v32, v33, v34, v35, v36, v37, v38, v39);
16592 }
16593 
16594 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16595     typename T6, typename T7, typename T8, typename T9, typename T10,
16596     typename T11, typename T12, typename T13, typename T14, typename T15,
16597     typename T16, typename T17, typename T18, typename T19, typename T20,
16598     typename T21, typename T22, typename T23, typename T24, typename T25,
16599     typename T26, typename T27, typename T28, typename T29, typename T30,
16600     typename T31, typename T32, typename T33, typename T34, typename T35,
16601     typename T36, typename T37, typename T38, typename T39, typename T40>
16602 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16603     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16604     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16605     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16606     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16607     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16608     T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16609     T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16610   return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16611       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16612       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16613       T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16614       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16615       v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16616 }
16617 
16618 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16619     typename T6, typename T7, typename T8, typename T9, typename T10,
16620     typename T11, typename T12, typename T13, typename T14, typename T15,
16621     typename T16, typename T17, typename T18, typename T19, typename T20,
16622     typename T21, typename T22, typename T23, typename T24, typename T25,
16623     typename T26, typename T27, typename T28, typename T29, typename T30,
16624     typename T31, typename T32, typename T33, typename T34, typename T35,
16625     typename T36, typename T37, typename T38, typename T39, typename T40,
16626     typename T41>
16627 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16628     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16629     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16630     T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16631     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16632     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16633     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16634     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16635   return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16636       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16637       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16638       T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16639       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16640       v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16641 }
16642 
16643 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16644     typename T6, typename T7, typename T8, typename T9, typename T10,
16645     typename T11, typename T12, typename T13, typename T14, typename T15,
16646     typename T16, typename T17, typename T18, typename T19, typename T20,
16647     typename T21, typename T22, typename T23, typename T24, typename T25,
16648     typename T26, typename T27, typename T28, typename T29, typename T30,
16649     typename T31, typename T32, typename T33, typename T34, typename T35,
16650     typename T36, typename T37, typename T38, typename T39, typename T40,
16651     typename T41, typename T42>
16652 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16653     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16654     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16655     T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16656     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16657     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16658     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16659     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16660     T42 v42) {
16661   return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16662       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16663       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16664       T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16665       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16666       v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16667       v42);
16668 }
16669 
16670 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16671     typename T6, typename T7, typename T8, typename T9, typename T10,
16672     typename T11, typename T12, typename T13, typename T14, typename T15,
16673     typename T16, typename T17, typename T18, typename T19, typename T20,
16674     typename T21, typename T22, typename T23, typename T24, typename T25,
16675     typename T26, typename T27, typename T28, typename T29, typename T30,
16676     typename T31, typename T32, typename T33, typename T34, typename T35,
16677     typename T36, typename T37, typename T38, typename T39, typename T40,
16678     typename T41, typename T42, typename T43>
16679 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16680     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16681     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16682     T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16683     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16684     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16685     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16686     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16687     T42 v42, T43 v43) {
16688   return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16689       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16690       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16691       T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16692       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16693       v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16694       v41, v42, v43);
16695 }
16696 
16697 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16698     typename T6, typename T7, typename T8, typename T9, typename T10,
16699     typename T11, typename T12, typename T13, typename T14, typename T15,
16700     typename T16, typename T17, typename T18, typename T19, typename T20,
16701     typename T21, typename T22, typename T23, typename T24, typename T25,
16702     typename T26, typename T27, typename T28, typename T29, typename T30,
16703     typename T31, typename T32, typename T33, typename T34, typename T35,
16704     typename T36, typename T37, typename T38, typename T39, typename T40,
16705     typename T41, typename T42, typename T43, typename T44>
16706 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16707     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16708     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16709     T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16710     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16711     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16712     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16713     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16714     T42 v42, T43 v43, T44 v44) {
16715   return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16716       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16717       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16718       T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16719       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16720       v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16721       v40, v41, v42, v43, v44);
16722 }
16723 
16724 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16725     typename T6, typename T7, typename T8, typename T9, typename T10,
16726     typename T11, typename T12, typename T13, typename T14, typename T15,
16727     typename T16, typename T17, typename T18, typename T19, typename T20,
16728     typename T21, typename T22, typename T23, typename T24, typename T25,
16729     typename T26, typename T27, typename T28, typename T29, typename T30,
16730     typename T31, typename T32, typename T33, typename T34, typename T35,
16731     typename T36, typename T37, typename T38, typename T39, typename T40,
16732     typename T41, typename T42, typename T43, typename T44, typename T45>
16733 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16734     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16735     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16736     T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16737     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16738     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16739     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16740     T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16741     T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16742   return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16743       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16744       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16745       T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16746       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16747       v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16748       v39, v40, v41, v42, v43, v44, v45);
16749 }
16750 
16751 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16752     typename T6, typename T7, typename T8, typename T9, typename T10,
16753     typename T11, typename T12, typename T13, typename T14, typename T15,
16754     typename T16, typename T17, typename T18, typename T19, typename T20,
16755     typename T21, typename T22, typename T23, typename T24, typename T25,
16756     typename T26, typename T27, typename T28, typename T29, typename T30,
16757     typename T31, typename T32, typename T33, typename T34, typename T35,
16758     typename T36, typename T37, typename T38, typename T39, typename T40,
16759     typename T41, typename T42, typename T43, typename T44, typename T45,
16760     typename T46>
16761 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16762     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16763     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16764     T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16765     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16766     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16767     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16768     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16769     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16770   return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16771       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16772       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16773       T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16774       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16775       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16776       v38, v39, v40, v41, v42, v43, v44, v45, v46);
16777 }
16778 
16779 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16780     typename T6, typename T7, typename T8, typename T9, typename T10,
16781     typename T11, typename T12, typename T13, typename T14, typename T15,
16782     typename T16, typename T17, typename T18, typename T19, typename T20,
16783     typename T21, typename T22, typename T23, typename T24, typename T25,
16784     typename T26, typename T27, typename T28, typename T29, typename T30,
16785     typename T31, typename T32, typename T33, typename T34, typename T35,
16786     typename T36, typename T37, typename T38, typename T39, typename T40,
16787     typename T41, typename T42, typename T43, typename T44, typename T45,
16788     typename T46, typename T47>
16789 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16790     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16791     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16792     T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16793     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16794     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16795     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16796     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16797     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16798   return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16799       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16800       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16801       T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16802       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16803       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16804       v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16805 }
16806 
16807 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16808     typename T6, typename T7, typename T8, typename T9, typename T10,
16809     typename T11, typename T12, typename T13, typename T14, typename T15,
16810     typename T16, typename T17, typename T18, typename T19, typename T20,
16811     typename T21, typename T22, typename T23, typename T24, typename T25,
16812     typename T26, typename T27, typename T28, typename T29, typename T30,
16813     typename T31, typename T32, typename T33, typename T34, typename T35,
16814     typename T36, typename T37, typename T38, typename T39, typename T40,
16815     typename T41, typename T42, typename T43, typename T44, typename T45,
16816     typename T46, typename T47, typename T48>
16817 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16818     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16819     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16820     T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16821     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16822     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16823     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16824     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16825     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16826     T48 v48) {
16827   return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16828       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16829       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16830       T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16831       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16832       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16833       v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16834 }
16835 
16836 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16837     typename T6, typename T7, typename T8, typename T9, typename T10,
16838     typename T11, typename T12, typename T13, typename T14, typename T15,
16839     typename T16, typename T17, typename T18, typename T19, typename T20,
16840     typename T21, typename T22, typename T23, typename T24, typename T25,
16841     typename T26, typename T27, typename T28, typename T29, typename T30,
16842     typename T31, typename T32, typename T33, typename T34, typename T35,
16843     typename T36, typename T37, typename T38, typename T39, typename T40,
16844     typename T41, typename T42, typename T43, typename T44, typename T45,
16845     typename T46, typename T47, typename T48, typename T49>
16846 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16847     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16848     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16849     T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16850     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16851     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16852     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16853     T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16854     T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16855     T47 v47, T48 v48, T49 v49) {
16856   return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16857       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16858       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16859       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16860       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16861       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16862       v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16863 }
16864 
16865 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16866     typename T6, typename T7, typename T8, typename T9, typename T10,
16867     typename T11, typename T12, typename T13, typename T14, typename T15,
16868     typename T16, typename T17, typename T18, typename T19, typename T20,
16869     typename T21, typename T22, typename T23, typename T24, typename T25,
16870     typename T26, typename T27, typename T28, typename T29, typename T30,
16871     typename T31, typename T32, typename T33, typename T34, typename T35,
16872     typename T36, typename T37, typename T38, typename T39, typename T40,
16873     typename T41, typename T42, typename T43, typename T44, typename T45,
16874     typename T46, typename T47, typename T48, typename T49, typename T50>
16875 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16876     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16877     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16878     T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16879     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16880     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16881     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16882     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16883     T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16884     T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16885   return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16886       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16887       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16888       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16889       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16890       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16891       v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16892       v48, v49, v50);
16893 }
16894 
16895 // Bool() allows generating tests with parameters in a set of (false, true).
16896 //
16897 // Synopsis:
16898 // Bool()
16899 //   - returns a generator producing sequences with elements {false, true}.
16900 //
16901 // It is useful when testing code that depends on Boolean flags. Combinations
16902 // of multiple flags can be tested when several Bool()'s are combined using
16903 // Combine() function.
16904 //
16905 // In the following example all tests in the test case FlagDependentTest
16906 // will be instantiated twice with parameters false and true.
16907 //
16908 // class FlagDependentTest : public testing::TestWithParam<bool> {
16909 //   virtual void SetUp() {
16910 //     external_flag = GetParam();
16911 //   }
16912 // }
16913 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16914 //
16915 inline internal::ParamGenerator<bool> Bool() {
16916   return Values(false, true);
16917 }
16918 
16919 # if GTEST_HAS_COMBINE
16920 // Combine() allows the user to combine two or more sequences to produce
16921 // values of a Cartesian product of those sequences' elements.
16922 //
16923 // Synopsis:
16924 // Combine(gen1, gen2, ..., genN)
16925 //   - returns a generator producing sequences with elements coming from
16926 //     the Cartesian product of elements from the sequences generated by
16927 //     gen1, gen2, ..., genN. The sequence elements will have a type of
16928 //     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16929 //     of elements from sequences produces by gen1, gen2, ..., genN.
16930 //
16931 // Combine can have up to 10 arguments. This number is currently limited
16932 // by the maximum number of elements in the tuple implementation used by Google
16933 // Test.
16934 //
16935 // Example:
16936 //
16937 // This will instantiate tests in test case AnimalTest each one with
16938 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16939 // tuple("dog", BLACK), and tuple("dog", WHITE):
16940 //
16941 // enum Color { BLACK, GRAY, WHITE };
16942 // class AnimalTest
16943 //     : public testing::TestWithParam<tuple<const char*, Color> > {...};
16944 //
16945 // TEST_P(AnimalTest, AnimalLooksNice) {...}
16946 //
16947 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16948 //                         Combine(Values("cat", "dog"),
16949 //                                 Values(BLACK, WHITE)));
16950 //
16951 // This will instantiate tests in FlagDependentTest with all variations of two
16952 // Boolean flags:
16953 //
16954 // class FlagDependentTest
16955 //     : public testing::TestWithParam<tuple<bool, bool> > {
16956 //   virtual void SetUp() {
16957 //     // Assigns external_flag_1 and external_flag_2 values from the tuple.
16958 //     tie(external_flag_1, external_flag_2) = GetParam();
16959 //   }
16960 // };
16961 //
16962 // TEST_P(FlagDependentTest, TestFeature1) {
16963 //   // Test your code using external_flag_1 and external_flag_2 here.
16964 // }
16965 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16966 //                         Combine(Bool(), Bool()));
16967 //
16968 template <typename Generator1, typename Generator2>
16969 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16970     const Generator1& g1, const Generator2& g2) {
16971   return internal::CartesianProductHolder2<Generator1, Generator2>(
16972       g1, g2);
16973 }
16974 
16975 template <typename Generator1, typename Generator2, typename Generator3>
16976 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16977     const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16978   return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16979       g1, g2, g3);
16980 }
16981 
16982 template <typename Generator1, typename Generator2, typename Generator3,
16983     typename Generator4>
16984 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16985     Generator4> Combine(
16986     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16987         const Generator4& g4) {
16988   return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16989       Generator4>(
16990       g1, g2, g3, g4);
16991 }
16992 
16993 template <typename Generator1, typename Generator2, typename Generator3,
16994     typename Generator4, typename Generator5>
16995 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16996     Generator4, Generator5> Combine(
16997     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16998         const Generator4& g4, const Generator5& g5) {
16999   return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
17000       Generator4, Generator5>(
17001       g1, g2, g3, g4, g5);
17002 }
17003 
17004 template <typename Generator1, typename Generator2, typename Generator3,
17005     typename Generator4, typename Generator5, typename Generator6>
17006 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
17007     Generator4, Generator5, Generator6> Combine(
17008     const Generator1& g1, const Generator2& g2, const Generator3& g3,
17009         const Generator4& g4, const Generator5& g5, const Generator6& g6) {
17010   return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
17011       Generator4, Generator5, Generator6>(
17012       g1, g2, g3, g4, g5, g6);
17013 }
17014 
17015 template <typename Generator1, typename Generator2, typename Generator3,
17016     typename Generator4, typename Generator5, typename Generator6,
17017     typename Generator7>
17018 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
17019     Generator4, Generator5, Generator6, Generator7> Combine(
17020     const Generator1& g1, const Generator2& g2, const Generator3& g3,
17021         const Generator4& g4, const Generator5& g5, const Generator6& g6,
17022         const Generator7& g7) {
17023   return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
17024       Generator4, Generator5, Generator6, Generator7>(
17025       g1, g2, g3, g4, g5, g6, g7);
17026 }
17027 
17028 template <typename Generator1, typename Generator2, typename Generator3,
17029     typename Generator4, typename Generator5, typename Generator6,
17030     typename Generator7, typename Generator8>
17031 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
17032     Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
17033     const Generator1& g1, const Generator2& g2, const Generator3& g3,
17034         const Generator4& g4, const Generator5& g5, const Generator6& g6,
17035         const Generator7& g7, const Generator8& g8) {
17036   return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
17037       Generator4, Generator5, Generator6, Generator7, Generator8>(
17038       g1, g2, g3, g4, g5, g6, g7, g8);
17039 }
17040 
17041 template <typename Generator1, typename Generator2, typename Generator3,
17042     typename Generator4, typename Generator5, typename Generator6,
17043     typename Generator7, typename Generator8, typename Generator9>
17044 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
17045     Generator4, Generator5, Generator6, Generator7, Generator8,
17046     Generator9> Combine(
17047     const Generator1& g1, const Generator2& g2, const Generator3& g3,
17048         const Generator4& g4, const Generator5& g5, const Generator6& g6,
17049         const Generator7& g7, const Generator8& g8, const Generator9& g9) {
17050   return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
17051       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
17052       g1, g2, g3, g4, g5, g6, g7, g8, g9);
17053 }
17054 
17055 template <typename Generator1, typename Generator2, typename Generator3,
17056     typename Generator4, typename Generator5, typename Generator6,
17057     typename Generator7, typename Generator8, typename Generator9,
17058     typename Generator10>
17059 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
17060     Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
17061     Generator10> Combine(
17062     const Generator1& g1, const Generator2& g2, const Generator3& g3,
17063         const Generator4& g4, const Generator5& g5, const Generator6& g6,
17064         const Generator7& g7, const Generator8& g8, const Generator9& g9,
17065         const Generator10& g10) {
17066   return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
17067       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
17068       Generator10>(
17069       g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
17070 }
17071 # endif  // GTEST_HAS_COMBINE
17072 
17073 
17074 
17075 # define TEST_P(test_case_name, test_name) \
17076   class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
17077       : public test_case_name { \
17078    public: \
17079     GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
17080     virtual void TestBody(); \
17081    private: \
17082     static int AddToRegistry() { \
17083       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
17084           GetTestCasePatternHolder<test_case_name>(\
17085               #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
17086                   #test_case_name, \
17087                   #test_name, \
17088                   new ::testing::internal::TestMetaFactory< \
17089                       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
17090       return 0; \
17091     } \
17092     static int gtest_registering_dummy_; \
17093     GTEST_DISALLOW_COPY_AND_ASSIGN_(\
17094         GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
17095   }; \
17096   int GTEST_TEST_CLASS_NAME_(test_case_name, \
17097                              test_name)::gtest_registering_dummy_ = \
17098       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
17099   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
17100 
17101 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
17102   ::testing::internal::ParamGenerator<test_case_name::ParamType> \
17103       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
17104   int gtest_##prefix##test_case_name##_dummy_ = \
17105       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
17106           GetTestCasePatternHolder<test_case_name>(\
17107               #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
17108                   #prefix, \
17109                   &gtest_##prefix##test_case_name##_EvalGenerator_, \
17110                   __FILE__, __LINE__)
17111 
17112 }  // namespace testing
17113 
17114 #endif  // GTEST_HAS_PARAM_TEST
17115 
17116 #endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
17117 // Copyright 2006, Google Inc.
17118 // All rights reserved.
17119 //
17120 // Redistribution and use in source and binary forms, with or without
17121 // modification, are permitted provided that the following conditions are
17122 // met:
17123 //
17124 //     * Redistributions of source code must retain the above copyright
17125 // notice, this list of conditions and the following disclaimer.
17126 //     * Redistributions in binary form must reproduce the above
17127 // copyright notice, this list of conditions and the following disclaimer
17128 // in the documentation and/or other materials provided with the
17129 // distribution.
17130 //     * Neither the name of Google Inc. nor the names of its
17131 // contributors may be used to endorse or promote products derived from
17132 // this software without specific prior written permission.
17133 //
17134 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17135 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17136 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17137 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17138 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17139 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17140 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17141 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17142 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17143 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17144 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17145 //
17146 // Author: wan@google.com (Zhanyong Wan)
17147 //
17148 // Google C++ Testing Framework definitions useful in production code.
17149 
17150 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17151 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17152 
17153 // When you need to test the private or protected members of a class,
17154 // use the FRIEND_TEST macro to declare your tests as friends of the
17155 // class.  For example:
17156 //
17157 // class MyClass {
17158 //  private:
17159 //   void MyMethod();
17160 //   FRIEND_TEST(MyClassTest, MyMethod);
17161 // };
17162 //
17163 // class MyClassTest : public testing::Test {
17164 //   // ...
17165 // };
17166 //
17167 // TEST_F(MyClassTest, MyMethod) {
17168 //   // Can call MyClass::MyMethod() here.
17169 // }
17170 
17171 #define FRIEND_TEST(test_case_name, test_name)\
17172 friend class test_case_name##_##test_name##_Test
17173 
17174 #endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17175 // Copyright 2008, Google Inc.
17176 // All rights reserved.
17177 //
17178 // Redistribution and use in source and binary forms, with or without
17179 // modification, are permitted provided that the following conditions are
17180 // met:
17181 //
17182 //     * Redistributions of source code must retain the above copyright
17183 // notice, this list of conditions and the following disclaimer.
17184 //     * Redistributions in binary form must reproduce the above
17185 // copyright notice, this list of conditions and the following disclaimer
17186 // in the documentation and/or other materials provided with the
17187 // distribution.
17188 //     * Neither the name of Google Inc. nor the names of its
17189 // contributors may be used to endorse or promote products derived from
17190 // this software without specific prior written permission.
17191 //
17192 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17193 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17194 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17195 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17196 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17197 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17198 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17199 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17200 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17201 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17202 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17203 //
17204 // Author: mheule@google.com (Markus Heule)
17205 //
17206 
17207 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17208 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17209 
17210 #include <iosfwd>
17211 #include <vector>
17212 
17213 namespace testing {
17214 
17215 // A copyable object representing the result of a test part (i.e. an
17216 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17217 //
17218 // Don't inherit from TestPartResult as its destructor is not virtual.
17219 class GTEST_API_ TestPartResult {
17220  public:
17221   // The possible outcomes of a test part (i.e. an assertion or an
17222   // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17223   enum Type {
17224     kSuccess,          // Succeeded.
17225     kNonFatalFailure,  // Failed but the test can continue.
17226     kFatalFailure      // Failed and the test should be terminated.
17227   };
17228 
17229   // C'tor.  TestPartResult does NOT have a default constructor.
17230   // Always use this constructor (with parameters) to create a
17231   // TestPartResult object.
17232   TestPartResult(Type a_type,
17233                  const char* a_file_name,
17234                  int a_line_number,
17235                  const char* a_message)
17236       : type_(a_type),
17237         file_name_(a_file_name),
17238         line_number_(a_line_number),
17239         summary_(ExtractSummary(a_message)),
17240         message_(a_message) {
17241   }
17242 
17243   // Gets the outcome of the test part.
17244   Type type() const { return type_; }
17245 
17246   // Gets the name of the source file where the test part took place, or
17247   // NULL if it's unknown.
17248   const char* file_name() const { return file_name_.c_str(); }
17249 
17250   // Gets the line in the source file where the test part took place,
17251   // or -1 if it's unknown.
17252   int line_number() const { return line_number_; }
17253 
17254   // Gets the summary of the failure message.
17255   const char* summary() const { return summary_.c_str(); }
17256 
17257   // Gets the message associated with the test part.
17258   const char* message() const { return message_.c_str(); }
17259 
17260   // Returns true iff the test part passed.
17261   bool passed() const { return type_ == kSuccess; }
17262 
17263   // Returns true iff the test part failed.
17264   bool failed() const { return type_ != kSuccess; }
17265 
17266   // Returns true iff the test part non-fatally failed.
17267   bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17268 
17269   // Returns true iff the test part fatally failed.
17270   bool fatally_failed() const { return type_ == kFatalFailure; }
17271 
17272  private:
17273   Type type_;
17274 
17275   // Gets the summary of the failure message by omitting the stack
17276   // trace in it.
17277   static internal::String ExtractSummary(const char* message);
17278 
17279   // The name of the source file where the test part took place, or
17280   // NULL if the source file is unknown.
17281   internal::String file_name_;
17282   // The line in the source file where the test part took place, or -1
17283   // if the line number is unknown.
17284   int line_number_;
17285   internal::String summary_;  // The test failure summary.
17286   internal::String message_;  // The test failure message.
17287 };
17288 
17289 // Prints a TestPartResult object.
17290 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17291 
17292 // An array of TestPartResult objects.
17293 //
17294 // Don't inherit from TestPartResultArray as its destructor is not
17295 // virtual.
17296 class GTEST_API_ TestPartResultArray {
17297  public:
17298   TestPartResultArray() {}
17299 
17300   // Appends the given TestPartResult to the array.
17301   void Append(const TestPartResult& result);
17302 
17303   // Returns the TestPartResult at the given index (0-based).
17304   const TestPartResult& GetTestPartResult(int index) const;
17305 
17306   // Returns the number of TestPartResult objects in the array.
17307   int size() const;
17308 
17309  private:
17310   std::vector<TestPartResult> array_;
17311 
17312   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17313 };
17314 
17315 // This interface knows how to report a test part result.
17316 class GTEST_API_ TestPartResultReporterInterface {
17317  public:
17318   virtual ~TestPartResultReporterInterface() {}
17319 
17320   virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17321 };
17322 
17323 namespace internal {
17324 
17325 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17326 // statement generates new fatal failures. To do so it registers itself as the
17327 // current test part result reporter. Besides checking if fatal failures were
17328 // reported, it only delegates the reporting to the former result reporter.
17329 // The original result reporter is restored in the destructor.
17330 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17331 class GTEST_API_ HasNewFatalFailureHelper
17332     : public TestPartResultReporterInterface {
17333  public:
17334   HasNewFatalFailureHelper();
17335   virtual ~HasNewFatalFailureHelper();
17336   virtual void ReportTestPartResult(const TestPartResult& result);
17337   bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17338  private:
17339   bool has_new_fatal_failure_;
17340   TestPartResultReporterInterface* original_reporter_;
17341 
17342   GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17343 };
17344 
17345 }  // namespace internal
17346 
17347 }  // namespace testing
17348 
17349 #endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17350 // Copyright 2008 Google Inc.
17351 // All Rights Reserved.
17352 //
17353 // Redistribution and use in source and binary forms, with or without
17354 // modification, are permitted provided that the following conditions are
17355 // met:
17356 //
17357 //     * Redistributions of source code must retain the above copyright
17358 // notice, this list of conditions and the following disclaimer.
17359 //     * Redistributions in binary form must reproduce the above
17360 // copyright notice, this list of conditions and the following disclaimer
17361 // in the documentation and/or other materials provided with the
17362 // distribution.
17363 //     * Neither the name of Google Inc. nor the names of its
17364 // contributors may be used to endorse or promote products derived from
17365 // this software without specific prior written permission.
17366 //
17367 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17368 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17369 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17370 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17371 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17372 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17373 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17374 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17375 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17376 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17377 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17378 //
17379 // Author: wan@google.com (Zhanyong Wan)
17380 
17381 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17382 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17383 
17384 // This header implements typed tests and type-parameterized tests.
17385 
17386 // Typed (aka type-driven) tests repeat the same test for types in a
17387 // list.  You must know which types you want to test with when writing
17388 // typed tests. Here's how you do it:
17389 
17390 #if 0
17391 
17392 // First, define a fixture class template.  It should be parameterized
17393 // by a type.  Remember to derive it from testing::Test.
17394 template <typename T>
17395 class FooTest : public testing::Test {
17396  public:
17397   ...
17398   typedef std::list<T> List;
17399   static T shared_;
17400   T value_;
17401 };
17402 
17403 // Next, associate a list of types with the test case, which will be
17404 // repeated for each type in the list.  The typedef is necessary for
17405 // the macro to parse correctly.
17406 typedef testing::Types<char, int, unsigned int> MyTypes;
17407 TYPED_TEST_CASE(FooTest, MyTypes);
17408 
17409 // If the type list contains only one type, you can write that type
17410 // directly without Types<...>:
17411 //   TYPED_TEST_CASE(FooTest, int);
17412 
17413 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17414 // tests for this test case as you want.
17415 TYPED_TEST(FooTest, DoesBlah) {
17416   // Inside a test, refer to TypeParam to get the type parameter.
17417   // Since we are inside a derived class template, C++ requires use to
17418   // visit the members of FooTest via 'this'.
17419   TypeParam n = this->value_;
17420 
17421   // To visit static members of the fixture, add the TestFixture::
17422   // prefix.
17423   n += TestFixture::shared_;
17424 
17425   // To refer to typedefs in the fixture, add the "typename
17426   // TestFixture::" prefix.
17427   typename TestFixture::List values;
17428   values.push_back(n);
17429   ...
17430 }
17431 
17432 TYPED_TEST(FooTest, HasPropertyA) { ... }
17433 
17434 #endif  // 0
17435 
17436 // Type-parameterized tests are abstract test patterns parameterized
17437 // by a type.  Compared with typed tests, type-parameterized tests
17438 // allow you to define the test pattern without knowing what the type
17439 // parameters are.  The defined pattern can be instantiated with
17440 // different types any number of times, in any number of translation
17441 // units.
17442 //
17443 // If you are designing an interface or concept, you can define a
17444 // suite of type-parameterized tests to verify properties that any
17445 // valid implementation of the interface/concept should have.  Then,
17446 // each implementation can easily instantiate the test suite to verify
17447 // that it conforms to the requirements, without having to write
17448 // similar tests repeatedly.  Here's an example:
17449 
17450 #if 0
17451 
17452 // First, define a fixture class template.  It should be parameterized
17453 // by a type.  Remember to derive it from testing::Test.
17454 template <typename T>
17455 class FooTest : public testing::Test {
17456   ...
17457 };
17458 
17459 // Next, declare that you will define a type-parameterized test case
17460 // (the _P suffix is for "parameterized" or "pattern", whichever you
17461 // prefer):
17462 TYPED_TEST_CASE_P(FooTest);
17463 
17464 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
17465 // for this type-parameterized test case as you want.
17466 TYPED_TEST_P(FooTest, DoesBlah) {
17467   // Inside a test, refer to TypeParam to get the type parameter.
17468   TypeParam n = 0;
17469   ...
17470 }
17471 
17472 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17473 
17474 // Now the tricky part: you need to register all test patterns before
17475 // you can instantiate them.  The first argument of the macro is the
17476 // test case name; the rest are the names of the tests in this test
17477 // case.
17478 REGISTER_TYPED_TEST_CASE_P(FooTest,
17479                            DoesBlah, HasPropertyA);
17480 
17481 // Finally, you are free to instantiate the pattern with the types you
17482 // want.  If you put the above code in a header file, you can #include
17483 // it in multiple C++ source files and instantiate it multiple times.
17484 //
17485 // To distinguish different instances of the pattern, the first
17486 // argument to the INSTANTIATE_* macro is a prefix that will be added
17487 // to the actual test case name.  Remember to pick unique prefixes for
17488 // different instances.
17489 typedef testing::Types<char, int, unsigned int> MyTypes;
17490 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17491 
17492 // If the type list contains only one type, you can write that type
17493 // directly without Types<...>:
17494 //   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17495 
17496 #endif  // 0
17497 
17498 
17499 // Implements typed tests.
17500 
17501 #if GTEST_HAS_TYPED_TEST
17502 
17503 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17504 //
17505 // Expands to the name of the typedef for the type parameters of the
17506 // given test case.
17507 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17508 
17509 // The 'Types' template argument below must have spaces around it
17510 // since some compilers may choke on '>>' when passing a template
17511 // instance (e.g. Types<int>)
17512 # define TYPED_TEST_CASE(CaseName, Types) \
17513   typedef ::testing::internal::TypeList< Types >::type \
17514       GTEST_TYPE_PARAMS_(CaseName)
17515 
17516 # define TYPED_TEST(CaseName, TestName) \
17517   template <typename gtest_TypeParam_> \
17518   class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17519       : public CaseName<gtest_TypeParam_> { \
17520    private: \
17521     typedef CaseName<gtest_TypeParam_> TestFixture; \
17522     typedef gtest_TypeParam_ TypeParam; \
17523     virtual void TestBody(); \
17524   }; \
17525   bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17526       ::testing::internal::TypeParameterizedTest< \
17527           CaseName, \
17528           ::testing::internal::TemplateSel< \
17529               GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17530           GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17531               "", #CaseName, #TestName, 0); \
17532   template <typename gtest_TypeParam_> \
17533   void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17534 
17535 #endif  // GTEST_HAS_TYPED_TEST
17536 
17537 // Implements type-parameterized tests.
17538 
17539 #if GTEST_HAS_TYPED_TEST_P
17540 
17541 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17542 //
17543 // Expands to the namespace name that the type-parameterized tests for
17544 // the given type-parameterized test case are defined in.  The exact
17545 // name of the namespace is subject to change without notice.
17546 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
17547   gtest_case_##TestCaseName##_
17548 
17549 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17550 //
17551 // Expands to the name of the variable used to remember the names of
17552 // the defined tests in the given test case.
17553 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17554   gtest_typed_test_case_p_state_##TestCaseName##_
17555 
17556 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17557 //
17558 // Expands to the name of the variable used to remember the names of
17559 // the registered tests in the given test case.
17560 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17561   gtest_registered_test_names_##TestCaseName##_
17562 
17563 // The variables defined in the type-parameterized test macros are
17564 // static as typically these macros are used in a .h file that can be
17565 // #included in multiple translation units linked together.
17566 # define TYPED_TEST_CASE_P(CaseName) \
17567   static ::testing::internal::TypedTestCasePState \
17568       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17569 
17570 # define TYPED_TEST_P(CaseName, TestName) \
17571   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17572   template <typename gtest_TypeParam_> \
17573   class TestName : public CaseName<gtest_TypeParam_> { \
17574    private: \
17575     typedef CaseName<gtest_TypeParam_> TestFixture; \
17576     typedef gtest_TypeParam_ TypeParam; \
17577     virtual void TestBody(); \
17578   }; \
17579   static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17580       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17581           __FILE__, __LINE__, #CaseName, #TestName); \
17582   } \
17583   template <typename gtest_TypeParam_> \
17584   void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17585 
17586 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17587   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17588   typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17589   } \
17590   static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17591       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17592           __FILE__, __LINE__, #__VA_ARGS__)
17593 
17594 // The 'Types' template argument below must have spaces around it
17595 // since some compilers may choke on '>>' when passing a template
17596 // instance (e.g. Types<int>)
17597 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17598   bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17599       ::testing::internal::TypeParameterizedTestCase<CaseName, \
17600           GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17601           ::testing::internal::TypeList< Types >::type>::Register(\
17602               #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17603 
17604 #endif  // GTEST_HAS_TYPED_TEST_P
17605 
17606 #endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17607 
17608 // Depending on the platform, different string classes are available.
17609 // On Linux, in addition to ::std::string, Google also makes use of
17610 // class ::string, which has the same interface as ::std::string, but
17611 // has a different implementation.
17612 //
17613 // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17614 // ::string is available AND is a distinct type to ::std::string, or
17615 // define it to 0 to indicate otherwise.
17616 //
17617 // If the user's ::std::string and ::string are the same class due to
17618 // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17619 //
17620 // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17621 // heuristically.
17622 
17623 namespace testing {
17624 
17625 // Declares the flags.
17626 
17627 // This flag temporary enables the disabled tests.
17628 GTEST_DECLARE_bool_(also_run_disabled_tests);
17629 
17630 // This flag brings the debugger on an assertion failure.
17631 GTEST_DECLARE_bool_(break_on_failure);
17632 
17633 // This flag controls whether Google Test catches all test-thrown exceptions
17634 // and logs them as failures.
17635 GTEST_DECLARE_bool_(catch_exceptions);
17636 
17637 // This flag enables using colors in terminal output. Available values are
17638 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17639 // to let Google Test decide.
17640 GTEST_DECLARE_string_(color);
17641 
17642 // This flag sets up the filter to select by name using a glob pattern
17643 // the tests to run. If the filter is not given all tests are executed.
17644 GTEST_DECLARE_string_(filter);
17645 
17646 // This flag causes the Google Test to list tests. None of the tests listed
17647 // are actually run if the flag is provided.
17648 GTEST_DECLARE_bool_(list_tests);
17649 
17650 // This flag controls whether Google Test emits a detailed XML report to a file
17651 // in addition to its normal textual output.
17652 GTEST_DECLARE_string_(output);
17653 
17654 // This flags control whether Google Test prints the elapsed time for each
17655 // test.
17656 GTEST_DECLARE_bool_(print_time);
17657 
17658 // This flag specifies the random number seed.
17659 GTEST_DECLARE_int32_(random_seed);
17660 
17661 // This flag sets how many times the tests are repeated. The default value
17662 // is 1. If the value is -1 the tests are repeating forever.
17663 GTEST_DECLARE_int32_(repeat);
17664 
17665 // This flag controls whether Google Test includes Google Test internal
17666 // stack frames in failure stack traces.
17667 GTEST_DECLARE_bool_(show_internal_stack_frames);
17668 
17669 // When this flag is specified, tests' order is randomized on every iteration.
17670 GTEST_DECLARE_bool_(shuffle);
17671 
17672 // This flag specifies the maximum number of stack frames to be
17673 // printed in a failure message.
17674 GTEST_DECLARE_int32_(stack_trace_depth);
17675 
17676 // When this flag is specified, a failed assertion will throw an
17677 // exception if exceptions are enabled, or exit the program with a
17678 // non-zero code otherwise.
17679 GTEST_DECLARE_bool_(throw_on_failure);
17680 
17681 // When this flag is set with a "host:port" string, on supported
17682 // platforms test results are streamed to the specified port on
17683 // the specified host machine.
17684 GTEST_DECLARE_string_(stream_result_to);
17685 
17686 // The upper limit for valid stack trace depths.
17687 const int kMaxStackTraceDepth = 100;
17688 
17689 namespace internal {
17690 
17691 class AssertHelper;
17692 class DefaultGlobalTestPartResultReporter;
17693 class ExecDeathTest;
17694 class NoExecDeathTest;
17695 class FinalSuccessChecker;
17696 class GTestFlagSaver;
17697 class TestResultAccessor;
17698 class TestEventListenersAccessor;
17699 class TestEventRepeater;
17700 class WindowsDeathTest;
17701 class UnitTestImpl* GetUnitTestImpl();
17702 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17703                                     const String& message);
17704 
17705 // Converts a streamable value to a String.  A NULL pointer is
17706 // converted to "(null)".  When the input value is a ::string,
17707 // ::std::string, ::wstring, or ::std::wstring object, each NUL
17708 // character in it is replaced with "\\0".
17709 // Declared in gtest-internal.h but defined here, so that it has access
17710 // to the definition of the Message class, required by the ARM
17711 // compiler.
17712 template <typename T>
17713 String StreamableToString(const T& streamable) {
17714   return (Message() << streamable).GetString();
17715 }
17716 
17717 }  // namespace internal
17718 
17719 // The friend relationship of some of these classes is cyclic.
17720 // If we don't forward declare them the compiler might confuse the classes
17721 // in friendship clauses with same named classes on the scope.
17722 class Test;
17723 class TestCase;
17724 class TestInfo;
17725 class UnitTest;
17726 
17727 // A class for indicating whether an assertion was successful.  When
17728 // the assertion wasn't successful, the AssertionResult object
17729 // remembers a non-empty message that describes how it failed.
17730 //
17731 // To create an instance of this class, use one of the factory functions
17732 // (AssertionSuccess() and AssertionFailure()).
17733 //
17734 // This class is useful for two purposes:
17735 //   1. Defining predicate functions to be used with Boolean test assertions
17736 //      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17737 //   2. Defining predicate-format functions to be
17738 //      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17739 //
17740 // For example, if you define IsEven predicate:
17741 //
17742 //   testing::AssertionResult IsEven(int n) {
17743 //     if ((n % 2) == 0)
17744 //       return testing::AssertionSuccess();
17745 //     else
17746 //       return testing::AssertionFailure() << n << " is odd";
17747 //   }
17748 //
17749 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17750 // will print the message
17751 //
17752 //   Value of: IsEven(Fib(5))
17753 //     Actual: false (5 is odd)
17754 //   Expected: true
17755 //
17756 // instead of a more opaque
17757 //
17758 //   Value of: IsEven(Fib(5))
17759 //     Actual: false
17760 //   Expected: true
17761 //
17762 // in case IsEven is a simple Boolean predicate.
17763 //
17764 // If you expect your predicate to be reused and want to support informative
17765 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17766 // about half as often as positive ones in our tests), supply messages for
17767 // both success and failure cases:
17768 //
17769 //   testing::AssertionResult IsEven(int n) {
17770 //     if ((n % 2) == 0)
17771 //       return testing::AssertionSuccess() << n << " is even";
17772 //     else
17773 //       return testing::AssertionFailure() << n << " is odd";
17774 //   }
17775 //
17776 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17777 //
17778 //   Value of: IsEven(Fib(6))
17779 //     Actual: true (8 is even)
17780 //   Expected: false
17781 //
17782 // NB: Predicates that support negative Boolean assertions have reduced
17783 // performance in positive ones so be careful not to use them in tests
17784 // that have lots (tens of thousands) of positive Boolean assertions.
17785 //
17786 // To use this class with EXPECT_PRED_FORMAT assertions such as:
17787 //
17788 //   // Verifies that Foo() returns an even number.
17789 //   EXPECT_PRED_FORMAT1(IsEven, Foo());
17790 //
17791 // you need to define:
17792 //
17793 //   testing::AssertionResult IsEven(const char* expr, int n) {
17794 //     if ((n % 2) == 0)
17795 //       return testing::AssertionSuccess();
17796 //     else
17797 //       return testing::AssertionFailure()
17798 //         << "Expected: " << expr << " is even\n  Actual: it's " << n;
17799 //   }
17800 //
17801 // If Foo() returns 5, you will see the following message:
17802 //
17803 //   Expected: Foo() is even
17804 //     Actual: it's 5
17805 //
17806 class GTEST_API_ AssertionResult {
17807  public:
17808   // Copy constructor.
17809   // Used in EXPECT_TRUE/FALSE(assertion_result).
17810   AssertionResult(const AssertionResult& other);
17811   // Used in the EXPECT_TRUE/FALSE(bool_expression).
17812   explicit AssertionResult(bool success) : success_(success) {}
17813 
17814   // Returns true iff the assertion succeeded.
17815   operator bool() const { return success_; }  // NOLINT
17816 
17817   // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17818   AssertionResult operator!() const;
17819 
17820   // Returns the text streamed into this AssertionResult. Test assertions
17821   // use it when they fail (i.e., the predicate's outcome doesn't match the
17822   // assertion's expectation). When nothing has been streamed into the
17823   // object, returns an empty string.
17824   const char* message() const {
17825     return message_.get() != NULL ?  message_->c_str() : "";
17826   }
17827   // TODO(vladl@google.com): Remove this after making sure no clients use it.
17828   // Deprecated; please use message() instead.
17829   const char* failure_message() const { return message(); }
17830 
17831   // Streams a custom failure message into this object.
17832   template <typename T> AssertionResult& operator<<(const T& value) {
17833     AppendMessage(Message() << value);
17834     return *this;
17835   }
17836 
17837   // Allows streaming basic output manipulators such as endl or flush into
17838   // this object.
17839   AssertionResult& operator<<(
17840       ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17841     AppendMessage(Message() << basic_manipulator);
17842     return *this;
17843   }
17844 
17845  private:
17846   // Appends the contents of message to message_.
17847   void AppendMessage(const Message& a_message) {
17848     if (message_.get() == NULL)
17849       message_.reset(new ::std::string);
17850     message_->append(a_message.GetString().c_str());
17851   }
17852 
17853   // Stores result of the assertion predicate.
17854   bool success_;
17855   // Stores the message describing the condition in case the expectation
17856   // construct is not satisfied with the predicate's outcome.
17857   // Referenced via a pointer to avoid taking too much stack frame space
17858   // with test assertions.
17859   internal::scoped_ptr< ::std::string> message_;
17860 
17861   GTEST_DISALLOW_ASSIGN_(AssertionResult);
17862 };
17863 
17864 // Makes a successful assertion result.
17865 GTEST_API_ AssertionResult AssertionSuccess();
17866 
17867 // Makes a failed assertion result.
17868 GTEST_API_ AssertionResult AssertionFailure();
17869 
17870 // Makes a failed assertion result with the given failure message.
17871 // Deprecated; use AssertionFailure() << msg.
17872 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17873 
17874 // The abstract class that all tests inherit from.
17875 //
17876 // In Google Test, a unit test program contains one or many TestCases, and
17877 // each TestCase contains one or many Tests.
17878 //
17879 // When you define a test using the TEST macro, you don't need to
17880 // explicitly derive from Test - the TEST macro automatically does
17881 // this for you.
17882 //
17883 // The only time you derive from Test is when defining a test fixture
17884 // to be used a TEST_F.  For example:
17885 //
17886 //   class FooTest : public testing::Test {
17887 //    protected:
17888 //     virtual void SetUp() { ... }
17889 //     virtual void TearDown() { ... }
17890 //     ...
17891 //   };
17892 //
17893 //   TEST_F(FooTest, Bar) { ... }
17894 //   TEST_F(FooTest, Baz) { ... }
17895 //
17896 // Test is not copyable.
17897 class GTEST_API_ Test {
17898  public:
17899   friend class TestInfo;
17900 
17901   // Defines types for pointers to functions that set up and tear down
17902   // a test case.
17903   typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17904   typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17905 
17906   // The d'tor is virtual as we intend to inherit from Test.
17907   virtual ~Test();
17908 
17909   // Sets up the stuff shared by all tests in this test case.
17910   //
17911   // Google Test will call Foo::SetUpTestCase() before running the first
17912   // test in test case Foo.  Hence a sub-class can define its own
17913   // SetUpTestCase() method to shadow the one defined in the super
17914   // class.
17915   static void SetUpTestCase() {}
17916 
17917   // Tears down the stuff shared by all tests in this test case.
17918   //
17919   // Google Test will call Foo::TearDownTestCase() after running the last
17920   // test in test case Foo.  Hence a sub-class can define its own
17921   // TearDownTestCase() method to shadow the one defined in the super
17922   // class.
17923   static void TearDownTestCase() {}
17924 
17925   // Returns true iff the current test has a fatal failure.
17926   static bool HasFatalFailure();
17927 
17928   // Returns true iff the current test has a non-fatal failure.
17929   static bool HasNonfatalFailure();
17930 
17931   // Returns true iff the current test has a (either fatal or
17932   // non-fatal) failure.
17933   static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17934 
17935   // Logs a property for the current test.  Only the last value for a given
17936   // key is remembered.
17937   // These are public static so they can be called from utility functions
17938   // that are not members of the test fixture.
17939   // The arguments are const char* instead strings, as Google Test is used
17940   // on platforms where string doesn't compile.
17941   //
17942   // Note that a driving consideration for these RecordProperty methods
17943   // was to produce xml output suited to the Greenspan charting utility,
17944   // which at present will only chart values that fit in a 32-bit int. It
17945   // is the user's responsibility to restrict their values to 32-bit ints
17946   // if they intend them to be used with Greenspan.
17947   static void RecordProperty(const char* key, const char* value);
17948   static void RecordProperty(const char* key, int value);
17949 
17950  protected:
17951   // Creates a Test object.
17952   Test();
17953 
17954   // Sets up the test fixture.
17955   virtual void SetUp();
17956 
17957   // Tears down the test fixture.
17958   virtual void TearDown();
17959 
17960  private:
17961   // Returns true iff the current test has the same fixture class as
17962   // the first test in the current test case.
17963   static bool HasSameFixtureClass();
17964 
17965   // Runs the test after the test fixture has been set up.
17966   //
17967   // A sub-class must implement this to define the test logic.
17968   //
17969   // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17970   // Instead, use the TEST or TEST_F macro.
17971   virtual void TestBody() = 0;
17972 
17973   // Sets up, executes, and tears down the test.
17974   void Run();
17975 
17976   // Deletes self.  We deliberately pick an unusual name for this
17977   // internal method to avoid clashing with names used in user TESTs.
17978   void DeleteSelf_() { delete this; }
17979 
17980   // Uses a GTestFlagSaver to save and restore all Google Test flags.
17981   const internal::GTestFlagSaver* const gtest_flag_saver_;
17982 
17983   // Often a user mis-spells SetUp() as Setup() and spends a long time
17984   // wondering why it is never called by Google Test.  The declaration of
17985   // the following method is solely for catching such an error at
17986   // compile time:
17987   //
17988   //   - The return type is deliberately chosen to be not void, so it
17989   //   will be a conflict if a user declares void Setup() in his test
17990   //   fixture.
17991   //
17992   //   - This method is private, so it will be another compiler error
17993   //   if a user calls it from his test fixture.
17994   //
17995   // DO NOT OVERRIDE THIS FUNCTION.
17996   //
17997   // If you see an error about overriding the following function or
17998   // about it being private, you have mis-spelled SetUp() as Setup().
17999   struct Setup_should_be_spelled_SetUp {};
18000   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18001 
18002   // We disallow copying Tests.
18003   GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
18004 };
18005 
18006 typedef internal::TimeInMillis TimeInMillis;
18007 
18008 // A copyable object representing a user specified test property which can be
18009 // output as a key/value string pair.
18010 //
18011 // Don't inherit from TestProperty as its destructor is not virtual.
18012 class TestProperty {
18013  public:
18014   // C'tor.  TestProperty does NOT have a default constructor.
18015   // Always use this constructor (with parameters) to create a
18016   // TestProperty object.
18017   TestProperty(const char* a_key, const char* a_value) :
18018     key_(a_key), value_(a_value) {
18019   }
18020 
18021   // Gets the user supplied key.
18022   const char* key() const {
18023     return key_.c_str();
18024   }
18025 
18026   // Gets the user supplied value.
18027   const char* value() const {
18028     return value_.c_str();
18029   }
18030 
18031   // Sets a new value, overriding the one supplied in the constructor.
18032   void SetValue(const char* new_value) {
18033     value_ = new_value;
18034   }
18035 
18036  private:
18037   // The key supplied by the user.
18038   internal::String key_;
18039   // The value supplied by the user.
18040   internal::String value_;
18041 };
18042 
18043 // The result of a single Test.  This includes a list of
18044 // TestPartResults, a list of TestProperties, a count of how many
18045 // death tests there are in the Test, and how much time it took to run
18046 // the Test.
18047 //
18048 // TestResult is not copyable.
18049 class GTEST_API_ TestResult {
18050  public:
18051   // Creates an empty TestResult.
18052   TestResult();
18053 
18054   // D'tor.  Do not inherit from TestResult.
18055   ~TestResult();
18056 
18057   // Gets the number of all test parts.  This is the sum of the number
18058   // of successful test parts and the number of failed test parts.
18059   int total_part_count() const;
18060 
18061   // Returns the number of the test properties.
18062   int test_property_count() const;
18063 
18064   // Returns true iff the test passed (i.e. no test part failed).
18065   bool Passed() const { return !Failed(); }
18066 
18067   // Returns true iff the test failed.
18068   bool Failed() const;
18069 
18070   // Returns true iff the test fatally failed.
18071   bool HasFatalFailure() const;
18072 
18073   // Returns true iff the test has a non-fatal failure.
18074   bool HasNonfatalFailure() const;
18075 
18076   // Returns the elapsed time, in milliseconds.
18077   TimeInMillis elapsed_time() const { return elapsed_time_; }
18078 
18079   // Returns the i-th test part result among all the results. i can range
18080   // from 0 to test_property_count() - 1. If i is not in that range, aborts
18081   // the program.
18082   const TestPartResult& GetTestPartResult(int i) const;
18083 
18084   // Returns the i-th test property. i can range from 0 to
18085   // test_property_count() - 1. If i is not in that range, aborts the
18086   // program.
18087   const TestProperty& GetTestProperty(int i) const;
18088 
18089  private:
18090   friend class TestInfo;
18091   friend class UnitTest;
18092   friend class internal::DefaultGlobalTestPartResultReporter;
18093   friend class internal::ExecDeathTest;
18094   friend class internal::TestResultAccessor;
18095   friend class internal::UnitTestImpl;
18096   friend class internal::WindowsDeathTest;
18097 
18098   // Gets the vector of TestPartResults.
18099   const std::vector<TestPartResult>& test_part_results() const {
18100     return test_part_results_;
18101   }
18102 
18103   // Gets the vector of TestProperties.
18104   const std::vector<TestProperty>& test_properties() const {
18105     return test_properties_;
18106   }
18107 
18108   // Sets the elapsed time.
18109   void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
18110 
18111   // Adds a test property to the list. The property is validated and may add
18112   // a non-fatal failure if invalid (e.g., if it conflicts with reserved
18113   // key names). If a property is already recorded for the same key, the
18114   // value will be updated, rather than storing multiple values for the same
18115   // key.
18116   void RecordProperty(const TestProperty& test_property);
18117 
18118   // Adds a failure if the key is a reserved attribute of Google Test
18119   // testcase tags.  Returns true if the property is valid.
18120   // TODO(russr): Validate attribute names are legal and human readable.
18121   static bool ValidateTestProperty(const TestProperty& test_property);
18122 
18123   // Adds a test part result to the list.
18124   void AddTestPartResult(const TestPartResult& test_part_result);
18125 
18126   // Returns the death test count.
18127   int death_test_count() const { return death_test_count_; }
18128 
18129   // Increments the death test count, returning the new count.
18130   int increment_death_test_count() { return ++death_test_count_; }
18131 
18132   // Clears the test part results.
18133   void ClearTestPartResults();
18134 
18135   // Clears the object.
18136   void Clear();
18137 
18138   // Protects mutable state of the property vector and of owned
18139   // properties, whose values may be updated.
18140   internal::Mutex test_properites_mutex_;
18141 
18142   // The vector of TestPartResults
18143   std::vector<TestPartResult> test_part_results_;
18144   // The vector of TestProperties
18145   std::vector<TestProperty> test_properties_;
18146   // Running count of death tests.
18147   int death_test_count_;
18148   // The elapsed time, in milliseconds.
18149   TimeInMillis elapsed_time_;
18150 
18151   // We disallow copying TestResult.
18152   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18153 };  // class TestResult
18154 
18155 // A TestInfo object stores the following information about a test:
18156 //
18157 //   Test case name
18158 //   Test name
18159 //   Whether the test should be run
18160 //   A function pointer that creates the test object when invoked
18161 //   Test result
18162 //
18163 // The constructor of TestInfo registers itself with the UnitTest
18164 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
18165 // run.
18166 class GTEST_API_ TestInfo {
18167  public:
18168   // Destructs a TestInfo object.  This function is not virtual, so
18169   // don't inherit from TestInfo.
18170   ~TestInfo();
18171 
18172   // Returns the test case name.
18173   const char* test_case_name() const { return test_case_name_.c_str(); }
18174 
18175   // Returns the test name.
18176   const char* name() const { return name_.c_str(); }
18177 
18178   // Returns the name of the parameter type, or NULL if this is not a typed
18179   // or a type-parameterized test.
18180   const char* type_param() const {
18181     if (type_param_.get() != NULL)
18182       return type_param_->c_str();
18183     return NULL;
18184   }
18185 
18186   // Returns the text representation of the value parameter, or NULL if this
18187   // is not a value-parameterized test.
18188   const char* value_param() const {
18189     if (value_param_.get() != NULL)
18190       return value_param_->c_str();
18191     return NULL;
18192   }
18193 
18194   // Returns true if this test should run, that is if the test is not disabled
18195   // (or it is disabled but the also_run_disabled_tests flag has been specified)
18196   // and its full name matches the user-specified filter.
18197   //
18198   // Google Test allows the user to filter the tests by their full names.
18199   // The full name of a test Bar in test case Foo is defined as
18200   // "Foo.Bar".  Only the tests that match the filter will run.
18201   //
18202   // A filter is a colon-separated list of glob (not regex) patterns,
18203   // optionally followed by a '-' and a colon-separated list of
18204   // negative patterns (tests to exclude).  A test is run if it
18205   // matches one of the positive patterns and does not match any of
18206   // the negative patterns.
18207   //
18208   // For example, *A*:Foo.* is a filter that matches any string that
18209   // contains the character 'A' or starts with "Foo.".
18210   bool should_run() const { return should_run_; }
18211 
18212   // Returns the result of the test.
18213   const TestResult* result() const { return &result_; }
18214 
18215  private:
18216 #if GTEST_HAS_DEATH_TEST
18217   friend class internal::DefaultDeathTestFactory;
18218 #endif  // GTEST_HAS_DEATH_TEST
18219   friend class Test;
18220   friend class TestCase;
18221   friend class internal::UnitTestImpl;
18222   friend TestInfo* internal::MakeAndRegisterTestInfo(
18223       const char* test_case_name, const char* name,
18224       const char* type_param,
18225       const char* value_param,
18226       internal::TypeId fixture_class_id,
18227       Test::SetUpTestCaseFunc set_up_tc,
18228       Test::TearDownTestCaseFunc tear_down_tc,
18229       internal::TestFactoryBase* factory);
18230 
18231   // Constructs a TestInfo object. The newly constructed instance assumes
18232   // ownership of the factory object.
18233   TestInfo(const char* test_case_name, const char* name,
18234            const char* a_type_param,
18235            const char* a_value_param,
18236            internal::TypeId fixture_class_id,
18237            internal::TestFactoryBase* factory);
18238 
18239   // Increments the number of death tests encountered in this test so
18240   // far.
18241   int increment_death_test_count() {
18242     return result_.increment_death_test_count();
18243   }
18244 
18245   // Creates the test object, runs it, records its result, and then
18246   // deletes it.
18247   void Run();
18248 
18249   static void ClearTestResult(TestInfo* test_info) {
18250     test_info->result_.Clear();
18251   }
18252 
18253   // These fields are immutable properties of the test.
18254   const std::string test_case_name_;     // Test case name
18255   const std::string name_;               // Test name
18256   // Name of the parameter type, or NULL if this is not a typed or a
18257   // type-parameterized test.
18258   const internal::scoped_ptr<const ::std::string> type_param_;
18259   // Text representation of the value parameter, or NULL if this is not a
18260   // value-parameterized test.
18261   const internal::scoped_ptr<const ::std::string> value_param_;
18262   const internal::TypeId fixture_class_id_;   // ID of the test fixture class
18263   bool should_run_;                 // True iff this test should run
18264   bool is_disabled_;                // True iff this test is disabled
18265   bool matches_filter_;             // True if this test matches the
18266                                     // user-specified filter.
18267   internal::TestFactoryBase* const factory_;  // The factory that creates
18268                                               // the test object
18269 
18270   // This field is mutable and needs to be reset before running the
18271   // test for the second time.
18272   TestResult result_;
18273 
18274   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
18275 };
18276 
18277 // A test case, which consists of a vector of TestInfos.
18278 //
18279 // TestCase is not copyable.
18280 class GTEST_API_ TestCase {
18281  public:
18282   // Creates a TestCase with the given name.
18283   //
18284   // TestCase does NOT have a default constructor.  Always use this
18285   // constructor to create a TestCase object.
18286   //
18287   // Arguments:
18288   //
18289   //   name:         name of the test case
18290   //   a_type_param: the name of the test's type parameter, or NULL if
18291   //                 this is not a type-parameterized test.
18292   //   set_up_tc:    pointer to the function that sets up the test case
18293   //   tear_down_tc: pointer to the function that tears down the test case
18294   TestCase(const char* name, const char* a_type_param,
18295            Test::SetUpTestCaseFunc set_up_tc,
18296            Test::TearDownTestCaseFunc tear_down_tc);
18297 
18298   // Destructor of TestCase.
18299   virtual ~TestCase();
18300 
18301   // Gets the name of the TestCase.
18302   const char* name() const { return name_.c_str(); }
18303 
18304   // Returns the name of the parameter type, or NULL if this is not a
18305   // type-parameterized test case.
18306   const char* type_param() const {
18307     if (type_param_.get() != NULL)
18308       return type_param_->c_str();
18309     return NULL;
18310   }
18311 
18312   // Returns true if any test in this test case should run.
18313   bool should_run() const { return should_run_; }
18314 
18315   // Gets the number of successful tests in this test case.
18316   int successful_test_count() const;
18317 
18318   // Gets the number of failed tests in this test case.
18319   int failed_test_count() const;
18320 
18321   // Gets the number of disabled tests in this test case.
18322   int disabled_test_count() const;
18323 
18324   // Get the number of tests in this test case that should run.
18325   int test_to_run_count() const;
18326 
18327   // Gets the number of all tests in this test case.
18328   int total_test_count() const;
18329 
18330   // Returns true iff the test case passed.
18331   bool Passed() const { return !Failed(); }
18332 
18333   // Returns true iff the test case failed.
18334   bool Failed() const { return failed_test_count() > 0; }
18335 
18336   // Returns the elapsed time, in milliseconds.
18337   TimeInMillis elapsed_time() const { return elapsed_time_; }
18338 
18339   // Returns the i-th test among all the tests. i can range from 0 to
18340   // total_test_count() - 1. If i is not in that range, returns NULL.
18341   const TestInfo* GetTestInfo(int i) const;
18342 
18343  private:
18344   friend class Test;
18345   friend class internal::UnitTestImpl;
18346 
18347   // Gets the (mutable) vector of TestInfos in this TestCase.
18348   std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18349 
18350   // Gets the (immutable) vector of TestInfos in this TestCase.
18351   const std::vector<TestInfo*>& test_info_list() const {
18352     return test_info_list_;
18353   }
18354 
18355   // Returns the i-th test among all the tests. i can range from 0 to
18356   // total_test_count() - 1. If i is not in that range, returns NULL.
18357   TestInfo* GetMutableTestInfo(int i);
18358 
18359   // Sets the should_run member.
18360   void set_should_run(bool should) { should_run_ = should; }
18361 
18362   // Adds a TestInfo to this test case.  Will delete the TestInfo upon
18363   // destruction of the TestCase object.
18364   void AddTestInfo(TestInfo * test_info);
18365 
18366   // Clears the results of all tests in this test case.
18367   void ClearResult();
18368 
18369   // Clears the results of all tests in the given test case.
18370   static void ClearTestCaseResult(TestCase* test_case) {
18371     test_case->ClearResult();
18372   }
18373 
18374   // Runs every test in this TestCase.
18375   void Run();
18376 
18377   // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
18378   // for catching exceptions thrown from SetUpTestCase().
18379   void RunSetUpTestCase() { (*set_up_tc_)(); }
18380 
18381   // Runs TearDownTestCase() for this TestCase.  This wrapper is
18382   // needed for catching exceptions thrown from TearDownTestCase().
18383   void RunTearDownTestCase() { (*tear_down_tc_)(); }
18384 
18385   // Returns true iff test passed.
18386   static bool TestPassed(const TestInfo* test_info) {
18387     return test_info->should_run() && test_info->result()->Passed();
18388   }
18389 
18390   // Returns true iff test failed.
18391   static bool TestFailed(const TestInfo* test_info) {
18392     return test_info->should_run() && test_info->result()->Failed();
18393   }
18394 
18395   // Returns true iff test is disabled.
18396   static bool TestDisabled(const TestInfo* test_info) {
18397     return test_info->is_disabled_;
18398   }
18399 
18400   // Returns true if the given test should run.
18401   static bool ShouldRunTest(const TestInfo* test_info) {
18402     return test_info->should_run();
18403   }
18404 
18405   // Shuffles the tests in this test case.
18406   void ShuffleTests(internal::Random* random);
18407 
18408   // Restores the test order to before the first shuffle.
18409   void UnshuffleTests();
18410 
18411   // Name of the test case.
18412   internal::String name_;
18413   // Name of the parameter type, or NULL if this is not a typed or a
18414   // type-parameterized test.
18415   const internal::scoped_ptr<const ::std::string> type_param_;
18416   // The vector of TestInfos in their original order.  It owns the
18417   // elements in the vector.
18418   std::vector<TestInfo*> test_info_list_;
18419   // Provides a level of indirection for the test list to allow easy
18420   // shuffling and restoring the test order.  The i-th element in this
18421   // vector is the index of the i-th test in the shuffled test list.
18422   std::vector<int> test_indices_;
18423   // Pointer to the function that sets up the test case.
18424   Test::SetUpTestCaseFunc set_up_tc_;
18425   // Pointer to the function that tears down the test case.
18426   Test::TearDownTestCaseFunc tear_down_tc_;
18427   // True iff any test in this test case should run.
18428   bool should_run_;
18429   // Elapsed time, in milliseconds.
18430   TimeInMillis elapsed_time_;
18431 
18432   // We disallow copying TestCases.
18433   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18434 };
18435 
18436 // An Environment object is capable of setting up and tearing down an
18437 // environment.  The user should subclass this to define his own
18438 // environment(s).
18439 //
18440 // An Environment object does the set-up and tear-down in virtual
18441 // methods SetUp() and TearDown() instead of the constructor and the
18442 // destructor, as:
18443 //
18444 //   1. You cannot safely throw from a destructor.  This is a problem
18445 //      as in some cases Google Test is used where exceptions are enabled, and
18446 //      we may want to implement ASSERT_* using exceptions where they are
18447 //      available.
18448 //   2. You cannot use ASSERT_* directly in a constructor or
18449 //      destructor.
18450 class Environment {
18451  public:
18452   // The d'tor is virtual as we need to subclass Environment.
18453   virtual ~Environment() {}
18454 
18455   // Override this to define how to set up the environment.
18456   virtual void SetUp() {}
18457 
18458   // Override this to define how to tear down the environment.
18459   virtual void TearDown() {}
18460  private:
18461   // If you see an error about overriding the following function or
18462   // about it being private, you have mis-spelled SetUp() as Setup().
18463   struct Setup_should_be_spelled_SetUp {};
18464   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18465 };
18466 
18467 // The interface for tracing execution of tests. The methods are organized in
18468 // the order the corresponding events are fired.
18469 class TestEventListener {
18470  public:
18471   virtual ~TestEventListener() {}
18472 
18473   // Fired before any test activity starts.
18474   virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18475 
18476   // Fired before each iteration of tests starts.  There may be more than
18477   // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18478   // index, starting from 0.
18479   virtual void OnTestIterationStart(const UnitTest& unit_test,
18480                                     int iteration) = 0;
18481 
18482   // Fired before environment set-up for each iteration of tests starts.
18483   virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18484 
18485   // Fired after environment set-up for each iteration of tests ends.
18486   virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18487 
18488   // Fired before the test case starts.
18489   virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18490 
18491   // Fired before the test starts.
18492   virtual void OnTestStart(const TestInfo& test_info) = 0;
18493 
18494   // Fired after a failed assertion or a SUCCEED() invocation.
18495   virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18496 
18497   // Fired after the test ends.
18498   virtual void OnTestEnd(const TestInfo& test_info) = 0;
18499 
18500   // Fired after the test case ends.
18501   virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18502 
18503   // Fired before environment tear-down for each iteration of tests starts.
18504   virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18505 
18506   // Fired after environment tear-down for each iteration of tests ends.
18507   virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18508 
18509   // Fired after each iteration of tests finishes.
18510   virtual void OnTestIterationEnd(const UnitTest& unit_test,
18511                                   int iteration) = 0;
18512 
18513   // Fired after all test activities have ended.
18514   virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18515 };
18516 
18517 // The convenience class for users who need to override just one or two
18518 // methods and are not concerned that a possible change to a signature of
18519 // the methods they override will not be caught during the build.  For
18520 // comments about each method please see the definition of TestEventListener
18521 // above.
18522 class EmptyTestEventListener : public TestEventListener {
18523  public:
18524   virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18525   virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18526                                     int /*iteration*/) {}
18527   virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18528   virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18529   virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18530   virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18531   virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18532   virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18533   virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18534   virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18535   virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18536   virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18537                                   int /*iteration*/) {}
18538   virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18539 };
18540 
18541 // TestEventListeners lets users add listeners to track events in Google Test.
18542 class GTEST_API_ TestEventListeners {
18543  public:
18544   TestEventListeners();
18545   ~TestEventListeners();
18546 
18547   // Appends an event listener to the end of the list. Google Test assumes
18548   // the ownership of the listener (i.e. it will delete the listener when
18549   // the test program finishes).
18550   void Append(TestEventListener* listener);
18551 
18552   // Removes the given event listener from the list and returns it.  It then
18553   // becomes the caller's responsibility to delete the listener. Returns
18554   // NULL if the listener is not found in the list.
18555   TestEventListener* Release(TestEventListener* listener);
18556 
18557   // Returns the standard listener responsible for the default console
18558   // output.  Can be removed from the listeners list to shut down default
18559   // console output.  Note that removing this object from the listener list
18560   // with Release transfers its ownership to the caller and makes this
18561   // function return NULL the next time.
18562   TestEventListener* default_result_printer() const {
18563     return default_result_printer_;
18564   }
18565 
18566   // Returns the standard listener responsible for the default XML output
18567   // controlled by the --gtest_output=xml flag.  Can be removed from the
18568   // listeners list by users who want to shut down the default XML output
18569   // controlled by this flag and substitute it with custom one.  Note that
18570   // removing this object from the listener list with Release transfers its
18571   // ownership to the caller and makes this function return NULL the next
18572   // time.
18573   TestEventListener* default_xml_generator() const {
18574     return default_xml_generator_;
18575   }
18576 
18577  private:
18578   friend class TestCase;
18579   friend class TestInfo;
18580   friend class internal::DefaultGlobalTestPartResultReporter;
18581   friend class internal::NoExecDeathTest;
18582   friend class internal::TestEventListenersAccessor;
18583   friend class internal::UnitTestImpl;
18584 
18585   // Returns repeater that broadcasts the TestEventListener events to all
18586   // subscribers.
18587   TestEventListener* repeater();
18588 
18589   // Sets the default_result_printer attribute to the provided listener.
18590   // The listener is also added to the listener list and previous
18591   // default_result_printer is removed from it and deleted. The listener can
18592   // also be NULL in which case it will not be added to the list. Does
18593   // nothing if the previous and the current listener objects are the same.
18594   void SetDefaultResultPrinter(TestEventListener* listener);
18595 
18596   // Sets the default_xml_generator attribute to the provided listener.  The
18597   // listener is also added to the listener list and previous
18598   // default_xml_generator is removed from it and deleted. The listener can
18599   // also be NULL in which case it will not be added to the list. Does
18600   // nothing if the previous and the current listener objects are the same.
18601   void SetDefaultXmlGenerator(TestEventListener* listener);
18602 
18603   // Controls whether events will be forwarded by the repeater to the
18604   // listeners in the list.
18605   bool EventForwardingEnabled() const;
18606   void SuppressEventForwarding();
18607 
18608   // The actual list of listeners.
18609   internal::TestEventRepeater* repeater_;
18610   // Listener responsible for the standard result output.
18611   TestEventListener* default_result_printer_;
18612   // Listener responsible for the creation of the XML output file.
18613   TestEventListener* default_xml_generator_;
18614 
18615   // We disallow copying TestEventListeners.
18616   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18617 };
18618 
18619 // A UnitTest consists of a vector of TestCases.
18620 //
18621 // This is a singleton class.  The only instance of UnitTest is
18622 // created when UnitTest::GetInstance() is first called.  This
18623 // instance is never deleted.
18624 //
18625 // UnitTest is not copyable.
18626 //
18627 // This class is thread-safe as long as the methods are called
18628 // according to their specification.
18629 class GTEST_API_ UnitTest {
18630  public:
18631   // Gets the singleton UnitTest object.  The first time this method
18632   // is called, a UnitTest object is constructed and returned.
18633   // Consecutive calls will return the same object.
18634   static UnitTest* GetInstance();
18635 
18636   // Runs all tests in this UnitTest object and prints the result.
18637   // Returns 0 if successful, or 1 otherwise.
18638   //
18639   // This method can only be called from the main thread.
18640   //
18641   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18642   int Run() GTEST_MUST_USE_RESULT_;
18643 
18644   // Returns the working directory when the first TEST() or TEST_F()
18645   // was executed.  The UnitTest object owns the string.
18646   const char* original_working_dir() const;
18647 
18648   // Returns the TestCase object for the test that's currently running,
18649   // or NULL if no test is running.
18650   const TestCase* current_test_case() const
18651       GTEST_LOCK_EXCLUDED_(mutex_);
18652 
18653   // Returns the TestInfo object for the test that's currently running,
18654   // or NULL if no test is running.
18655   const TestInfo* current_test_info() const
18656       GTEST_LOCK_EXCLUDED_(mutex_);
18657 
18658   // Returns the random seed used at the start of the current test run.
18659   int random_seed() const;
18660 
18661 #if GTEST_HAS_PARAM_TEST
18662   // Returns the ParameterizedTestCaseRegistry object used to keep track of
18663   // value-parameterized tests and instantiate and register them.
18664   //
18665   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18666   internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18667       GTEST_LOCK_EXCLUDED_(mutex_);
18668 #endif  // GTEST_HAS_PARAM_TEST
18669 
18670   // Gets the number of successful test cases.
18671   int successful_test_case_count() const;
18672 
18673   // Gets the number of failed test cases.
18674   int failed_test_case_count() const;
18675 
18676   // Gets the number of all test cases.
18677   int total_test_case_count() const;
18678 
18679   // Gets the number of all test cases that contain at least one test
18680   // that should run.
18681   int test_case_to_run_count() const;
18682 
18683   // Gets the number of successful tests.
18684   int successful_test_count() const;
18685 
18686   // Gets the number of failed tests.
18687   int failed_test_count() const;
18688 
18689   // Gets the number of disabled tests.
18690   int disabled_test_count() const;
18691 
18692   // Gets the number of all tests.
18693   int total_test_count() const;
18694 
18695   // Gets the number of tests that should run.
18696   int test_to_run_count() const;
18697 
18698   // Gets the time of the test program start, in ms from the start of the
18699   // UNIX epoch.
18700   TimeInMillis start_timestamp() const;
18701 
18702   // Gets the elapsed time, in milliseconds.
18703   TimeInMillis elapsed_time() const;
18704 
18705   // Returns true iff the unit test passed (i.e. all test cases passed).
18706   bool Passed() const;
18707 
18708   // Returns true iff the unit test failed (i.e. some test case failed
18709   // or something outside of all tests failed).
18710   bool Failed() const;
18711 
18712   // Gets the i-th test case among all the test cases. i can range from 0 to
18713   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18714   const TestCase* GetTestCase(int i) const;
18715 
18716   // Returns the list of event listeners that can be used to track events
18717   // inside Google Test.
18718   TestEventListeners& listeners();
18719 
18720  private:
18721   // Registers and returns a global test environment.  When a test
18722   // program is run, all global test environments will be set-up in
18723   // the order they were registered.  After all tests in the program
18724   // have finished, all global test environments will be torn-down in
18725   // the *reverse* order they were registered.
18726   //
18727   // The UnitTest object takes ownership of the given environment.
18728   //
18729   // This method can only be called from the main thread.
18730   Environment* AddEnvironment(Environment* env);
18731 
18732   // Adds a TestPartResult to the current TestResult object.  All
18733   // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18734   // eventually call this to report their results.  The user code
18735   // should use the assertion macros instead of calling this directly.
18736   void AddTestPartResult(TestPartResult::Type result_type,
18737                          const char* file_name,
18738                          int line_number,
18739                          const internal::String& message,
18740                          const internal::String& os_stack_trace)
18741       GTEST_LOCK_EXCLUDED_(mutex_);
18742 
18743   // Adds a TestProperty to the current TestResult object. If the result already
18744   // contains a property with the same key, the value will be updated.
18745   void RecordPropertyForCurrentTest(const char* key, const char* value);
18746 
18747   // Gets the i-th test case among all the test cases. i can range from 0 to
18748   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18749   TestCase* GetMutableTestCase(int i);
18750 
18751   // Accessors for the implementation object.
18752   internal::UnitTestImpl* impl() { return impl_; }
18753   const internal::UnitTestImpl* impl() const { return impl_; }
18754 
18755   // These classes and funcions are friends as they need to access private
18756   // members of UnitTest.
18757   friend class Test;
18758   friend class internal::AssertHelper;
18759   friend class internal::ScopedTrace;
18760   friend Environment* AddGlobalTestEnvironment(Environment* env);
18761   friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18762   friend void internal::ReportFailureInUnknownLocation(
18763       TestPartResult::Type result_type,
18764       const internal::String& message);
18765 
18766   // Creates an empty UnitTest.
18767   UnitTest();
18768 
18769   // D'tor
18770   virtual ~UnitTest();
18771 
18772   // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18773   // Google Test trace stack.
18774   void PushGTestTrace(const internal::TraceInfo& trace)
18775       GTEST_LOCK_EXCLUDED_(mutex_);
18776 
18777   // Pops a trace from the per-thread Google Test trace stack.
18778   void PopGTestTrace()
18779       GTEST_LOCK_EXCLUDED_(mutex_);
18780 
18781   // Protects mutable state in *impl_.  This is mutable as some const
18782   // methods need to lock it too.
18783   mutable internal::Mutex mutex_;
18784 
18785   // Opaque implementation object.  This field is never changed once
18786   // the object is constructed.  We don't mark it as const here, as
18787   // doing so will cause a warning in the constructor of UnitTest.
18788   // Mutable state in *impl_ is protected by mutex_.
18789   internal::UnitTestImpl* impl_;
18790 
18791   // We disallow copying UnitTest.
18792   GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18793 };
18794 
18795 // A convenient wrapper for adding an environment for the test
18796 // program.
18797 //
18798 // You should call this before RUN_ALL_TESTS() is called, probably in
18799 // main().  If you use gtest_main, you need to call this before main()
18800 // starts for it to take effect.  For example, you can define a global
18801 // variable like this:
18802 //
18803 //   testing::Environment* const foo_env =
18804 //       testing::AddGlobalTestEnvironment(new FooEnvironment);
18805 //
18806 // However, we strongly recommend you to write your own main() and
18807 // call AddGlobalTestEnvironment() there, as relying on initialization
18808 // of global variables makes the code harder to read and may cause
18809 // problems when you register multiple environments from different
18810 // translation units and the environments have dependencies among them
18811 // (remember that the compiler doesn't guarantee the order in which
18812 // global variables from different translation units are initialized).
18813 inline Environment* AddGlobalTestEnvironment(Environment* env) {
18814   return UnitTest::GetInstance()->AddEnvironment(env);
18815 }
18816 
18817 // Initializes Google Test.  This must be called before calling
18818 // RUN_ALL_TESTS().  In particular, it parses a command line for the
18819 // flags that Google Test recognizes.  Whenever a Google Test flag is
18820 // seen, it is removed from argv, and *argc is decremented.
18821 //
18822 // No value is returned.  Instead, the Google Test flag variables are
18823 // updated.
18824 //
18825 // Calling the function for the second time has no user-visible effect.
18826 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18827 
18828 // This overloaded version can be used in Windows programs compiled in
18829 // UNICODE mode.
18830 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18831 
18832 namespace internal {
18833 
18834 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18835 // value of type ToPrint that is an operand of a comparison assertion
18836 // (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
18837 // the comparison, and is used to help determine the best way to
18838 // format the value.  In particular, when the value is a C string
18839 // (char pointer) and the other operand is an STL string object, we
18840 // want to format the C string as a string, since we know it is
18841 // compared by value with the string object.  If the value is a char
18842 // pointer but the other operand is not an STL string object, we don't
18843 // know whether the pointer is supposed to point to a NUL-terminated
18844 // string, and thus want to print it as a pointer to be safe.
18845 //
18846 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18847 
18848 // The default case.
18849 template <typename ToPrint, typename OtherOperand>
18850 class FormatForComparison {
18851  public:
18852   static ::std::string Format(const ToPrint& value) {
18853     return ::testing::PrintToString(value);
18854   }
18855 };
18856 
18857 // Array.
18858 template <typename ToPrint, size_t N, typename OtherOperand>
18859 class FormatForComparison<ToPrint[N], OtherOperand> {
18860  public:
18861   static ::std::string Format(const ToPrint* value) {
18862     return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18863   }
18864 };
18865 
18866 // By default, print C string as pointers to be safe, as we don't know
18867 // whether they actually point to a NUL-terminated string.
18868 
18869 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
18870   template <typename OtherOperand>                                      \
18871   class FormatForComparison<CharType*, OtherOperand> {                  \
18872    public:                                                              \
18873     static ::std::string Format(CharType* value) {                      \
18874       return ::testing::PrintToString(static_cast<const void*>(value)); \
18875     }                                                                   \
18876   }
18877 
18878 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18879 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18880 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18881 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18882 
18883 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18884 
18885 // If a C string is compared with an STL string object, we know it's meant
18886 // to point to a NUL-terminated string, and thus can print it as a string.
18887 
18888 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18889   template <>                                                           \
18890   class FormatForComparison<CharType*, OtherStringType> {               \
18891    public:                                                              \
18892     static ::std::string Format(CharType* value) {                      \
18893       return ::testing::PrintToString(value);                           \
18894     }                                                                   \
18895   }
18896 
18897 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18898 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18899 
18900 #if GTEST_HAS_GLOBAL_STRING
18901 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18902 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18903 #endif
18904 
18905 #if GTEST_HAS_GLOBAL_WSTRING
18906 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18907 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18908 #endif
18909 
18910 #if GTEST_HAS_STD_WSTRING
18911 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18912 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18913 #endif
18914 
18915 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18916 
18917 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18918 // operand to be used in a failure message.  The type (but not value)
18919 // of the other operand may affect the format.  This allows us to
18920 // print a char* as a raw pointer when it is compared against another
18921 // char* or void*, and print it as a C string when it is compared
18922 // against an std::string object, for example.
18923 //
18924 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18925 template <typename T1, typename T2>
18926 String FormatForComparisonFailureMessage(const T1& value,
18927                                          const T2& /* other_operand */) {
18928   return FormatForComparison<T1, T2>::Format(value);
18929 }
18930 
18931 // The helper function for {ASSERT|EXPECT}_EQ.
18932 template <typename T1, typename T2>
18933 AssertionResult CmpHelperEQ(const char* expected_expression,
18934                             const char* actual_expression,
18935                             const T1& expected,
18936                             const T2& actual) {
18937 #ifdef _MSC_VER
18938 # pragma warning(push)          // Saves the current warning state.
18939 # pragma warning(disable:4389)  // Temporarily disables warning on
18940                                 // signed/unsigned mismatch.
18941 #endif
18942 
18943   if (expected == actual) {
18944     return AssertionSuccess();
18945   }
18946 
18947 #ifdef _MSC_VER
18948 # pragma warning(pop)          // Restores the warning state.
18949 #endif
18950 
18951   return EqFailure(expected_expression,
18952                    actual_expression,
18953                    FormatForComparisonFailureMessage(expected, actual),
18954                    FormatForComparisonFailureMessage(actual, expected),
18955                    false);
18956 }
18957 
18958 // With this overloaded version, we allow anonymous enums to be used
18959 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18960 // can be implicitly cast to BiggestInt.
18961 GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18962                                        const char* actual_expression,
18963                                        BiggestInt expected,
18964                                        BiggestInt actual);
18965 
18966 // The helper class for {ASSERT|EXPECT}_EQ.  The template argument
18967 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18968 // is a null pointer literal.  The following default implementation is
18969 // for lhs_is_null_literal being false.
18970 template <bool lhs_is_null_literal>
18971 class EqHelper {
18972  public:
18973   // This templatized version is for the general case.
18974   template <typename T1, typename T2>
18975   static AssertionResult Compare(const char* expected_expression,
18976                                  const char* actual_expression,
18977                                  const T1& expected,
18978                                  const T2& actual) {
18979     return CmpHelperEQ(expected_expression, actual_expression, expected,
18980                        actual);
18981   }
18982 
18983   // With this overloaded version, we allow anonymous enums to be used
18984   // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18985   // enums can be implicitly cast to BiggestInt.
18986   //
18987   // Even though its body looks the same as the above version, we
18988   // cannot merge the two, as it will make anonymous enums unhappy.
18989   static AssertionResult Compare(const char* expected_expression,
18990                                  const char* actual_expression,
18991                                  BiggestInt expected,
18992                                  BiggestInt actual) {
18993     return CmpHelperEQ(expected_expression, actual_expression, expected,
18994                        actual);
18995   }
18996 };
18997 
18998 // This specialization is used when the first argument to ASSERT_EQ()
18999 // is a null pointer literal, like NULL, false, or 0.
19000 template <>
19001 class EqHelper<true> {
19002  public:
19003   // We define two overloaded versions of Compare().  The first
19004   // version will be picked when the second argument to ASSERT_EQ() is
19005   // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
19006   // EXPECT_EQ(false, a_bool).
19007   template <typename T1, typename T2>
19008   static AssertionResult Compare(
19009       const char* expected_expression,
19010       const char* actual_expression,
19011       const T1& expected,
19012       const T2& actual,
19013       // The following line prevents this overload from being considered if T2
19014       // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
19015       // expands to Compare("", "", NULL, my_ptr), which requires a conversion
19016       // to match the Secret* in the other overload, which would otherwise make
19017       // this template match better.
19018       typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
19019     return CmpHelperEQ(expected_expression, actual_expression, expected,
19020                        actual);
19021   }
19022 
19023   // This version will be picked when the second argument to ASSERT_EQ() is a
19024   // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
19025   template <typename T>
19026   static AssertionResult Compare(
19027       const char* expected_expression,
19028       const char* actual_expression,
19029       // We used to have a second template parameter instead of Secret*.  That
19030       // template parameter would deduce to 'long', making this a better match
19031       // than the first overload even without the first overload's EnableIf.
19032       // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
19033       // non-pointer argument" (even a deduced integral argument), so the old
19034       // implementation caused warnings in user code.
19035       Secret* /* expected (NULL) */,
19036       T* actual) {
19037     // We already know that 'expected' is a null pointer.
19038     return CmpHelperEQ(expected_expression, actual_expression,
19039                        static_cast<T*>(NULL), actual);
19040   }
19041 };
19042 
19043 // A macro for implementing the helper functions needed to implement
19044 // ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
19045 // of similar code.
19046 //
19047 // For each templatized helper function, we also define an overloaded
19048 // version for BiggestInt in order to reduce code bloat and allow
19049 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
19050 // with gcc 4.
19051 //
19052 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19053 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
19054 template <typename T1, typename T2>\
19055 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
19056                                    const T1& val1, const T2& val2) {\
19057   if (val1 op val2) {\
19058     return AssertionSuccess();\
19059   } else {\
19060     return AssertionFailure() \
19061         << "Expected: (" << expr1 << ") " #op " (" << expr2\
19062         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
19063         << " vs " << FormatForComparisonFailureMessage(val2, val1);\
19064   }\
19065 }\
19066 GTEST_API_ AssertionResult CmpHelper##op_name(\
19067     const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
19068 
19069 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19070 
19071 // Implements the helper function for {ASSERT|EXPECT}_NE
19072 GTEST_IMPL_CMP_HELPER_(NE, !=);
19073 // Implements the helper function for {ASSERT|EXPECT}_LE
19074 GTEST_IMPL_CMP_HELPER_(LE, <=);
19075 // Implements the helper function for {ASSERT|EXPECT}_LT
19076 GTEST_IMPL_CMP_HELPER_(LT, <);
19077 // Implements the helper function for {ASSERT|EXPECT}_GE
19078 GTEST_IMPL_CMP_HELPER_(GE, >=);
19079 // Implements the helper function for {ASSERT|EXPECT}_GT
19080 GTEST_IMPL_CMP_HELPER_(GT, >);
19081 
19082 #undef GTEST_IMPL_CMP_HELPER_
19083 
19084 // The helper function for {ASSERT|EXPECT}_STREQ.
19085 //
19086 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19087 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19088                                           const char* actual_expression,
19089                                           const char* expected,
19090                                           const char* actual);
19091 
19092 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
19093 //
19094 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19095 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
19096                                               const char* actual_expression,
19097                                               const char* expected,
19098                                               const char* actual);
19099 
19100 // The helper function for {ASSERT|EXPECT}_STRNE.
19101 //
19102 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19103 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19104                                           const char* s2_expression,
19105                                           const char* s1,
19106                                           const char* s2);
19107 
19108 // The helper function for {ASSERT|EXPECT}_STRCASENE.
19109 //
19110 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19111 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
19112                                               const char* s2_expression,
19113                                               const char* s1,
19114                                               const char* s2);
19115 
19116 
19117 // Helper function for *_STREQ on wide strings.
19118 //
19119 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19120 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19121                                           const char* actual_expression,
19122                                           const wchar_t* expected,
19123                                           const wchar_t* actual);
19124 
19125 // Helper function for *_STRNE on wide strings.
19126 //
19127 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19128 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19129                                           const char* s2_expression,
19130                                           const wchar_t* s1,
19131                                           const wchar_t* s2);
19132 
19133 }  // namespace internal
19134 
19135 // IsSubstring() and IsNotSubstring() are intended to be used as the
19136 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19137 // themselves.  They check whether needle is a substring of haystack
19138 // (NULL is considered a substring of itself only), and return an
19139 // appropriate error message when they fail.
19140 //
19141 // The {needle,haystack}_expr arguments are the stringified
19142 // expressions that generated the two real arguments.
19143 GTEST_API_ AssertionResult IsSubstring(
19144     const char* needle_expr, const char* haystack_expr,
19145     const char* needle, const char* haystack);
19146 GTEST_API_ AssertionResult IsSubstring(
19147     const char* needle_expr, const char* haystack_expr,
19148     const wchar_t* needle, const wchar_t* haystack);
19149 GTEST_API_ AssertionResult IsNotSubstring(
19150     const char* needle_expr, const char* haystack_expr,
19151     const char* needle, const char* haystack);
19152 GTEST_API_ AssertionResult IsNotSubstring(
19153     const char* needle_expr, const char* haystack_expr,
19154     const wchar_t* needle, const wchar_t* haystack);
19155 GTEST_API_ AssertionResult IsSubstring(
19156     const char* needle_expr, const char* haystack_expr,
19157     const ::std::string& needle, const ::std::string& haystack);
19158 GTEST_API_ AssertionResult IsNotSubstring(
19159     const char* needle_expr, const char* haystack_expr,
19160     const ::std::string& needle, const ::std::string& haystack);
19161 
19162 #if GTEST_HAS_STD_WSTRING
19163 GTEST_API_ AssertionResult IsSubstring(
19164     const char* needle_expr, const char* haystack_expr,
19165     const ::std::wstring& needle, const ::std::wstring& haystack);
19166 GTEST_API_ AssertionResult IsNotSubstring(
19167     const char* needle_expr, const char* haystack_expr,
19168     const ::std::wstring& needle, const ::std::wstring& haystack);
19169 #endif  // GTEST_HAS_STD_WSTRING
19170 
19171 namespace internal {
19172 
19173 // Helper template function for comparing floating-points.
19174 //
19175 // Template parameter:
19176 //
19177 //   RawType: the raw floating-point type (either float or double)
19178 //
19179 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19180 template <typename RawType>
19181 AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19182                                          const char* actual_expression,
19183                                          RawType expected,
19184                                          RawType actual) {
19185   const FloatingPoint<RawType> lhs(expected), rhs(actual);
19186 
19187   if (lhs.AlmostEquals(rhs)) {
19188     return AssertionSuccess();
19189   }
19190 
19191   ::std::stringstream expected_ss;
19192   expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19193               << expected;
19194 
19195   ::std::stringstream actual_ss;
19196   actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19197             << actual;
19198 
19199   return EqFailure(expected_expression,
19200                    actual_expression,
19201                    StringStreamToString(&expected_ss),
19202                    StringStreamToString(&actual_ss),
19203                    false);
19204 }
19205 
19206 // Helper function for implementing ASSERT_NEAR.
19207 //
19208 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19209 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19210                                                 const char* expr2,
19211                                                 const char* abs_error_expr,
19212                                                 double val1,
19213                                                 double val2,
19214                                                 double abs_error);
19215 
19216 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19217 // A class that enables one to stream messages to assertion macros
19218 class GTEST_API_ AssertHelper {
19219  public:
19220   // Constructor.
19221   AssertHelper(TestPartResult::Type type,
19222                const char* file,
19223                int line,
19224                const char* message);
19225   ~AssertHelper();
19226 
19227   // Message assignment is a semantic trick to enable assertion
19228   // streaming; see the GTEST_MESSAGE_ macro below.
19229   void operator=(const Message& message) const;
19230 
19231  private:
19232   // We put our data in a struct so that the size of the AssertHelper class can
19233   // be as small as possible.  This is important because gcc is incapable of
19234   // re-using stack space even for temporary variables, so every EXPECT_EQ
19235   // reserves stack space for another AssertHelper.
19236   struct AssertHelperData {
19237     AssertHelperData(TestPartResult::Type t,
19238                      const char* srcfile,
19239                      int line_num,
19240                      const char* msg)
19241         : type(t), file(srcfile), line(line_num), message(msg) { }
19242 
19243     TestPartResult::Type const type;
19244     const char*        const file;
19245     int                const line;
19246     String             const message;
19247 
19248    private:
19249     GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19250   };
19251 
19252   AssertHelperData* const data_;
19253 
19254   GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19255 };
19256 
19257 }  // namespace internal
19258 
19259 #if GTEST_HAS_PARAM_TEST
19260 // The pure interface class that all value-parameterized tests inherit from.
19261 // A value-parameterized class must inherit from both ::testing::Test and
19262 // ::testing::WithParamInterface. In most cases that just means inheriting
19263 // from ::testing::TestWithParam, but more complicated test hierarchies
19264 // may need to inherit from Test and WithParamInterface at different levels.
19265 //
19266 // This interface has support for accessing the test parameter value via
19267 // the GetParam() method.
19268 //
19269 // Use it with one of the parameter generator defining functions, like Range(),
19270 // Values(), ValuesIn(), Bool(), and Combine().
19271 //
19272 // class FooTest : public ::testing::TestWithParam<int> {
19273 //  protected:
19274 //   FooTest() {
19275 //     // Can use GetParam() here.
19276 //   }
19277 //   virtual ~FooTest() {
19278 //     // Can use GetParam() here.
19279 //   }
19280 //   virtual void SetUp() {
19281 //     // Can use GetParam() here.
19282 //   }
19283 //   virtual void TearDown {
19284 //     // Can use GetParam() here.
19285 //   }
19286 // };
19287 // TEST_P(FooTest, DoesBar) {
19288 //   // Can use GetParam() method here.
19289 //   Foo foo;
19290 //   ASSERT_TRUE(foo.DoesBar(GetParam()));
19291 // }
19292 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19293 
19294 template <typename T>
19295 class WithParamInterface {
19296  public:
19297   typedef T ParamType;
19298   virtual ~WithParamInterface() {}
19299 
19300   // The current parameter value. Is also available in the test fixture's
19301   // constructor. This member function is non-static, even though it only
19302   // references static data, to reduce the opportunity for incorrect uses
19303   // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19304   // uses a fixture whose parameter type is int.
19305   const ParamType& GetParam() const { return *parameter_; }
19306 
19307  private:
19308   // Sets parameter value. The caller is responsible for making sure the value
19309   // remains alive and unchanged throughout the current test.
19310   static void SetParam(const ParamType* parameter) {
19311     parameter_ = parameter;
19312   }
19313 
19314   // Static value used for accessing parameter during a test lifetime.
19315   static const ParamType* parameter_;
19316 
19317   // TestClass must be a subclass of WithParamInterface<T> and Test.
19318   template <class TestClass> friend class internal::ParameterizedTestFactory;
19319 };
19320 
19321 template <typename T>
19322 const T* WithParamInterface<T>::parameter_ = NULL;
19323 
19324 // Most value-parameterized classes can ignore the existence of
19325 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
19326 
19327 template <typename T>
19328 class TestWithParam : public Test, public WithParamInterface<T> {
19329 };
19330 
19331 #endif  // GTEST_HAS_PARAM_TEST
19332 
19333 // Macros for indicating success/failure in test code.
19334 
19335 // ADD_FAILURE unconditionally adds a failure to the current test.
19336 // SUCCEED generates a success - it doesn't automatically make the
19337 // current test successful, as a test is only successful when it has
19338 // no failure.
19339 //
19340 // EXPECT_* verifies that a certain condition is satisfied.  If not,
19341 // it behaves like ADD_FAILURE.  In particular:
19342 //
19343 //   EXPECT_TRUE  verifies that a Boolean condition is true.
19344 //   EXPECT_FALSE verifies that a Boolean condition is false.
19345 //
19346 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19347 // that they will also abort the current function on failure.  People
19348 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19349 // writing data-driven tests often find themselves using ADD_FAILURE
19350 // and EXPECT_* more.
19351 
19352 // Generates a nonfatal failure with a generic message.
19353 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19354 
19355 // Generates a nonfatal failure at the given source file location with
19356 // a generic message.
19357 #define ADD_FAILURE_AT(file, line) \
19358   GTEST_MESSAGE_AT_(file, line, "Failed", \
19359                     ::testing::TestPartResult::kNonFatalFailure)
19360 
19361 // Generates a fatal failure with a generic message.
19362 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19363 
19364 // Define this macro to 1 to omit the definition of FAIL(), which is a
19365 // generic name and clashes with some other libraries.
19366 #if !GTEST_DONT_DEFINE_FAIL
19367 # define FAIL() GTEST_FAIL()
19368 #endif
19369 
19370 // Generates a success with a generic message.
19371 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19372 
19373 // Define this macro to 1 to omit the definition of SUCCEED(), which
19374 // is a generic name and clashes with some other libraries.
19375 #if !GTEST_DONT_DEFINE_SUCCEED
19376 # define SUCCEED() GTEST_SUCCEED()
19377 #endif
19378 
19379 // Macros for testing exceptions.
19380 //
19381 //    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19382 //         Tests that the statement throws the expected exception.
19383 //    * {ASSERT|EXPECT}_NO_THROW(statement):
19384 //         Tests that the statement doesn't throw any exception.
19385 //    * {ASSERT|EXPECT}_ANY_THROW(statement):
19386 //         Tests that the statement throws an exception.
19387 
19388 #define EXPECT_THROW(statement, expected_exception) \
19389   GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19390 #define EXPECT_NO_THROW(statement) \
19391   GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19392 #define EXPECT_ANY_THROW(statement) \
19393   GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19394 #define ASSERT_THROW(statement, expected_exception) \
19395   GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19396 #define ASSERT_NO_THROW(statement) \
19397   GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19398 #define ASSERT_ANY_THROW(statement) \
19399   GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19400 
19401 // Boolean assertions. Condition can be either a Boolean expression or an
19402 // AssertionResult. For more information on how to use AssertionResult with
19403 // these macros see comments on that class.
19404 #define EXPECT_TRUE(condition) \
19405   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19406                       GTEST_NONFATAL_FAILURE_)
19407 #define EXPECT_FALSE(condition) \
19408   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19409                       GTEST_NONFATAL_FAILURE_)
19410 #define ASSERT_TRUE(condition) \
19411   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19412                       GTEST_FATAL_FAILURE_)
19413 #define ASSERT_FALSE(condition) \
19414   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19415                       GTEST_FATAL_FAILURE_)
19416 
19417 // Includes the auto-generated header that implements a family of
19418 // generic predicate assertion macros.
19419 // Copyright 2006, Google Inc.
19420 // All rights reserved.
19421 //
19422 // Redistribution and use in source and binary forms, with or without
19423 // modification, are permitted provided that the following conditions are
19424 // met:
19425 //
19426 //     * Redistributions of source code must retain the above copyright
19427 // notice, this list of conditions and the following disclaimer.
19428 //     * Redistributions in binary form must reproduce the above
19429 // copyright notice, this list of conditions and the following disclaimer
19430 // in the documentation and/or other materials provided with the
19431 // distribution.
19432 //     * Neither the name of Google Inc. nor the names of its
19433 // contributors may be used to endorse or promote products derived from
19434 // this software without specific prior written permission.
19435 //
19436 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19437 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19438 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19439 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19440 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19441 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19442 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19443 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19444 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19445 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19446 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19447 
19448 // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19449 // 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
19450 //
19451 // Implements a family of generic predicate assertion macros.
19452 
19453 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19454 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19455 
19456 // Makes sure this header is not included before gtest.h.
19457 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19458 # error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
19459 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_
19460 
19461 // This header implements a family of generic predicate assertion
19462 // macros:
19463 //
19464 //   ASSERT_PRED_FORMAT1(pred_format, v1)
19465 //   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19466 //   ...
19467 //
19468 // where pred_format is a function or functor that takes n (in the
19469 // case of ASSERT_PRED_FORMATn) values and their source expression
19470 // text, and returns a testing::AssertionResult.  See the definition
19471 // of ASSERT_EQ in gtest.h for an example.
19472 //
19473 // If you don't care about formatting, you can use the more
19474 // restrictive version:
19475 //
19476 //   ASSERT_PRED1(pred, v1)
19477 //   ASSERT_PRED2(pred, v1, v2)
19478 //   ...
19479 //
19480 // where pred is an n-ary function or functor that returns bool,
19481 // and the values v1, v2, ..., must support the << operator for
19482 // streaming to std::ostream.
19483 //
19484 // We also define the EXPECT_* variations.
19485 //
19486 // For now we only support predicates whose arity is at most 5.
19487 // Please email googletestframework@googlegroups.com if you need
19488 // support for higher arities.
19489 
19490 // GTEST_ASSERT_ is the basic statement to which all of the assertions
19491 // in this file reduce.  Don't use this in your code.
19492 
19493 #define GTEST_ASSERT_(expression, on_failure) \
19494   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19495   if (const ::testing::AssertionResult gtest_ar = (expression)) \
19496     ; \
19497   else \
19498     on_failure(gtest_ar.failure_message())
19499 
19500 
19501 // Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19502 // this in your code.
19503 template <typename Pred,
19504           typename T1>
19505 AssertionResult AssertPred1Helper(const char* pred_text,
19506                                   const char* e1,
19507                                   Pred pred,
19508                                   const T1& v1) {
19509   if (pred(v1)) return AssertionSuccess();
19510 
19511   return AssertionFailure() << pred_text << "("
19512                             << e1 << ") evaluates to false, where"
19513                             << "\n" << e1 << " evaluates to " << v1;
19514 }
19515 
19516 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19517 // Don't use this in your code.
19518 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19519   GTEST_ASSERT_(pred_format(#v1, v1), \
19520                 on_failure)
19521 
19522 // Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19523 // this in your code.
19524 #define GTEST_PRED1_(pred, v1, on_failure)\
19525   GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19526                                              #v1, \
19527                                              pred, \
19528                                              v1), on_failure)
19529 
19530 // Unary predicate assertion macros.
19531 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
19532   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19533 #define EXPECT_PRED1(pred, v1) \
19534   GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19535 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
19536   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19537 #define ASSERT_PRED1(pred, v1) \
19538   GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19539 
19540 
19541 
19542 // Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19543 // this in your code.
19544 template <typename Pred,
19545           typename T1,
19546           typename T2>
19547 AssertionResult AssertPred2Helper(const char* pred_text,
19548                                   const char* e1,
19549                                   const char* e2,
19550                                   Pred pred,
19551                                   const T1& v1,
19552                                   const T2& v2) {
19553   if (pred(v1, v2)) return AssertionSuccess();
19554 
19555   return AssertionFailure() << pred_text << "("
19556                             << e1 << ", "
19557                             << e2 << ") evaluates to false, where"
19558                             << "\n" << e1 << " evaluates to " << v1
19559                             << "\n" << e2 << " evaluates to " << v2;
19560 }
19561 
19562 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19563 // Don't use this in your code.
19564 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19565   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19566                 on_failure)
19567 
19568 // Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19569 // this in your code.
19570 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
19571   GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19572                                              #v1, \
19573                                              #v2, \
19574                                              pred, \
19575                                              v1, \
19576                                              v2), on_failure)
19577 
19578 // Binary predicate assertion macros.
19579 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19580   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19581 #define EXPECT_PRED2(pred, v1, v2) \
19582   GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19583 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19584   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19585 #define ASSERT_PRED2(pred, v1, v2) \
19586   GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19587 
19588 
19589 
19590 // Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19591 // this in your code.
19592 template <typename Pred,
19593           typename T1,
19594           typename T2,
19595           typename T3>
19596 AssertionResult AssertPred3Helper(const char* pred_text,
19597                                   const char* e1,
19598                                   const char* e2,
19599                                   const char* e3,
19600                                   Pred pred,
19601                                   const T1& v1,
19602                                   const T2& v2,
19603                                   const T3& v3) {
19604   if (pred(v1, v2, v3)) return AssertionSuccess();
19605 
19606   return AssertionFailure() << pred_text << "("
19607                             << e1 << ", "
19608                             << e2 << ", "
19609                             << e3 << ") evaluates to false, where"
19610                             << "\n" << e1 << " evaluates to " << v1
19611                             << "\n" << e2 << " evaluates to " << v2
19612                             << "\n" << e3 << " evaluates to " << v3;
19613 }
19614 
19615 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19616 // Don't use this in your code.
19617 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19618   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19619                 on_failure)
19620 
19621 // Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19622 // this in your code.
19623 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19624   GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19625                                              #v1, \
19626                                              #v2, \
19627                                              #v3, \
19628                                              pred, \
19629                                              v1, \
19630                                              v2, \
19631                                              v3), on_failure)
19632 
19633 // Ternary predicate assertion macros.
19634 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19635   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19636 #define EXPECT_PRED3(pred, v1, v2, v3) \
19637   GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19638 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19639   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19640 #define ASSERT_PRED3(pred, v1, v2, v3) \
19641   GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19642 
19643 
19644 
19645 // Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19646 // this in your code.
19647 template <typename Pred,
19648           typename T1,
19649           typename T2,
19650           typename T3,
19651           typename T4>
19652 AssertionResult AssertPred4Helper(const char* pred_text,
19653                                   const char* e1,
19654                                   const char* e2,
19655                                   const char* e3,
19656                                   const char* e4,
19657                                   Pred pred,
19658                                   const T1& v1,
19659                                   const T2& v2,
19660                                   const T3& v3,
19661                                   const T4& v4) {
19662   if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19663 
19664   return AssertionFailure() << pred_text << "("
19665                             << e1 << ", "
19666                             << e2 << ", "
19667                             << e3 << ", "
19668                             << e4 << ") evaluates to false, where"
19669                             << "\n" << e1 << " evaluates to " << v1
19670                             << "\n" << e2 << " evaluates to " << v2
19671                             << "\n" << e3 << " evaluates to " << v3
19672                             << "\n" << e4 << " evaluates to " << v4;
19673 }
19674 
19675 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19676 // Don't use this in your code.
19677 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19678   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19679                 on_failure)
19680 
19681 // Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19682 // this in your code.
19683 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19684   GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19685                                              #v1, \
19686                                              #v2, \
19687                                              #v3, \
19688                                              #v4, \
19689                                              pred, \
19690                                              v1, \
19691                                              v2, \
19692                                              v3, \
19693                                              v4), on_failure)
19694 
19695 // 4-ary predicate assertion macros.
19696 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19697   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19698 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19699   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19700 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19701   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19702 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19703   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19704 
19705 
19706 
19707 // Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19708 // this in your code.
19709 template <typename Pred,
19710           typename T1,
19711           typename T2,
19712           typename T3,
19713           typename T4,
19714           typename T5>
19715 AssertionResult AssertPred5Helper(const char* pred_text,
19716                                   const char* e1,
19717                                   const char* e2,
19718                                   const char* e3,
19719                                   const char* e4,
19720                                   const char* e5,
19721                                   Pred pred,
19722                                   const T1& v1,
19723                                   const T2& v2,
19724                                   const T3& v3,
19725                                   const T4& v4,
19726                                   const T5& v5) {
19727   if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19728 
19729   return AssertionFailure() << pred_text << "("
19730                             << e1 << ", "
19731                             << e2 << ", "
19732                             << e3 << ", "
19733                             << e4 << ", "
19734                             << e5 << ") evaluates to false, where"
19735                             << "\n" << e1 << " evaluates to " << v1
19736                             << "\n" << e2 << " evaluates to " << v2
19737                             << "\n" << e3 << " evaluates to " << v3
19738                             << "\n" << e4 << " evaluates to " << v4
19739                             << "\n" << e5 << " evaluates to " << v5;
19740 }
19741 
19742 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19743 // Don't use this in your code.
19744 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19745   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19746                 on_failure)
19747 
19748 // Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19749 // this in your code.
19750 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19751   GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19752                                              #v1, \
19753                                              #v2, \
19754                                              #v3, \
19755                                              #v4, \
19756                                              #v5, \
19757                                              pred, \
19758                                              v1, \
19759                                              v2, \
19760                                              v3, \
19761                                              v4, \
19762                                              v5), on_failure)
19763 
19764 // 5-ary predicate assertion macros.
19765 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19766   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19767 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19768   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19769 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19770   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19771 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19772   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19773 
19774 
19775 
19776 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19777 
19778 // Macros for testing equalities and inequalities.
19779 //
19780 //    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19781 //    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
19782 //    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
19783 //    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
19784 //    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
19785 //    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
19786 //
19787 // When they are not, Google Test prints both the tested expressions and
19788 // their actual values.  The values must be compatible built-in types,
19789 // or you will get a compiler error.  By "compatible" we mean that the
19790 // values can be compared by the respective operator.
19791 //
19792 // Note:
19793 //
19794 //   1. It is possible to make a user-defined type work with
19795 //   {ASSERT|EXPECT}_??(), but that requires overloading the
19796 //   comparison operators and is thus discouraged by the Google C++
19797 //   Usage Guide.  Therefore, you are advised to use the
19798 //   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19799 //   equal.
19800 //
19801 //   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19802 //   pointers (in particular, C strings).  Therefore, if you use it
19803 //   with two C strings, you are testing how their locations in memory
19804 //   are related, not how their content is related.  To compare two C
19805 //   strings by content, use {ASSERT|EXPECT}_STR*().
19806 //
19807 //   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19808 //   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19809 //   what the actual value is when it fails, and similarly for the
19810 //   other comparisons.
19811 //
19812 //   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19813 //   evaluate their arguments, which is undefined.
19814 //
19815 //   5. These macros evaluate their arguments exactly once.
19816 //
19817 // Examples:
19818 //
19819 //   EXPECT_NE(5, Foo());
19820 //   EXPECT_EQ(NULL, a_pointer);
19821 //   ASSERT_LT(i, array_size);
19822 //   ASSERT_GT(records.size(), 0) << "There is no record left.";
19823 
19824 #define EXPECT_EQ(expected, actual) \
19825   EXPECT_PRED_FORMAT2(::testing::internal:: \
19826                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19827                       expected, actual)
19828 #define EXPECT_NE(expected, actual) \
19829   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19830 #define EXPECT_LE(val1, val2) \
19831   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19832 #define EXPECT_LT(val1, val2) \
19833   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19834 #define EXPECT_GE(val1, val2) \
19835   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19836 #define EXPECT_GT(val1, val2) \
19837   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19838 
19839 #define GTEST_ASSERT_EQ(expected, actual) \
19840   ASSERT_PRED_FORMAT2(::testing::internal:: \
19841                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19842                       expected, actual)
19843 #define GTEST_ASSERT_NE(val1, val2) \
19844   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19845 #define GTEST_ASSERT_LE(val1, val2) \
19846   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19847 #define GTEST_ASSERT_LT(val1, val2) \
19848   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19849 #define GTEST_ASSERT_GE(val1, val2) \
19850   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19851 #define GTEST_ASSERT_GT(val1, val2) \
19852   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19853 
19854 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19855 // ASSERT_XY(), which clashes with some users' own code.
19856 
19857 #if !GTEST_DONT_DEFINE_ASSERT_EQ
19858 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19859 #endif
19860 
19861 #if !GTEST_DONT_DEFINE_ASSERT_NE
19862 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19863 #endif
19864 
19865 #if !GTEST_DONT_DEFINE_ASSERT_LE
19866 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19867 #endif
19868 
19869 #if !GTEST_DONT_DEFINE_ASSERT_LT
19870 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19871 #endif
19872 
19873 #if !GTEST_DONT_DEFINE_ASSERT_GE
19874 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19875 #endif
19876 
19877 #if !GTEST_DONT_DEFINE_ASSERT_GT
19878 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19879 #endif
19880 
19881 // C String Comparisons.  All tests treat NULL and any non-NULL string
19882 // as different.  Two NULLs are equal.
19883 //
19884 //    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
19885 //    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
19886 //    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19887 //    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19888 //
19889 // For wide or narrow string objects, you can use the
19890 // {ASSERT|EXPECT}_??() macros.
19891 //
19892 // Don't depend on the order in which the arguments are evaluated,
19893 // which is undefined.
19894 //
19895 // These macros evaluate their arguments exactly once.
19896 
19897 #define EXPECT_STREQ(expected, actual) \
19898   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19899 #define EXPECT_STRNE(s1, s2) \
19900   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19901 #define EXPECT_STRCASEEQ(expected, actual) \
19902   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19903 #define EXPECT_STRCASENE(s1, s2)\
19904   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19905 
19906 #define ASSERT_STREQ(expected, actual) \
19907   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19908 #define ASSERT_STRNE(s1, s2) \
19909   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19910 #define ASSERT_STRCASEEQ(expected, actual) \
19911   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19912 #define ASSERT_STRCASENE(s1, s2)\
19913   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19914 
19915 // Macros for comparing floating-point numbers.
19916 //
19917 //    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19918 //         Tests that two float values are almost equal.
19919 //    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19920 //         Tests that two double values are almost equal.
19921 //    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19922 //         Tests that v1 and v2 are within the given distance to each other.
19923 //
19924 // Google Test uses ULP-based comparison to automatically pick a default
19925 // error bound that is appropriate for the operands.  See the
19926 // FloatingPoint template class in gtest-internal.h if you are
19927 // interested in the implementation details.
19928 
19929 #define EXPECT_FLOAT_EQ(expected, actual)\
19930   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19931                       expected, actual)
19932 
19933 #define EXPECT_DOUBLE_EQ(expected, actual)\
19934   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19935                       expected, actual)
19936 
19937 #define ASSERT_FLOAT_EQ(expected, actual)\
19938   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19939                       expected, actual)
19940 
19941 #define ASSERT_DOUBLE_EQ(expected, actual)\
19942   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19943                       expected, actual)
19944 
19945 #define EXPECT_NEAR(val1, val2, abs_error)\
19946   EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19947                       val1, val2, abs_error)
19948 
19949 #define ASSERT_NEAR(val1, val2, abs_error)\
19950   ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19951                       val1, val2, abs_error)
19952 
19953 // These predicate format functions work on floating-point values, and
19954 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19955 //
19956 //   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19957 
19958 // Asserts that val1 is less than, or almost equal to, val2.  Fails
19959 // otherwise.  In particular, it fails if either val1 or val2 is NaN.
19960 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19961                                    float val1, float val2);
19962 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19963                                     double val1, double val2);
19964 
19965 
19966 #if GTEST_OS_WINDOWS
19967 
19968 // Macros that test for HRESULT failure and success, these are only useful
19969 // on Windows, and rely on Windows SDK macros and APIs to compile.
19970 //
19971 //    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19972 //
19973 // When expr unexpectedly fails or succeeds, Google Test prints the
19974 // expected result and the actual result with both a human-readable
19975 // string representation of the error, if available, as well as the
19976 // hex result code.
19977 # define EXPECT_HRESULT_SUCCEEDED(expr) \
19978     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19979 
19980 # define ASSERT_HRESULT_SUCCEEDED(expr) \
19981     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19982 
19983 # define EXPECT_HRESULT_FAILED(expr) \
19984     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19985 
19986 # define ASSERT_HRESULT_FAILED(expr) \
19987     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19988 
19989 #endif  // GTEST_OS_WINDOWS
19990 
19991 // Macros that execute statement and check that it doesn't generate new fatal
19992 // failures in the current thread.
19993 //
19994 //   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19995 //
19996 // Examples:
19997 //
19998 //   EXPECT_NO_FATAL_FAILURE(Process());
19999 //   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
20000 //
20001 #define ASSERT_NO_FATAL_FAILURE(statement) \
20002     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
20003 #define EXPECT_NO_FATAL_FAILURE(statement) \
20004     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
20005 
20006 // Causes a trace (including the source file path, the current line
20007 // number, and the given message) to be included in every test failure
20008 // message generated by code in the current scope.  The effect is
20009 // undone when the control leaves the current scope.
20010 //
20011 // The message argument can be anything streamable to std::ostream.
20012 //
20013 // In the implementation, we include the current line number as part
20014 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
20015 // to appear in the same block - as long as they are on different
20016 // lines.
20017 #define SCOPED_TRACE(message) \
20018   ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
20019     __FILE__, __LINE__, ::testing::Message() << (message))
20020 
20021 // Compile-time assertion for type equality.
20022 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
20023 // the same type.  The value it returns is not interesting.
20024 //
20025 // Instead of making StaticAssertTypeEq a class template, we make it a
20026 // function template that invokes a helper class template.  This
20027 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
20028 // defining objects of that type.
20029 //
20030 // CAVEAT:
20031 //
20032 // When used inside a method of a class template,
20033 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
20034 // instantiated.  For example, given:
20035 //
20036 //   template <typename T> class Foo {
20037 //    public:
20038 //     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
20039 //   };
20040 //
20041 // the code:
20042 //
20043 //   void Test1() { Foo<bool> foo; }
20044 //
20045 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
20046 // actually instantiated.  Instead, you need:
20047 //
20048 //   void Test2() { Foo<bool> foo; foo.Bar(); }
20049 //
20050 // to cause a compiler error.
20051 template <typename T1, typename T2>
20052 bool StaticAssertTypeEq() {
20053   (void)internal::StaticAssertTypeEqHelper<T1, T2>();
20054   return true;
20055 }
20056 
20057 // Defines a test.
20058 //
20059 // The first parameter is the name of the test case, and the second
20060 // parameter is the name of the test within the test case.
20061 //
20062 // The convention is to end the test case name with "Test".  For
20063 // example, a test case for the Foo class can be named FooTest.
20064 //
20065 // The user should put his test code between braces after using this
20066 // macro.  Example:
20067 //
20068 //   TEST(FooTest, InitializesCorrectly) {
20069 //     Foo foo;
20070 //     EXPECT_TRUE(foo.StatusIsOK());
20071 //   }
20072 
20073 // Note that we call GetTestTypeId() instead of GetTypeId<
20074 // ::testing::Test>() here to get the type ID of testing::Test.  This
20075 // is to work around a suspected linker bug when using Google Test as
20076 // a framework on Mac OS X.  The bug causes GetTypeId<
20077 // ::testing::Test>() to return different values depending on whether
20078 // the call is from the Google Test framework itself or from user test
20079 // code.  GetTestTypeId() is guaranteed to always return the same
20080 // value, as it always calls GetTypeId<>() from the Google Test
20081 // framework.
20082 #define GTEST_TEST(test_case_name, test_name)\
20083   GTEST_TEST_(test_case_name, test_name, \
20084               ::testing::Test, ::testing::internal::GetTestTypeId())
20085 
20086 // Define this macro to 1 to omit the definition of TEST(), which
20087 // is a generic name and clashes with some other libraries.
20088 #if !GTEST_DONT_DEFINE_TEST
20089 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
20090 #endif
20091 
20092 // Defines a test that uses a test fixture.
20093 //
20094 // The first parameter is the name of the test fixture class, which
20095 // also doubles as the test case name.  The second parameter is the
20096 // name of the test within the test case.
20097 //
20098 // A test fixture class must be declared earlier.  The user should put
20099 // his test code between braces after using this macro.  Example:
20100 //
20101 //   class FooTest : public testing::Test {
20102 //    protected:
20103 //     virtual void SetUp() { b_.AddElement(3); }
20104 //
20105 //     Foo a_;
20106 //     Foo b_;
20107 //   };
20108 //
20109 //   TEST_F(FooTest, InitializesCorrectly) {
20110 //     EXPECT_TRUE(a_.StatusIsOK());
20111 //   }
20112 //
20113 //   TEST_F(FooTest, ReturnsElementCountCorrectly) {
20114 //     EXPECT_EQ(0, a_.size());
20115 //     EXPECT_EQ(1, b_.size());
20116 //   }
20117 
20118 #define TEST_F(test_fixture, test_name)\
20119   GTEST_TEST_(test_fixture, test_name, test_fixture, \
20120               ::testing::internal::GetTypeId<test_fixture>())
20121 
20122 // Use this macro in main() to run all tests.  It returns 0 if all
20123 // tests are successful, or 1 otherwise.
20124 //
20125 // RUN_ALL_TESTS() should be invoked after the command line has been
20126 // parsed by InitGoogleTest().
20127 
20128 #define RUN_ALL_TESTS()\
20129   (::testing::UnitTest::GetInstance()->Run())
20130 
20131 }  // namespace testing
20132 
20133 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_