Qucs-core  0.0.19
gtest.h
Go to the documentation of this file.
00001 // Copyright 2005, Google Inc.
00002 // All rights reserved.
00003 //
00004 // Redistribution and use in source and binary forms, with or without
00005 // modification, are permitted provided that the following conditions are
00006 // met:
00007 //
00008 //     * Redistributions of source code must retain the above copyright
00009 // notice, this list of conditions and the following disclaimer.
00010 //     * Redistributions in binary form must reproduce the above
00011 // copyright notice, this list of conditions and the following disclaimer
00012 // in the documentation and/or other materials provided with the
00013 // distribution.
00014 //     * Neither the name of Google Inc. nor the names of its
00015 // contributors may be used to endorse or promote products derived from
00016 // this software without specific prior written permission.
00017 //
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00022 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00024 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00025 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00026 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00027 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // Author: wan@google.com (Zhanyong Wan)
00031 //
00032 // The Google C++ Testing Framework (Google Test)
00033 //
00034 // This header file defines the public API for Google Test.  It should be
00035 // included by any test program that uses Google Test.
00036 //
00037 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
00038 // leave some internal implementation details in this header file.
00039 // They are clearly marked by comments like this:
00040 //
00041 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
00042 //
00043 // Such code is NOT meant to be used by a user directly, and is subject
00044 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
00045 // program!
00046 //
00047 // Acknowledgment: Google Test borrowed the idea of automatic test
00048 // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
00049 // easyUnit framework.
00050 
00051 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
00052 #define GTEST_INCLUDE_GTEST_GTEST_H_
00053 
00054 #include <limits>
00055 #include <ostream>
00056 #include <vector>
00057 
00058 // Copyright 2005, Google Inc.
00059 // All rights reserved.
00060 //
00061 // Redistribution and use in source and binary forms, with or without
00062 // modification, are permitted provided that the following conditions are
00063 // met:
00064 //
00065 //     * Redistributions of source code must retain the above copyright
00066 // notice, this list of conditions and the following disclaimer.
00067 //     * Redistributions in binary form must reproduce the above
00068 // copyright notice, this list of conditions and the following disclaimer
00069 // in the documentation and/or other materials provided with the
00070 // distribution.
00071 //     * Neither the name of Google Inc. nor the names of its
00072 // contributors may be used to endorse or promote products derived from
00073 // this software without specific prior written permission.
00074 //
00075 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00076 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00077 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00078 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00079 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00080 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00081 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00082 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00083 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00084 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00085 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00086 //
00087 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
00088 //
00089 // The Google C++ Testing Framework (Google Test)
00090 //
00091 // This header file declares functions and macros used internally by
00092 // Google Test.  They are subject to change without notice.
00093 
00094 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
00095 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
00096 
00097 // Copyright 2005, Google Inc.
00098 // All rights reserved.
00099 //
00100 // Redistribution and use in source and binary forms, with or without
00101 // modification, are permitted provided that the following conditions are
00102 // met:
00103 //
00104 //     * Redistributions of source code must retain the above copyright
00105 // notice, this list of conditions and the following disclaimer.
00106 //     * Redistributions in binary form must reproduce the above
00107 // copyright notice, this list of conditions and the following disclaimer
00108 // in the documentation and/or other materials provided with the
00109 // distribution.
00110 //     * Neither the name of Google Inc. nor the names of its
00111 // contributors may be used to endorse or promote products derived from
00112 // this software without specific prior written permission.
00113 //
00114 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00115 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00116 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00117 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00118 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00119 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00120 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00121 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00122 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00123 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00124 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00125 //
00126 // Authors: wan@google.com (Zhanyong Wan)
00127 //
00128 // Low-level types and utilities for porting Google Test to various
00129 // platforms.  They are subject to change without notice.  DO NOT USE
00130 // THEM IN USER CODE.
00131 //
00132 // This file is fundamental to Google Test.  All other Google Test source
00133 // files are expected to #include this.  Therefore, it cannot #include
00134 // any other Google Test header.
00135 
00136 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
00137 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
00138 
00139 // The user can define the following macros in the build script to
00140 // control Google Test's behavior.  If the user doesn't define a macro
00141 // in this list, Google Test will define it.
00142 //
00143 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
00144 //                              is/isn't available.
00145 //   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
00146 //                              are enabled.
00147 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
00148 //                              is/isn't available (some systems define
00149 //                              ::string, which is different to std::string).
00150 //   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
00151 //                              is/isn't available (some systems define
00152 //                              ::wstring, which is different to std::wstring).
00153 //   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
00154 //                              expressions are/aren't available.
00155 //   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
00156 //                              is/isn't available.
00157 //   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
00158 //                              enabled.
00159 //   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
00160 //                              std::wstring does/doesn't work (Google Test can
00161 //                              be used where std::wstring is unavailable).
00162 //   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
00163 //                              is/isn't available.
00164 //   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
00165 //                              compiler supports Microsoft's "Structured
00166 //                              Exception Handling".
00167 //   GTEST_HAS_STREAM_REDIRECTION
00168 //                            - Define it to 1/0 to indicate whether the
00169 //                              platform supports I/O stream redirection using
00170 //                              dup() and dup2().
00171 //   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
00172 //                              Test's own tr1 tuple implementation should be
00173 //                              used.  Unused when the user sets
00174 //                              GTEST_HAS_TR1_TUPLE to 0.
00175 //   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
00176 //                              is building in C++11/C++98 mode.
00177 //   GTEST_LINKED_AS_SHARED_LIBRARY
00178 //                            - Define to 1 when compiling tests that use
00179 //                              Google Test as a shared library (known as
00180 //                              DLL on Windows).
00181 //   GTEST_CREATE_SHARED_LIBRARY
00182 //                            - Define to 1 when compiling Google Test itself
00183 //                              as a shared library.
00184 
00185 // This header defines the following utilities:
00186 //
00187 // Macros indicating the current platform (defined to 1 if compiled on
00188 // the given platform; otherwise undefined):
00189 //   GTEST_OS_AIX      - IBM AIX
00190 //   GTEST_OS_CYGWIN   - Cygwin
00191 //   GTEST_OS_HPUX     - HP-UX
00192 //   GTEST_OS_LINUX    - Linux
00193 //     GTEST_OS_LINUX_ANDROID - Google Android
00194 //   GTEST_OS_MAC      - Mac OS X
00195 //     GTEST_OS_IOS    - iOS
00196 //       GTEST_OS_IOS_SIMULATOR - iOS simulator
00197 //   GTEST_OS_NACL     - Google Native Client (NaCl)
00198 //   GTEST_OS_OPENBSD  - OpenBSD
00199 //   GTEST_OS_QNX      - QNX
00200 //   GTEST_OS_SOLARIS  - Sun Solaris
00201 //   GTEST_OS_SYMBIAN  - Symbian
00202 //   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
00203 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
00204 //     GTEST_OS_WINDOWS_MINGW    - MinGW
00205 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
00206 //   GTEST_OS_ZOS      - z/OS
00207 //
00208 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
00209 // most stable support.  Since core members of the Google Test project
00210 // don't have access to other platforms, support for them may be less
00211 // stable.  If you notice any problems on your platform, please notify
00212 // googletestframework@googlegroups.com (patches for fixing them are
00213 // even more welcome!).
00214 //
00215 // Note that it is possible that none of the GTEST_OS_* macros are defined.
00216 //
00217 // Macros indicating available Google Test features (defined to 1 if
00218 // the corresponding feature is supported; otherwise undefined):
00219 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
00220 //                            tests)
00221 //   GTEST_HAS_DEATH_TEST   - death tests
00222 //   GTEST_HAS_PARAM_TEST   - value-parameterized tests
00223 //   GTEST_HAS_TYPED_TEST   - typed tests
00224 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
00225 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
00226 //                            GTEST_HAS_POSIX_RE (see above) which users can
00227 //                            define themselves.
00228 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
00229 //                            the above two are mutually exclusive.
00230 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
00231 //
00232 // Macros for basic C++ coding:
00233 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
00234 //   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
00235 //                              variable don't have to be used.
00236 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
00237 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
00238 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
00239 //
00240 // Synchronization:
00241 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
00242 //                  - synchronization primitives.
00243 //   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
00244 //                         synchronization primitives have real implementations
00245 //                         and Google Test is thread-safe; or 0 otherwise.
00246 //
00247 // Template meta programming:
00248 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
00249 //   IteratorTraits - partial implementation of std::iterator_traits, which
00250 //                    is not available in libCstd when compiled with Sun C++.
00251 //
00252 // Smart pointers:
00253 //   scoped_ptr     - as in TR2.
00254 //
00255 // Regular expressions:
00256 //   RE             - a simple regular expression class using the POSIX
00257 //                    Extended Regular Expression syntax on UNIX-like
00258 //                    platforms, or a reduced regular exception syntax on
00259 //                    other platforms, including Windows.
00260 //
00261 // Logging:
00262 //   GTEST_LOG_()   - logs messages at the specified severity level.
00263 //   LogToStderr()  - directs all log messages to stderr.
00264 //   FlushInfoLog() - flushes informational log messages.
00265 //
00266 // Stdout and stderr capturing:
00267 //   CaptureStdout()     - starts capturing stdout.
00268 //   GetCapturedStdout() - stops capturing stdout and returns the captured
00269 //                         string.
00270 //   CaptureStderr()     - starts capturing stderr.
00271 //   GetCapturedStderr() - stops capturing stderr and returns the captured
00272 //                         string.
00273 //
00274 // Integer types:
00275 //   TypeWithSize   - maps an integer to a int type.
00276 //   Int32, UInt32, Int64, UInt64, TimeInMillis
00277 //                  - integers of known sizes.
00278 //   BiggestInt     - the biggest signed integer type.
00279 //
00280 // Command-line utilities:
00281 //   GTEST_FLAG()       - references a flag.
00282 //   GTEST_DECLARE_*()  - declares a flag.
00283 //   GTEST_DEFINE_*()   - defines a flag.
00284 //   GetInjectableArgvs() - returns the command line as a vector of strings.
00285 //
00286 // Environment variable utilities:
00287 //   GetEnv()             - gets the value of an environment variable.
00288 //   BoolFromGTestEnv()   - parses a bool environment variable.
00289 //   Int32FromGTestEnv()  - parses an Int32 environment variable.
00290 //   StringFromGTestEnv() - parses a string environment variable.
00291 
00292 #include <ctype.h>   // for isspace, etc
00293 #include <stddef.h>  // for ptrdiff_t
00294 #include <stdlib.h>
00295 #include <stdio.h>
00296 #include <string.h>
00297 #ifndef _WIN32_WCE
00298 # include <sys/types.h>
00299 # include <sys/stat.h>
00300 #endif  // !_WIN32_WCE
00301 
00302 #if defined __APPLE__
00303 # include <AvailabilityMacros.h>
00304 # include <TargetConditionals.h>
00305 #endif
00306 
00307 #include <iostream>  // NOLINT
00308 #include <sstream>  // NOLINT
00309 #include <string>  // NOLINT
00310 
00311 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
00312 #define GTEST_FLAG_PREFIX_ "gtest_"
00313 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
00314 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
00315 #define GTEST_NAME_ "Google Test"
00316 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
00317 
00318 // Determines the version of gcc that is used to compile this.
00319 #ifdef __GNUC__
00320 // 40302 means version 4.3.2.
00321 # define GTEST_GCC_VER_ \
00322     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
00323 #endif  // __GNUC__
00324 
00325 // Determines the platform on which Google Test is compiled.
00326 #ifdef __CYGWIN__
00327 # define GTEST_OS_CYGWIN 1
00328 #elif defined __SYMBIAN32__
00329 # define GTEST_OS_SYMBIAN 1
00330 #elif defined _WIN32
00331 # define GTEST_OS_WINDOWS 1
00332 # ifdef _WIN32_WCE
00333 #  define GTEST_OS_WINDOWS_MOBILE 1
00334 # elif defined(__MINGW__) || defined(__MINGW32__)
00335 #  define GTEST_OS_WINDOWS_MINGW 1
00336 # else
00337 #  define GTEST_OS_WINDOWS_DESKTOP 1
00338 # endif  // _WIN32_WCE
00339 #elif defined __APPLE__
00340 # define GTEST_OS_MAC 1
00341 # if TARGET_OS_IPHONE
00342 #  define GTEST_OS_IOS 1
00343 #  if TARGET_IPHONE_SIMULATOR
00344 #   define GTEST_OS_IOS_SIMULATOR 1
00345 #  endif
00346 # endif
00347 #elif defined __linux__
00348 # define GTEST_OS_LINUX 1
00349 # if defined __ANDROID__
00350 #  define GTEST_OS_LINUX_ANDROID 1
00351 # endif
00352 #elif defined __MVS__
00353 # define GTEST_OS_ZOS 1
00354 #elif defined(__sun) && defined(__SVR4)
00355 # define GTEST_OS_SOLARIS 1
00356 #elif defined(_AIX)
00357 # define GTEST_OS_AIX 1
00358 #elif defined(__hpux)
00359 # define GTEST_OS_HPUX 1
00360 #elif defined __native_client__
00361 # define GTEST_OS_NACL 1
00362 #elif defined __OpenBSD__
00363 # define GTEST_OS_OPENBSD 1
00364 #elif defined __QNX__
00365 # define GTEST_OS_QNX 1
00366 #endif  // __CYGWIN__
00367 
00368 #ifndef GTEST_LANG_CXX11
00369 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
00370 // -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
00371 // value for __cplusplus, and recent versions of clang, gcc, and
00372 // probably other compilers set that too in C++11 mode.
00373 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
00374 // Compiling in at least C++11 mode.
00375 #  define GTEST_LANG_CXX11 1
00376 # else
00377 #  define GTEST_LANG_CXX11 0
00378 # endif
00379 #endif
00380 
00381 // Brings in definitions for functions used in the testing::internal::posix
00382 // namespace (read, write, close, chdir, isatty, stat). We do not currently
00383 // use them on Windows Mobile.
00384 #if !GTEST_OS_WINDOWS
00385 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
00386 // is not the case, we need to include headers that provide the functions
00387 // mentioned above.
00388 # include <unistd.h>
00389 # include <strings.h>
00390 #elif !GTEST_OS_WINDOWS_MOBILE
00391 # include <direct.h>
00392 # include <io.h>
00393 #endif
00394 
00395 #if GTEST_OS_LINUX_ANDROID
00396 // Used to define __ANDROID_API__ matching the target NDK API level.
00397 #  include <android/api-level.h>  // NOLINT
00398 #endif
00399 
00400 // Defines this to true iff Google Test can use POSIX regular expressions.
00401 #ifndef GTEST_HAS_POSIX_RE
00402 # if GTEST_OS_LINUX_ANDROID
00403 // On Android, <regex.h> is only available starting with Gingerbread.
00404 #  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
00405 # else
00406 #  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
00407 # endif
00408 #endif
00409 
00410 #if GTEST_HAS_POSIX_RE
00411 
00412 // On some platforms, <regex.h> needs someone to define size_t, and
00413 // won't compile otherwise.  We can #include it here as we already
00414 // included <stdlib.h>, which is guaranteed to define size_t through
00415 // <stddef.h>.
00416 # include <regex.h>  // NOLINT
00417 
00418 # define GTEST_USES_POSIX_RE 1
00419 
00420 #elif GTEST_OS_WINDOWS
00421 
00422 // <regex.h> is not available on Windows.  Use our own simple regex
00423 // implementation instead.
00424 # define GTEST_USES_SIMPLE_RE 1
00425 
00426 #else
00427 
00428 // <regex.h> may not be available on this platform.  Use our own
00429 // simple regex implementation instead.
00430 # define GTEST_USES_SIMPLE_RE 1
00431 
00432 #endif  // GTEST_HAS_POSIX_RE
00433 
00434 #ifndef GTEST_HAS_EXCEPTIONS
00435 // The user didn't tell us whether exceptions are enabled, so we need
00436 // to figure it out.
00437 # if defined(_MSC_VER) || defined(__BORLANDC__)
00438 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
00439 // macro to enable exceptions, so we'll do the same.
00440 // Assumes that exceptions are enabled by default.
00441 #  ifndef _HAS_EXCEPTIONS
00442 #   define _HAS_EXCEPTIONS 1
00443 #  endif  // _HAS_EXCEPTIONS
00444 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
00445 # elif defined(__GNUC__) && __EXCEPTIONS
00446 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
00447 #  define GTEST_HAS_EXCEPTIONS 1
00448 # elif defined(__SUNPRO_CC)
00449 // Sun Pro CC supports exceptions.  However, there is no compile-time way of
00450 // detecting whether they are enabled or not.  Therefore, we assume that
00451 // they are enabled unless the user tells us otherwise.
00452 #  define GTEST_HAS_EXCEPTIONS 1
00453 # elif defined(__IBMCPP__) && __EXCEPTIONS
00454 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
00455 #  define GTEST_HAS_EXCEPTIONS 1
00456 # elif defined(__HP_aCC)
00457 // Exception handling is in effect by default in HP aCC compiler. It has to
00458 // be turned of by +noeh compiler option if desired.
00459 #  define GTEST_HAS_EXCEPTIONS 1
00460 # else
00461 // For other compilers, we assume exceptions are disabled to be
00462 // conservative.
00463 #  define GTEST_HAS_EXCEPTIONS 0
00464 # endif  // defined(_MSC_VER) || defined(__BORLANDC__)
00465 #endif  // GTEST_HAS_EXCEPTIONS
00466 
00467 #if !defined(GTEST_HAS_STD_STRING)
00468 // Even though we don't use this macro any longer, we keep it in case
00469 // some clients still depend on it.
00470 # define GTEST_HAS_STD_STRING 1
00471 #elif !GTEST_HAS_STD_STRING
00472 // The user told us that ::std::string isn't available.
00473 # error "Google Test cannot be used where ::std::string isn't available."
00474 #endif  // !defined(GTEST_HAS_STD_STRING)
00475 
00476 #ifndef GTEST_HAS_GLOBAL_STRING
00477 // The user didn't tell us whether ::string is available, so we need
00478 // to figure it out.
00479 
00480 # define GTEST_HAS_GLOBAL_STRING 0
00481 
00482 #endif  // GTEST_HAS_GLOBAL_STRING
00483 
00484 #ifndef GTEST_HAS_STD_WSTRING
00485 // The user didn't tell us whether ::std::wstring is available, so we need
00486 // to figure it out.
00487 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
00488 //   is available.
00489 
00490 // Cygwin 1.7 and below doesn't support ::std::wstring.
00491 // Solaris' libc++ doesn't support it either.  Android has
00492 // no support for it at least as recent as Froyo (2.2).
00493 # define GTEST_HAS_STD_WSTRING \
00494     (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
00495 
00496 #endif  // GTEST_HAS_STD_WSTRING
00497 
00498 #ifndef GTEST_HAS_GLOBAL_WSTRING
00499 // The user didn't tell us whether ::wstring is available, so we need
00500 // to figure it out.
00501 # define GTEST_HAS_GLOBAL_WSTRING \
00502     (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
00503 #endif  // GTEST_HAS_GLOBAL_WSTRING
00504 
00505 // Determines whether RTTI is available.
00506 #ifndef GTEST_HAS_RTTI
00507 // The user didn't tell us whether RTTI is enabled, so we need to
00508 // figure it out.
00509 
00510 # ifdef _MSC_VER
00511 
00512 #  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
00513 #   define GTEST_HAS_RTTI 1
00514 #  else
00515 #   define GTEST_HAS_RTTI 0
00516 #  endif
00517 
00518 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
00519 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
00520 
00521 #  ifdef __GXX_RTTI
00522 // When building against STLport with the Android NDK and with
00523 // -frtti -fno-exceptions, the build fails at link time with undefined
00524 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
00525 // so disable RTTI when detected.
00526 #   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
00527        !defined(__EXCEPTIONS)
00528 #    define GTEST_HAS_RTTI 0
00529 #   else
00530 #    define GTEST_HAS_RTTI 1
00531 #   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
00532 #  else
00533 #   define GTEST_HAS_RTTI 0
00534 #  endif  // __GXX_RTTI
00535 
00536 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
00537 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
00538 // first version with C++ support.
00539 # elif defined(__clang__)
00540 
00541 #  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
00542 
00543 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
00544 // both the typeid and dynamic_cast features are present.
00545 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
00546 
00547 #  ifdef __RTTI_ALL__
00548 #   define GTEST_HAS_RTTI 1
00549 #  else
00550 #   define GTEST_HAS_RTTI 0
00551 #  endif
00552 
00553 # else
00554 
00555 // For all other compilers, we assume RTTI is enabled.
00556 #  define GTEST_HAS_RTTI 1
00557 
00558 # endif  // _MSC_VER
00559 
00560 #endif  // GTEST_HAS_RTTI
00561 
00562 // It's this header's responsibility to #include <typeinfo> when RTTI
00563 // is enabled.
00564 #if GTEST_HAS_RTTI
00565 # include <typeinfo>
00566 #endif
00567 
00568 // Determines whether Google Test can use the pthreads library.
00569 #ifndef GTEST_HAS_PTHREAD
00570 // The user didn't tell us explicitly, so we assume pthreads support is
00571 // available on Linux and Mac.
00572 //
00573 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
00574 // to your compiler flags.
00575 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
00576     || GTEST_OS_QNX)
00577 #endif  // GTEST_HAS_PTHREAD
00578 
00579 #if GTEST_HAS_PTHREAD
00580 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
00581 // true.
00582 # include <pthread.h>  // NOLINT
00583 
00584 // For timespec and nanosleep, used below.
00585 # include <time.h>  // NOLINT
00586 #endif
00587 
00588 // Determines whether Google Test can use tr1/tuple.  You can define
00589 // this macro to 0 to prevent Google Test from using tuple (any
00590 // feature depending on tuple with be disabled in this mode).
00591 #ifndef GTEST_HAS_TR1_TUPLE
00592 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
00593 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
00594 #  define GTEST_HAS_TR1_TUPLE 0
00595 # else
00596 // The user didn't tell us not to do it, so we assume it's OK.
00597 #  define GTEST_HAS_TR1_TUPLE 1
00598 # endif
00599 #endif  // GTEST_HAS_TR1_TUPLE
00600 
00601 // Determines whether Google Test's own tr1 tuple implementation
00602 // should be used.
00603 #ifndef GTEST_USE_OWN_TR1_TUPLE
00604 // The user didn't tell us, so we need to figure it out.
00605 
00606 // We use our own TR1 tuple if we aren't sure the user has an
00607 // implementation of it already.  At this time, libstdc++ 4.0.0+ and
00608 // MSVC 2010 are the only mainstream standard libraries that come
00609 // with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
00610 // pretends to be GCC by defining __GNUC__ and friends, but cannot
00611 // compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
00612 // tuple in a 323 MB Feature Pack download, which we cannot assume the
00613 // user has.  QNX's QCC compiler is a modified GCC but it doesn't
00614 // support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
00615 // and it can be used with some compilers that define __GNUC__.
00616 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
00617       && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
00618 #  define GTEST_ENV_HAS_TR1_TUPLE_ 1
00619 # endif
00620 
00621 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
00622 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
00623 // can build with clang but need to use gcc4.2's libstdc++).
00624 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
00625 #  define GTEST_ENV_HAS_STD_TUPLE_ 1
00626 # endif
00627 
00628 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
00629 #  define GTEST_USE_OWN_TR1_TUPLE 0
00630 # else
00631 #  define GTEST_USE_OWN_TR1_TUPLE 1
00632 # endif
00633 
00634 #endif  // GTEST_USE_OWN_TR1_TUPLE
00635 
00636 // To avoid conditional compilation everywhere, we make it
00637 // gtest-port.h's responsibility to #include the header implementing
00638 // tr1/tuple.
00639 #if GTEST_HAS_TR1_TUPLE
00640 
00641 # if GTEST_USE_OWN_TR1_TUPLE
00642 // This file was GENERATED by command:
00643 //     pump.py gtest-tuple.h.pump
00644 // DO NOT EDIT BY HAND!!!
00645 
00646 // Copyright 2009 Google Inc.
00647 // All Rights Reserved.
00648 //
00649 // Redistribution and use in source and binary forms, with or without
00650 // modification, are permitted provided that the following conditions are
00651 // met:
00652 //
00653 //     * Redistributions of source code must retain the above copyright
00654 // notice, this list of conditions and the following disclaimer.
00655 //     * Redistributions in binary form must reproduce the above
00656 // copyright notice, this list of conditions and the following disclaimer
00657 // in the documentation and/or other materials provided with the
00658 // distribution.
00659 //     * Neither the name of Google Inc. nor the names of its
00660 // contributors may be used to endorse or promote products derived from
00661 // this software without specific prior written permission.
00662 //
00663 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00664 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00665 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00666 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00667 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00668 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00669 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00670 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00671 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00672 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00673 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00674 //
00675 // Author: wan@google.com (Zhanyong Wan)
00676 
00677 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
00678 
00679 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
00680 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
00681 
00682 #include <utility>  // For ::std::pair.
00683 
00684 // The compiler used in Symbian has a bug that prevents us from declaring the
00685 // tuple template as a friend (it complains that tuple is redefined).  This
00686 // hack bypasses the bug by declaring the members that should otherwise be
00687 // private as public.
00688 // Sun Studio versions < 12 also have the above bug.
00689 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
00690 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
00691 #else
00692 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
00693     template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
00694    private:
00695 #endif
00696 
00697 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
00698 #define GTEST_0_TUPLE_(T) tuple<>
00699 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
00700     void, void, void>
00701 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
00702     void, void, void>
00703 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
00704     void, void, void>
00705 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
00706     void, void, void>
00707 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
00708     void, void, void>
00709 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
00710     void, void, void>
00711 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00712     void, void, void>
00713 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00714     T##7, void, void>
00715 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00716     T##7, T##8, void>
00717 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00718     T##7, T##8, T##9>
00719 
00720 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
00721 #define GTEST_0_TYPENAMES_(T)
00722 #define GTEST_1_TYPENAMES_(T) typename T##0
00723 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
00724 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
00725 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00726     typename T##3
00727 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00728     typename T##3, typename T##4
00729 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00730     typename T##3, typename T##4, typename T##5
00731 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00732     typename T##3, typename T##4, typename T##5, typename T##6
00733 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00734     typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
00735 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00736     typename T##3, typename T##4, typename T##5, typename T##6, \
00737     typename T##7, typename T##8
00738 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00739     typename T##3, typename T##4, typename T##5, typename T##6, \
00740     typename T##7, typename T##8, typename T##9
00741 
00742 // In theory, defining stuff in the ::std namespace is undefined
00743 // behavior.  We can do this as we are playing the role of a standard
00744 // library vendor.
00745 namespace std {
00746 namespace tr1 {
00747 
00748 template <typename T0 = void, typename T1 = void, typename T2 = void,
00749     typename T3 = void, typename T4 = void, typename T5 = void,
00750     typename T6 = void, typename T7 = void, typename T8 = void,
00751     typename T9 = void>
00752 class tuple;
00753 
00754 // Anything in namespace gtest_internal is Google Test's INTERNAL
00755 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
00756 namespace gtest_internal {
00757 
00758 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
00759 template <typename T>
00760 struct ByRef { typedef const T& type; };  // NOLINT
00761 template <typename T>
00762 struct ByRef<T&> { typedef T& type; };  // NOLINT
00763 
00764 // A handy wrapper for ByRef.
00765 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
00766 
00767 // AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
00768 // is the same as tr1::add_reference<T>::type.
00769 template <typename T>
00770 struct AddRef { typedef T& type; };  // NOLINT
00771 template <typename T>
00772 struct AddRef<T&> { typedef T& type; };  // NOLINT
00773 
00774 // A handy wrapper for AddRef.
00775 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
00776 
00777 // A helper for implementing get<k>().
00778 template <int k> class Get;
00779 
00780 // A helper for implementing tuple_element<k, T>.  kIndexValid is true
00781 // iff k < the number of fields in tuple type T.
00782 template <bool kIndexValid, int kIndex, class Tuple>
00783 struct TupleElement;
00784 
00785 template <GTEST_10_TYPENAMES_(T)>
00786 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
00787   typedef T0 type;
00788 };
00789 
00790 template <GTEST_10_TYPENAMES_(T)>
00791 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
00792   typedef T1 type;
00793 };
00794 
00795 template <GTEST_10_TYPENAMES_(T)>
00796 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
00797   typedef T2 type;
00798 };
00799 
00800 template <GTEST_10_TYPENAMES_(T)>
00801 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
00802   typedef T3 type;
00803 };
00804 
00805 template <GTEST_10_TYPENAMES_(T)>
00806 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
00807   typedef T4 type;
00808 };
00809 
00810 template <GTEST_10_TYPENAMES_(T)>
00811 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
00812   typedef T5 type;
00813 };
00814 
00815 template <GTEST_10_TYPENAMES_(T)>
00816 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
00817   typedef T6 type;
00818 };
00819 
00820 template <GTEST_10_TYPENAMES_(T)>
00821 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
00822   typedef T7 type;
00823 };
00824 
00825 template <GTEST_10_TYPENAMES_(T)>
00826 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
00827   typedef T8 type;
00828 };
00829 
00830 template <GTEST_10_TYPENAMES_(T)>
00831 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
00832   typedef T9 type;
00833 };
00834 
00835 }  // namespace gtest_internal
00836 
00837 template <>
00838 class tuple<> {
00839  public:
00840   tuple() {}
00841   tuple(const tuple& /* t */)  {}
00842   tuple& operator=(const tuple& /* t */) { return *this; }
00843 };
00844 
00845 template <GTEST_1_TYPENAMES_(T)>
00846 class GTEST_1_TUPLE_(T) {
00847  public:
00848   template <int k> friend class gtest_internal::Get;
00849 
00850   tuple() : f0_() {}
00851 
00852   explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
00853 
00854   tuple(const tuple& t) : f0_(t.f0_) {}
00855 
00856   template <GTEST_1_TYPENAMES_(U)>
00857   tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
00858 
00859   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00860 
00861   template <GTEST_1_TYPENAMES_(U)>
00862   tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
00863     return CopyFrom(t);
00864   }
00865 
00866   GTEST_DECLARE_TUPLE_AS_FRIEND_
00867 
00868   template <GTEST_1_TYPENAMES_(U)>
00869   tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
00870     f0_ = t.f0_;
00871     return *this;
00872   }
00873 
00874   T0 f0_;
00875 };
00876 
00877 template <GTEST_2_TYPENAMES_(T)>
00878 class GTEST_2_TUPLE_(T) {
00879  public:
00880   template <int k> friend class gtest_internal::Get;
00881 
00882   tuple() : f0_(), f1_() {}
00883 
00884   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
00885       f1_(f1) {}
00886 
00887   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
00888 
00889   template <GTEST_2_TYPENAMES_(U)>
00890   tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
00891   template <typename U0, typename U1>
00892   tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
00893 
00894   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00895 
00896   template <GTEST_2_TYPENAMES_(U)>
00897   tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
00898     return CopyFrom(t);
00899   }
00900   template <typename U0, typename U1>
00901   tuple& operator=(const ::std::pair<U0, U1>& p) {
00902     f0_ = p.first;
00903     f1_ = p.second;
00904     return *this;
00905   }
00906 
00907   GTEST_DECLARE_TUPLE_AS_FRIEND_
00908 
00909   template <GTEST_2_TYPENAMES_(U)>
00910   tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
00911     f0_ = t.f0_;
00912     f1_ = t.f1_;
00913     return *this;
00914   }
00915 
00916   T0 f0_;
00917   T1 f1_;
00918 };
00919 
00920 template <GTEST_3_TYPENAMES_(T)>
00921 class GTEST_3_TUPLE_(T) {
00922  public:
00923   template <int k> friend class gtest_internal::Get;
00924 
00925   tuple() : f0_(), f1_(), f2_() {}
00926 
00927   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00928       GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
00929 
00930   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
00931 
00932   template <GTEST_3_TYPENAMES_(U)>
00933   tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
00934 
00935   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00936 
00937   template <GTEST_3_TYPENAMES_(U)>
00938   tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
00939     return CopyFrom(t);
00940   }
00941 
00942   GTEST_DECLARE_TUPLE_AS_FRIEND_
00943 
00944   template <GTEST_3_TYPENAMES_(U)>
00945   tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
00946     f0_ = t.f0_;
00947     f1_ = t.f1_;
00948     f2_ = t.f2_;
00949     return *this;
00950   }
00951 
00952   T0 f0_;
00953   T1 f1_;
00954   T2 f2_;
00955 };
00956 
00957 template <GTEST_4_TYPENAMES_(T)>
00958 class GTEST_4_TUPLE_(T) {
00959  public:
00960   template <int k> friend class gtest_internal::Get;
00961 
00962   tuple() : f0_(), f1_(), f2_(), f3_() {}
00963 
00964   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00965       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
00966       f3_(f3) {}
00967 
00968   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
00969 
00970   template <GTEST_4_TYPENAMES_(U)>
00971   tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
00972       f3_(t.f3_) {}
00973 
00974   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00975 
00976   template <GTEST_4_TYPENAMES_(U)>
00977   tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
00978     return CopyFrom(t);
00979   }
00980 
00981   GTEST_DECLARE_TUPLE_AS_FRIEND_
00982 
00983   template <GTEST_4_TYPENAMES_(U)>
00984   tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
00985     f0_ = t.f0_;
00986     f1_ = t.f1_;
00987     f2_ = t.f2_;
00988     f3_ = t.f3_;
00989     return *this;
00990   }
00991 
00992   T0 f0_;
00993   T1 f1_;
00994   T2 f2_;
00995   T3 f3_;
00996 };
00997 
00998 template <GTEST_5_TYPENAMES_(T)>
00999 class GTEST_5_TUPLE_(T) {
01000  public:
01001   template <int k> friend class gtest_internal::Get;
01002 
01003   tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
01004 
01005   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01006       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
01007       GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
01008 
01009   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01010       f4_(t.f4_) {}
01011 
01012   template <GTEST_5_TYPENAMES_(U)>
01013   tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01014       f3_(t.f3_), f4_(t.f4_) {}
01015 
01016   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01017 
01018   template <GTEST_5_TYPENAMES_(U)>
01019   tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
01020     return CopyFrom(t);
01021   }
01022 
01023   GTEST_DECLARE_TUPLE_AS_FRIEND_
01024 
01025   template <GTEST_5_TYPENAMES_(U)>
01026   tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
01027     f0_ = t.f0_;
01028     f1_ = t.f1_;
01029     f2_ = t.f2_;
01030     f3_ = t.f3_;
01031     f4_ = t.f4_;
01032     return *this;
01033   }
01034 
01035   T0 f0_;
01036   T1 f1_;
01037   T2 f2_;
01038   T3 f3_;
01039   T4 f4_;
01040 };
01041 
01042 template <GTEST_6_TYPENAMES_(T)>
01043 class GTEST_6_TUPLE_(T) {
01044  public:
01045   template <int k> friend class gtest_internal::Get;
01046 
01047   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
01048 
01049   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01050       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01051       GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01052       f5_(f5) {}
01053 
01054   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01055       f4_(t.f4_), f5_(t.f5_) {}
01056 
01057   template <GTEST_6_TYPENAMES_(U)>
01058   tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01059       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
01060 
01061   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01062 
01063   template <GTEST_6_TYPENAMES_(U)>
01064   tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
01065     return CopyFrom(t);
01066   }
01067 
01068   GTEST_DECLARE_TUPLE_AS_FRIEND_
01069 
01070   template <GTEST_6_TYPENAMES_(U)>
01071   tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
01072     f0_ = t.f0_;
01073     f1_ = t.f1_;
01074     f2_ = t.f2_;
01075     f3_ = t.f3_;
01076     f4_ = t.f4_;
01077     f5_ = t.f5_;
01078     return *this;
01079   }
01080 
01081   T0 f0_;
01082   T1 f1_;
01083   T2 f2_;
01084   T3 f3_;
01085   T4 f4_;
01086   T5 f5_;
01087 };
01088 
01089 template <GTEST_7_TYPENAMES_(T)>
01090 class GTEST_7_TUPLE_(T) {
01091  public:
01092   template <int k> friend class gtest_internal::Get;
01093 
01094   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
01095 
01096   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01097       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01098       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
01099       f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
01100 
01101   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01102       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
01103 
01104   template <GTEST_7_TYPENAMES_(U)>
01105   tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01106       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
01107 
01108   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01109 
01110   template <GTEST_7_TYPENAMES_(U)>
01111   tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
01112     return CopyFrom(t);
01113   }
01114 
01115   GTEST_DECLARE_TUPLE_AS_FRIEND_
01116 
01117   template <GTEST_7_TYPENAMES_(U)>
01118   tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
01119     f0_ = t.f0_;
01120     f1_ = t.f1_;
01121     f2_ = t.f2_;
01122     f3_ = t.f3_;
01123     f4_ = t.f4_;
01124     f5_ = t.f5_;
01125     f6_ = t.f6_;
01126     return *this;
01127   }
01128 
01129   T0 f0_;
01130   T1 f1_;
01131   T2 f2_;
01132   T3 f3_;
01133   T4 f4_;
01134   T5 f5_;
01135   T6 f6_;
01136 };
01137 
01138 template <GTEST_8_TYPENAMES_(T)>
01139 class GTEST_8_TUPLE_(T) {
01140  public:
01141   template <int k> friend class gtest_internal::Get;
01142 
01143   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
01144 
01145   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01146       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01147       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
01148       GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01149       f5_(f5), f6_(f6), f7_(f7) {}
01150 
01151   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01152       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
01153 
01154   template <GTEST_8_TYPENAMES_(U)>
01155   tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01156       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
01157 
01158   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01159 
01160   template <GTEST_8_TYPENAMES_(U)>
01161   tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
01162     return CopyFrom(t);
01163   }
01164 
01165   GTEST_DECLARE_TUPLE_AS_FRIEND_
01166 
01167   template <GTEST_8_TYPENAMES_(U)>
01168   tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
01169     f0_ = t.f0_;
01170     f1_ = t.f1_;
01171     f2_ = t.f2_;
01172     f3_ = t.f3_;
01173     f4_ = t.f4_;
01174     f5_ = t.f5_;
01175     f6_ = t.f6_;
01176     f7_ = t.f7_;
01177     return *this;
01178   }
01179 
01180   T0 f0_;
01181   T1 f1_;
01182   T2 f2_;
01183   T3 f3_;
01184   T4 f4_;
01185   T5 f5_;
01186   T6 f6_;
01187   T7 f7_;
01188 };
01189 
01190 template <GTEST_9_TYPENAMES_(T)>
01191 class GTEST_9_TUPLE_(T) {
01192  public:
01193   template <int k> friend class gtest_internal::Get;
01194 
01195   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
01196 
01197   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01198       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01199       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
01200       GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01201       f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
01202 
01203   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01204       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
01205 
01206   template <GTEST_9_TYPENAMES_(U)>
01207   tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01208       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
01209 
01210   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01211 
01212   template <GTEST_9_TYPENAMES_(U)>
01213   tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
01214     return CopyFrom(t);
01215   }
01216 
01217   GTEST_DECLARE_TUPLE_AS_FRIEND_
01218 
01219   template <GTEST_9_TYPENAMES_(U)>
01220   tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
01221     f0_ = t.f0_;
01222     f1_ = t.f1_;
01223     f2_ = t.f2_;
01224     f3_ = t.f3_;
01225     f4_ = t.f4_;
01226     f5_ = t.f5_;
01227     f6_ = t.f6_;
01228     f7_ = t.f7_;
01229     f8_ = t.f8_;
01230     return *this;
01231   }
01232 
01233   T0 f0_;
01234   T1 f1_;
01235   T2 f2_;
01236   T3 f3_;
01237   T4 f4_;
01238   T5 f5_;
01239   T6 f6_;
01240   T7 f7_;
01241   T8 f8_;
01242 };
01243 
01244 template <GTEST_10_TYPENAMES_(T)>
01245 class tuple {
01246  public:
01247   template <int k> friend class gtest_internal::Get;
01248 
01249   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
01250       f9_() {}
01251 
01252   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01253       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01254       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
01255       GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
01256       f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
01257 
01258   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01259       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
01260 
01261   template <GTEST_10_TYPENAMES_(U)>
01262   tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01263       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
01264       f9_(t.f9_) {}
01265 
01266   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01267 
01268   template <GTEST_10_TYPENAMES_(U)>
01269   tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
01270     return CopyFrom(t);
01271   }
01272 
01273   GTEST_DECLARE_TUPLE_AS_FRIEND_
01274 
01275   template <GTEST_10_TYPENAMES_(U)>
01276   tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
01277     f0_ = t.f0_;
01278     f1_ = t.f1_;
01279     f2_ = t.f2_;
01280     f3_ = t.f3_;
01281     f4_ = t.f4_;
01282     f5_ = t.f5_;
01283     f6_ = t.f6_;
01284     f7_ = t.f7_;
01285     f8_ = t.f8_;
01286     f9_ = t.f9_;
01287     return *this;
01288   }
01289 
01290   T0 f0_;
01291   T1 f1_;
01292   T2 f2_;
01293   T3 f3_;
01294   T4 f4_;
01295   T5 f5_;
01296   T6 f6_;
01297   T7 f7_;
01298   T8 f8_;
01299   T9 f9_;
01300 };
01301 
01302 // 6.1.3.2 Tuple creation functions.
01303 
01304 // Known limitations: we don't support passing an
01305 // std::tr1::reference_wrapper<T> to make_tuple().  And we don't
01306 // implement tie().
01307 
01308 inline tuple<> make_tuple() { return tuple<>(); }
01309 
01310 template <GTEST_1_TYPENAMES_(T)>
01311 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
01312   return GTEST_1_TUPLE_(T)(f0);
01313 }
01314 
01315 template <GTEST_2_TYPENAMES_(T)>
01316 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
01317   return GTEST_2_TUPLE_(T)(f0, f1);
01318 }
01319 
01320 template <GTEST_3_TYPENAMES_(T)>
01321 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
01322   return GTEST_3_TUPLE_(T)(f0, f1, f2);
01323 }
01324 
01325 template <GTEST_4_TYPENAMES_(T)>
01326 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01327     const T3& f3) {
01328   return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
01329 }
01330 
01331 template <GTEST_5_TYPENAMES_(T)>
01332 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01333     const T3& f3, const T4& f4) {
01334   return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
01335 }
01336 
01337 template <GTEST_6_TYPENAMES_(T)>
01338 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01339     const T3& f3, const T4& f4, const T5& f5) {
01340   return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
01341 }
01342 
01343 template <GTEST_7_TYPENAMES_(T)>
01344 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01345     const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
01346   return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
01347 }
01348 
01349 template <GTEST_8_TYPENAMES_(T)>
01350 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01351     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
01352   return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
01353 }
01354 
01355 template <GTEST_9_TYPENAMES_(T)>
01356 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01357     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
01358     const T8& f8) {
01359   return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
01360 }
01361 
01362 template <GTEST_10_TYPENAMES_(T)>
01363 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01364     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
01365     const T8& f8, const T9& f9) {
01366   return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
01367 }
01368 
01369 // 6.1.3.3 Tuple helper classes.
01370 
01371 template <typename Tuple> struct tuple_size;
01372 
01373 template <GTEST_0_TYPENAMES_(T)>
01374 struct tuple_size<GTEST_0_TUPLE_(T) > {
01375   static const int value = 0;
01376 };
01377 
01378 template <GTEST_1_TYPENAMES_(T)>
01379 struct tuple_size<GTEST_1_TUPLE_(T) > {
01380   static const int value = 1;
01381 };
01382 
01383 template <GTEST_2_TYPENAMES_(T)>
01384 struct tuple_size<GTEST_2_TUPLE_(T) > {
01385   static const int value = 2;
01386 };
01387 
01388 template <GTEST_3_TYPENAMES_(T)>
01389 struct tuple_size<GTEST_3_TUPLE_(T) > {
01390   static const int value = 3;
01391 };
01392 
01393 template <GTEST_4_TYPENAMES_(T)>
01394 struct tuple_size<GTEST_4_TUPLE_(T) > {
01395   static const int value = 4;
01396 };
01397 
01398 template <GTEST_5_TYPENAMES_(T)>
01399 struct tuple_size<GTEST_5_TUPLE_(T) > {
01400   static const int value = 5;
01401 };
01402 
01403 template <GTEST_6_TYPENAMES_(T)>
01404 struct tuple_size<GTEST_6_TUPLE_(T) > {
01405   static const int value = 6;
01406 };
01407 
01408 template <GTEST_7_TYPENAMES_(T)>
01409 struct tuple_size<GTEST_7_TUPLE_(T) > {
01410   static const int value = 7;
01411 };
01412 
01413 template <GTEST_8_TYPENAMES_(T)>
01414 struct tuple_size<GTEST_8_TUPLE_(T) > {
01415   static const int value = 8;
01416 };
01417 
01418 template <GTEST_9_TYPENAMES_(T)>
01419 struct tuple_size<GTEST_9_TUPLE_(T) > {
01420   static const int value = 9;
01421 };
01422 
01423 template <GTEST_10_TYPENAMES_(T)>
01424 struct tuple_size<GTEST_10_TUPLE_(T) > {
01425   static const int value = 10;
01426 };
01427 
01428 template <int k, class Tuple>
01429 struct tuple_element {
01430   typedef typename gtest_internal::TupleElement<
01431       k < (tuple_size<Tuple>::value), k, Tuple>::type type;
01432 };
01433 
01434 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
01435 
01436 // 6.1.3.4 Element access.
01437 
01438 namespace gtest_internal {
01439 
01440 template <>
01441 class Get<0> {
01442  public:
01443   template <class Tuple>
01444   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
01445   Field(Tuple& t) { return t.f0_; }  // NOLINT
01446 
01447   template <class Tuple>
01448   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
01449   ConstField(const Tuple& t) { return t.f0_; }
01450 };
01451 
01452 template <>
01453 class Get<1> {
01454  public:
01455   template <class Tuple>
01456   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
01457   Field(Tuple& t) { return t.f1_; }  // NOLINT
01458 
01459   template <class Tuple>
01460   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
01461   ConstField(const Tuple& t) { return t.f1_; }
01462 };
01463 
01464 template <>
01465 class Get<2> {
01466  public:
01467   template <class Tuple>
01468   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
01469   Field(Tuple& t) { return t.f2_; }  // NOLINT
01470 
01471   template <class Tuple>
01472   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
01473   ConstField(const Tuple& t) { return t.f2_; }
01474 };
01475 
01476 template <>
01477 class Get<3> {
01478  public:
01479   template <class Tuple>
01480   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
01481   Field(Tuple& t) { return t.f3_; }  // NOLINT
01482 
01483   template <class Tuple>
01484   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
01485   ConstField(const Tuple& t) { return t.f3_; }
01486 };
01487 
01488 template <>
01489 class Get<4> {
01490  public:
01491   template <class Tuple>
01492   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
01493   Field(Tuple& t) { return t.f4_; }  // NOLINT
01494 
01495   template <class Tuple>
01496   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
01497   ConstField(const Tuple& t) { return t.f4_; }
01498 };
01499 
01500 template <>
01501 class Get<5> {
01502  public:
01503   template <class Tuple>
01504   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
01505   Field(Tuple& t) { return t.f5_; }  // NOLINT
01506 
01507   template <class Tuple>
01508   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
01509   ConstField(const Tuple& t) { return t.f5_; }
01510 };
01511 
01512 template <>
01513 class Get<6> {
01514  public:
01515   template <class Tuple>
01516   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
01517   Field(Tuple& t) { return t.f6_; }  // NOLINT
01518 
01519   template <class Tuple>
01520   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
01521   ConstField(const Tuple& t) { return t.f6_; }
01522 };
01523 
01524 template <>
01525 class Get<7> {
01526  public:
01527   template <class Tuple>
01528   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
01529   Field(Tuple& t) { return t.f7_; }  // NOLINT
01530 
01531   template <class Tuple>
01532   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
01533   ConstField(const Tuple& t) { return t.f7_; }
01534 };
01535 
01536 template <>
01537 class Get<8> {
01538  public:
01539   template <class Tuple>
01540   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
01541   Field(Tuple& t) { return t.f8_; }  // NOLINT
01542 
01543   template <class Tuple>
01544   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
01545   ConstField(const Tuple& t) { return t.f8_; }
01546 };
01547 
01548 template <>
01549 class Get<9> {
01550  public:
01551   template <class Tuple>
01552   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
01553   Field(Tuple& t) { return t.f9_; }  // NOLINT
01554 
01555   template <class Tuple>
01556   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
01557   ConstField(const Tuple& t) { return t.f9_; }
01558 };
01559 
01560 }  // namespace gtest_internal
01561 
01562 template <int k, GTEST_10_TYPENAMES_(T)>
01563 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
01564 get(GTEST_10_TUPLE_(T)& t) {
01565   return gtest_internal::Get<k>::Field(t);
01566 }
01567 
01568 template <int k, GTEST_10_TYPENAMES_(T)>
01569 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
01570 get(const GTEST_10_TUPLE_(T)& t) {
01571   return gtest_internal::Get<k>::ConstField(t);
01572 }
01573 
01574 // 6.1.3.5 Relational operators
01575 
01576 // We only implement == and !=, as we don't have a need for the rest yet.
01577 
01578 namespace gtest_internal {
01579 
01580 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
01581 // first k fields of t1 equals the first k fields of t2.
01582 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
01583 // k1 != k2.
01584 template <int kSize1, int kSize2>
01585 struct SameSizeTuplePrefixComparator;
01586 
01587 template <>
01588 struct SameSizeTuplePrefixComparator<0, 0> {
01589   template <class Tuple1, class Tuple2>
01590   static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
01591     return true;
01592   }
01593 };
01594 
01595 template <int k>
01596 struct SameSizeTuplePrefixComparator<k, k> {
01597   template <class Tuple1, class Tuple2>
01598   static bool Eq(const Tuple1& t1, const Tuple2& t2) {
01599     return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
01600         ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
01601   }
01602 };
01603 
01604 }  // namespace gtest_internal
01605 
01606 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
01607 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
01608                        const GTEST_10_TUPLE_(U)& u) {
01609   return gtest_internal::SameSizeTuplePrefixComparator<
01610       tuple_size<GTEST_10_TUPLE_(T) >::value,
01611       tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
01612 }
01613 
01614 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
01615 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
01616                        const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
01617 
01618 // 6.1.4 Pairs.
01619 // Unimplemented.
01620 
01621 }  // namespace tr1
01622 }  // namespace std
01623 
01624 #undef GTEST_0_TUPLE_
01625 #undef GTEST_1_TUPLE_
01626 #undef GTEST_2_TUPLE_
01627 #undef GTEST_3_TUPLE_
01628 #undef GTEST_4_TUPLE_
01629 #undef GTEST_5_TUPLE_
01630 #undef GTEST_6_TUPLE_
01631 #undef GTEST_7_TUPLE_
01632 #undef GTEST_8_TUPLE_
01633 #undef GTEST_9_TUPLE_
01634 #undef GTEST_10_TUPLE_
01635 
01636 #undef GTEST_0_TYPENAMES_
01637 #undef GTEST_1_TYPENAMES_
01638 #undef GTEST_2_TYPENAMES_
01639 #undef GTEST_3_TYPENAMES_
01640 #undef GTEST_4_TYPENAMES_
01641 #undef GTEST_5_TYPENAMES_
01642 #undef GTEST_6_TYPENAMES_
01643 #undef GTEST_7_TYPENAMES_
01644 #undef GTEST_8_TYPENAMES_
01645 #undef GTEST_9_TYPENAMES_
01646 #undef GTEST_10_TYPENAMES_
01647 
01648 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
01649 #undef GTEST_BY_REF_
01650 #undef GTEST_ADD_REF_
01651 #undef GTEST_TUPLE_ELEMENT_
01652 
01653 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
01654 # elif GTEST_ENV_HAS_STD_TUPLE_
01655 #  include <tuple>
01656 // C++11 puts its tuple into the ::std namespace rather than
01657 // ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
01658 // This causes undefined behavior, but supported compilers react in
01659 // the way we intend.
01660 namespace std {
01661 namespace tr1 {
01662 using ::std::get;
01663 using ::std::make_tuple;
01664 using ::std::tuple;
01665 using ::std::tuple_element;
01666 using ::std::tuple_size;
01667 }
01668 }
01669 
01670 # elif GTEST_OS_SYMBIAN
01671 
01672 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
01673 // use STLport's tuple implementation, which unfortunately doesn't
01674 // work as the copy of STLport distributed with Symbian is incomplete.
01675 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
01676 // use its own tuple implementation.
01677 #  ifdef BOOST_HAS_TR1_TUPLE
01678 #   undef BOOST_HAS_TR1_TUPLE
01679 #  endif  // BOOST_HAS_TR1_TUPLE
01680 
01681 // This prevents <boost/tr1/detail/config.hpp>, which defines
01682 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
01683 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
01684 #  include <tuple>
01685 
01686 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
01687 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
01688 // not conform to the TR1 spec, which requires the header to be <tuple>.
01689 
01690 #  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
01691 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
01692 // which is #included by <tr1/tuple>, to not compile when RTTI is
01693 // disabled.  _TR1_FUNCTIONAL is the header guard for
01694 // <tr1/functional>.  Hence the following #define is a hack to prevent
01695 // <tr1/functional> from being included.
01696 #   define _TR1_FUNCTIONAL 1
01697 #   include <tr1/tuple>
01698 #   undef _TR1_FUNCTIONAL  // Allows the user to #include
01699                         // <tr1/functional> if he chooses to.
01700 #  else
01701 #   include <tr1/tuple>  // NOLINT
01702 #  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
01703 
01704 # else
01705 // If the compiler is not GCC 4.0+, we assume the user is using a
01706 // spec-conforming TR1 implementation.
01707 #  include <tuple>  // NOLINT
01708 # endif  // GTEST_USE_OWN_TR1_TUPLE
01709 
01710 #endif  // GTEST_HAS_TR1_TUPLE
01711 
01712 // Determines whether clone(2) is supported.
01713 // Usually it will only be available on Linux, excluding
01714 // Linux on the Itanium architecture.
01715 // Also see http://linux.die.net/man/2/clone.
01716 #ifndef GTEST_HAS_CLONE
01717 // The user didn't tell us, so we need to figure it out.
01718 
01719 # if GTEST_OS_LINUX && !defined(__ia64__)
01720 #  if GTEST_OS_LINUX_ANDROID
01721 // On Android, clone() is only available on ARM starting with Gingerbread.
01722 #    if defined(__arm__) && __ANDROID_API__ >= 9
01723 #     define GTEST_HAS_CLONE 1
01724 #    else
01725 #     define GTEST_HAS_CLONE 0
01726 #    endif
01727 #  else
01728 #   define GTEST_HAS_CLONE 1
01729 #  endif
01730 # else
01731 #  define GTEST_HAS_CLONE 0
01732 # endif  // GTEST_OS_LINUX && !defined(__ia64__)
01733 
01734 #endif  // GTEST_HAS_CLONE
01735 
01736 // Determines whether to support stream redirection. This is used to test
01737 // output correctness and to implement death tests.
01738 #ifndef GTEST_HAS_STREAM_REDIRECTION
01739 // By default, we assume that stream redirection is supported on all
01740 // platforms except known mobile ones.
01741 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
01742 #  define GTEST_HAS_STREAM_REDIRECTION 0
01743 # else
01744 #  define GTEST_HAS_STREAM_REDIRECTION 1
01745 # endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
01746 #endif  // GTEST_HAS_STREAM_REDIRECTION
01747 
01748 // Determines whether to support death tests.
01749 // Google Test does not support death tests for VC 7.1 and earlier as
01750 // abort() in a VC 7.1 application compiled as GUI in debug config
01751 // pops up a dialog window that cannot be suppressed programmatically.
01752 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
01753      (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
01754      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
01755      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
01756      GTEST_OS_OPENBSD || GTEST_OS_QNX)
01757 # define GTEST_HAS_DEATH_TEST 1
01758 # include <vector>  // NOLINT
01759 #endif
01760 
01761 // We don't support MSVC 7.1 with exceptions disabled now.  Therefore
01762 // all the compilers we care about are adequate for supporting
01763 // value-parameterized tests.
01764 #define GTEST_HAS_PARAM_TEST 1
01765 
01766 // Determines whether to support type-driven tests.
01767 
01768 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
01769 // Sun Pro CC, IBM Visual Age, and HP aCC support.
01770 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
01771     defined(__IBMCPP__) || defined(__HP_aCC)
01772 # define GTEST_HAS_TYPED_TEST 1
01773 # define GTEST_HAS_TYPED_TEST_P 1
01774 #endif
01775 
01776 // Determines whether to support Combine(). This only makes sense when
01777 // value-parameterized tests are enabled.  The implementation doesn't
01778 // work on Sun Studio since it doesn't understand templated conversion
01779 // operators.
01780 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
01781 # define GTEST_HAS_COMBINE 1
01782 #endif
01783 
01784 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
01785 #define GTEST_WIDE_STRING_USES_UTF16_ \
01786     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
01787 
01788 // Determines whether test results can be streamed to a socket.
01789 #if GTEST_OS_LINUX
01790 # define GTEST_CAN_STREAM_RESULTS_ 1
01791 #endif
01792 
01793 // Defines some utility macros.
01794 
01795 // The GNU compiler emits a warning if nested "if" statements are followed by
01796 // an "else" statement and braces are not used to explicitly disambiguate the
01797 // "else" binding.  This leads to problems with code like:
01798 //
01799 //   if (gate)
01800 //     ASSERT_*(condition) << "Some message";
01801 //
01802 // The "switch (0) case 0:" idiom is used to suppress this.
01803 #ifdef __INTEL_COMPILER
01804 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
01805 #else
01806 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
01807 #endif
01808 
01809 // Use this annotation at the end of a struct/class definition to
01810 // prevent the compiler from optimizing away instances that are never
01811 // used.  This is useful when all interesting logic happens inside the
01812 // c'tor and / or d'tor.  Example:
01813 //
01814 //   struct Foo {
01815 //     Foo() { ... }
01816 //   } GTEST_ATTRIBUTE_UNUSED_;
01817 //
01818 // Also use it after a variable or parameter declaration to tell the
01819 // compiler the variable/parameter does not have to be used.
01820 #if defined(__GNUC__) && !defined(COMPILER_ICC)
01821 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
01822 #else
01823 # define GTEST_ATTRIBUTE_UNUSED_
01824 #endif
01825 
01826 // A macro to disallow operator=
01827 // This should be used in the private: declarations for a class.
01828 #define GTEST_DISALLOW_ASSIGN_(type)\
01829   void operator=(type const &)
01830 
01831 // A macro to disallow copy constructor and operator=
01832 // This should be used in the private: declarations for a class.
01833 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
01834   type(type const &);\
01835   GTEST_DISALLOW_ASSIGN_(type)
01836 
01837 // Tell the compiler to warn about unused return values for functions declared
01838 // with this macro.  The macro should be used on function declarations
01839 // following the argument list:
01840 //
01841 //   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
01842 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
01843 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
01844 #else
01845 # define GTEST_MUST_USE_RESULT_
01846 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
01847 
01848 // Determine whether the compiler supports Microsoft's Structured Exception
01849 // Handling.  This is supported by several Windows compilers but generally
01850 // does not exist on any other system.
01851 #ifndef GTEST_HAS_SEH
01852 // The user didn't tell us, so we need to figure it out.
01853 
01854 # if defined(_MSC_VER) || defined(__BORLANDC__)
01855 // These two compilers are known to support SEH.
01856 #  define GTEST_HAS_SEH 1
01857 # else
01858 // Assume no SEH.
01859 #  define GTEST_HAS_SEH 0
01860 # endif
01861 
01862 #endif  // GTEST_HAS_SEH
01863 
01864 #ifdef _MSC_VER
01865 
01866 # if GTEST_LINKED_AS_SHARED_LIBRARY
01867 #  define GTEST_API_ __declspec(dllimport)
01868 # elif GTEST_CREATE_SHARED_LIBRARY
01869 #  define GTEST_API_ __declspec(dllexport)
01870 # endif
01871 
01872 #endif  // _MSC_VER
01873 
01874 #ifndef GTEST_API_
01875 # define GTEST_API_
01876 #endif
01877 
01878 #ifdef __GNUC__
01879 // Ask the compiler to never inline a given function.
01880 # define GTEST_NO_INLINE_ __attribute__((noinline))
01881 #else
01882 # define GTEST_NO_INLINE_
01883 #endif
01884 
01885 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
01886 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
01887 # define GTEST_HAS_CXXABI_H_ 1
01888 #else
01889 # define GTEST_HAS_CXXABI_H_ 0
01890 #endif
01891 
01892 namespace testing {
01893 
01894 class Message;
01895 
01896 namespace internal {
01897 
01898 // A secret type that Google Test users don't know about.  It has no
01899 // definition on purpose.  Therefore it's impossible to create a
01900 // Secret object, which is what we want.
01901 class Secret;
01902 
01903 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
01904 // expression is true. For example, you could use it to verify the
01905 // size of a static array:
01906 //
01907 //   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
01908 //                         content_type_names_incorrect_size);
01909 //
01910 // or to make sure a struct is smaller than a certain size:
01911 //
01912 //   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
01913 //
01914 // The second argument to the macro is the name of the variable. If
01915 // the expression is false, most compilers will issue a warning/error
01916 // containing the name of the variable.
01917 
01918 template <bool>
01919 struct CompileAssert {
01920 };
01921 
01922 #define GTEST_COMPILE_ASSERT_(expr, msg) \
01923   typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
01924       msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
01925 
01926 // Implementation details of GTEST_COMPILE_ASSERT_:
01927 //
01928 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
01929 //   elements (and thus is invalid) when the expression is false.
01930 //
01931 // - The simpler definition
01932 //
01933 //    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
01934 //
01935 //   does not work, as gcc supports variable-length arrays whose sizes
01936 //   are determined at run-time (this is gcc's extension and not part
01937 //   of the C++ standard).  As a result, gcc fails to reject the
01938 //   following code with the simple definition:
01939 //
01940 //     int foo;
01941 //     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
01942 //                                      // not a compile-time constant.
01943 //
01944 // - By using the type CompileAssert<(bool(expr))>, we ensures that
01945 //   expr is a compile-time constant.  (Template arguments must be
01946 //   determined at compile-time.)
01947 //
01948 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
01949 //   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
01950 //
01951 //     CompileAssert<bool(expr)>
01952 //
01953 //   instead, these compilers will refuse to compile
01954 //
01955 //     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
01956 //
01957 //   (They seem to think the ">" in "5 > 0" marks the end of the
01958 //   template argument list.)
01959 //
01960 // - The array size is (bool(expr) ? 1 : -1), instead of simply
01961 //
01962 //     ((expr) ? 1 : -1).
01963 //
01964 //   This is to avoid running into a bug in MS VC 7.1, which
01965 //   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
01966 
01967 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
01968 //
01969 // This template is declared, but intentionally undefined.
01970 template <typename T1, typename T2>
01971 struct StaticAssertTypeEqHelper;
01972 
01973 template <typename T>
01974 struct StaticAssertTypeEqHelper<T, T> {};
01975 
01976 #if GTEST_HAS_GLOBAL_STRING
01977 typedef ::string string;
01978 #else
01979 typedef ::std::string string;
01980 #endif  // GTEST_HAS_GLOBAL_STRING
01981 
01982 #if GTEST_HAS_GLOBAL_WSTRING
01983 typedef ::wstring wstring;
01984 #elif GTEST_HAS_STD_WSTRING
01985 typedef ::std::wstring wstring;
01986 #endif  // GTEST_HAS_GLOBAL_WSTRING
01987 
01988 // A helper for suppressing warnings on constant condition.  It just
01989 // returns 'condition'.
01990 GTEST_API_ bool IsTrue(bool condition);
01991 
01992 // Defines scoped_ptr.
01993 
01994 // This implementation of scoped_ptr is PARTIAL - it only contains
01995 // enough stuff to satisfy Google Test's need.
01996 template <typename T>
01997 class scoped_ptr {
01998  public:
01999   typedef T element_type;
02000 
02001   explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
02002   ~scoped_ptr() { reset(); }
02003 
02004   T& operator*() const { return *ptr_; }
02005   T* operator->() const { return ptr_; }
02006   T* get() const { return ptr_; }
02007 
02008   T* release() {
02009     T* const ptr = ptr_;
02010     ptr_ = NULL;
02011     return ptr;
02012   }
02013 
02014   void reset(T* p = NULL) {
02015     if (p != ptr_) {
02016       if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
02017         delete ptr_;
02018       }
02019       ptr_ = p;
02020     }
02021   }
02022 
02023  private:
02024   T* ptr_;
02025 
02026   GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
02027 };
02028 
02029 // Defines RE.
02030 
02031 // A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
02032 // Regular Expression syntax.
02033 class GTEST_API_ RE {
02034  public:
02035   // A copy constructor is required by the Standard to initialize object
02036   // references from r-values.
02037   RE(const RE& other) { Init(other.pattern()); }
02038 
02039   // Constructs an RE from a string.
02040   RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
02041 
02042 #if GTEST_HAS_GLOBAL_STRING
02043 
02044   RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
02045 
02046 #endif  // GTEST_HAS_GLOBAL_STRING
02047 
02048   RE(const char* regex) { Init(regex); }  // NOLINT
02049   ~RE();
02050 
02051   // Returns the string representation of the regex.
02052   const char* pattern() const { return pattern_; }
02053 
02054   // FullMatch(str, re) returns true iff regular expression re matches
02055   // the entire str.
02056   // PartialMatch(str, re) returns true iff regular expression re
02057   // matches a substring of str (including str itself).
02058   //
02059   // TODO(wan@google.com): make FullMatch() and PartialMatch() work
02060   // when str contains NUL characters.
02061   static bool FullMatch(const ::std::string& str, const RE& re) {
02062     return FullMatch(str.c_str(), re);
02063   }
02064   static bool PartialMatch(const ::std::string& str, const RE& re) {
02065     return PartialMatch(str.c_str(), re);
02066   }
02067 
02068 #if GTEST_HAS_GLOBAL_STRING
02069 
02070   static bool FullMatch(const ::string& str, const RE& re) {
02071     return FullMatch(str.c_str(), re);
02072   }
02073   static bool PartialMatch(const ::string& str, const RE& re) {
02074     return PartialMatch(str.c_str(), re);
02075   }
02076 
02077 #endif  // GTEST_HAS_GLOBAL_STRING
02078 
02079   static bool FullMatch(const char* str, const RE& re);
02080   static bool PartialMatch(const char* str, const RE& re);
02081 
02082  private:
02083   void Init(const char* regex);
02084 
02085   // We use a const char* instead of an std::string, as Google Test used to be
02086   // used where std::string is not available.  TODO(wan@google.com): change to
02087   // std::string.
02088   const char* pattern_;
02089   bool is_valid_;
02090 
02091 #if GTEST_USES_POSIX_RE
02092 
02093   regex_t full_regex_;     // For FullMatch().
02094   regex_t partial_regex_;  // For PartialMatch().
02095 
02096 #else  // GTEST_USES_SIMPLE_RE
02097 
02098   const char* full_pattern_;  // For FullMatch();
02099 
02100 #endif
02101 
02102   GTEST_DISALLOW_ASSIGN_(RE);
02103 };
02104 
02105 // Formats a source file path and a line number as they would appear
02106 // in an error message from the compiler used to compile this code.
02107 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
02108 
02109 // Formats a file location for compiler-independent XML output.
02110 // Although this function is not platform dependent, we put it next to
02111 // FormatFileLocation in order to contrast the two functions.
02112 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
02113                                                                int line);
02114 
02115 // Defines logging utilities:
02116 //   GTEST_LOG_(severity) - logs messages at the specified severity level. The
02117 //                          message itself is streamed into the macro.
02118 //   LogToStderr()  - directs all log messages to stderr.
02119 //   FlushInfoLog() - flushes informational log messages.
02120 
02121 enum GTestLogSeverity {
02122   GTEST_INFO,
02123   GTEST_WARNING,
02124   GTEST_ERROR,
02125   GTEST_FATAL
02126 };
02127 
02128 // Formats log entry severity, provides a stream object for streaming the
02129 // log message, and terminates the message with a newline when going out of
02130 // scope.
02131 class GTEST_API_ GTestLog {
02132  public:
02133   GTestLog(GTestLogSeverity severity, const char* file, int line);
02134 
02135   // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
02136   ~GTestLog();
02137 
02138   ::std::ostream& GetStream() { return ::std::cerr; }
02139 
02140  private:
02141   const GTestLogSeverity severity_;
02142 
02143   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
02144 };
02145 
02146 #define GTEST_LOG_(severity) \
02147     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
02148                                   __FILE__, __LINE__).GetStream()
02149 
02150 inline void LogToStderr() {}
02151 inline void FlushInfoLog() { fflush(NULL); }
02152 
02153 // INTERNAL IMPLEMENTATION - DO NOT USE.
02154 //
02155 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
02156 // is not satisfied.
02157 //  Synopsys:
02158 //    GTEST_CHECK_(boolean_condition);
02159 //     or
02160 //    GTEST_CHECK_(boolean_condition) << "Additional message";
02161 //
02162 //    This checks the condition and if the condition is not satisfied
02163 //    it prints message about the condition violation, including the
02164 //    condition itself, plus additional message streamed into it, if any,
02165 //    and then it aborts the program. It aborts the program irrespective of
02166 //    whether it is built in the debug mode or not.
02167 #define GTEST_CHECK_(condition) \
02168     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
02169     if (::testing::internal::IsTrue(condition)) \
02170       ; \
02171     else \
02172       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
02173 
02174 // An all-mode assert to verify that the given POSIX-style function
02175 // call returns 0 (indicating success).  Known limitation: this
02176 // doesn't expand to a balanced 'if' statement, so enclose the macro
02177 // in {} if you need to use it as the only statement in an 'if'
02178 // branch.
02179 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
02180   if (const int gtest_error = (posix_call)) \
02181     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
02182                       << gtest_error
02183 
02184 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
02185 //
02186 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
02187 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
02188 // const Foo*).  When you use ImplicitCast_, the compiler checks that
02189 // the cast is safe.  Such explicit ImplicitCast_s are necessary in
02190 // surprisingly many situations where C++ demands an exact type match
02191 // instead of an argument type convertable to a target type.
02192 //
02193 // The syntax for using ImplicitCast_ is the same as for static_cast:
02194 //
02195 //   ImplicitCast_<ToType>(expr)
02196 //
02197 // ImplicitCast_ would have been part of the C++ standard library,
02198 // but the proposal was submitted too late.  It will probably make
02199 // its way into the language in the future.
02200 //
02201 // This relatively ugly name is intentional. It prevents clashes with
02202 // similar functions users may have (e.g., implicit_cast). The internal
02203 // namespace alone is not enough because the function can be found by ADL.
02204 template<typename To>
02205 inline To ImplicitCast_(To x) { return x; }
02206 
02207 // When you upcast (that is, cast a pointer from type Foo to type
02208 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
02209 // always succeed.  When you downcast (that is, cast a pointer from
02210 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
02211 // how do you know the pointer is really of type SubclassOfFoo?  It
02212 // could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
02213 // when you downcast, you should use this macro.  In debug mode, we
02214 // use dynamic_cast<> to double-check the downcast is legal (we die
02215 // if it's not).  In normal mode, we do the efficient static_cast<>
02216 // instead.  Thus, it's important to test in debug mode to make sure
02217 // the cast is legal!
02218 //    This is the only place in the code we should use dynamic_cast<>.
02219 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
02220 // do RTTI (eg code like this:
02221 //    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
02222 //    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
02223 // You should design the code some other way not to need this.
02224 //
02225 // This relatively ugly name is intentional. It prevents clashes with
02226 // similar functions users may have (e.g., down_cast). The internal
02227 // namespace alone is not enough because the function can be found by ADL.
02228 template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
02229 inline To DownCast_(From* f) {  // so we only accept pointers
02230   // Ensures that To is a sub-type of From *.  This test is here only
02231   // for compile-time type checking, and has no overhead in an
02232   // optimized build at run-time, as it will be optimized away
02233   // completely.
02234   if (false) {
02235     const To to = NULL;
02236     ::testing::internal::ImplicitCast_<From*>(to);
02237   }
02238 
02239 #if GTEST_HAS_RTTI
02240   // RTTI: debug mode only!
02241   GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
02242 #endif
02243   return static_cast<To>(f);
02244 }
02245 
02246 // Downcasts the pointer of type Base to Derived.
02247 // Derived must be a subclass of Base. The parameter MUST
02248 // point to a class of type Derived, not any subclass of it.
02249 // When RTTI is available, the function performs a runtime
02250 // check to enforce this.
02251 template <class Derived, class Base>
02252 Derived* CheckedDowncastToActualType(Base* base) {
02253 #if GTEST_HAS_RTTI
02254   GTEST_CHECK_(typeid(*base) == typeid(Derived));
02255   return dynamic_cast<Derived*>(base);  // NOLINT
02256 #else
02257   return static_cast<Derived*>(base);  // Poor man's downcast.
02258 #endif
02259 }
02260 
02261 #if GTEST_HAS_STREAM_REDIRECTION
02262 
02263 // Defines the stderr capturer:
02264 //   CaptureStdout     - starts capturing stdout.
02265 //   GetCapturedStdout - stops capturing stdout and returns the captured string.
02266 //   CaptureStderr     - starts capturing stderr.
02267 //   GetCapturedStderr - stops capturing stderr and returns the captured string.
02268 //
02269 GTEST_API_ void CaptureStdout();
02270 GTEST_API_ std::string GetCapturedStdout();
02271 GTEST_API_ void CaptureStderr();
02272 GTEST_API_ std::string GetCapturedStderr();
02273 
02274 #endif  // GTEST_HAS_STREAM_REDIRECTION
02275 
02276 
02277 #if GTEST_HAS_DEATH_TEST
02278 
02279 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
02280 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
02281                              new_argvs);
02282 
02283 // A copy of all command line arguments.  Set by InitGoogleTest().
02284 extern ::std::vector<testing::internal::string> g_argvs;
02285 
02286 #endif  // GTEST_HAS_DEATH_TEST
02287 
02288 // Defines synchronization primitives.
02289 
02290 #if GTEST_HAS_PTHREAD
02291 
02292 // Sleeps for (roughly) n milli-seconds.  This function is only for
02293 // testing Google Test's own constructs.  Don't use it in user tests,
02294 // either directly or indirectly.
02295 inline void SleepMilliseconds(int n) {
02296   const timespec time = {
02297     0,                  // 0 seconds.
02298     n * 1000L * 1000L,  // And n ms.
02299   };
02300   nanosleep(&time, NULL);
02301 }
02302 
02303 // Allows a controller thread to pause execution of newly created
02304 // threads until notified.  Instances of this class must be created
02305 // and destroyed in the controller thread.
02306 //
02307 // This class is only for testing Google Test's own constructs. Do not
02308 // use it in user tests, either directly or indirectly.
02309 class Notification {
02310  public:
02311   Notification() : notified_(false) {
02312     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
02313   }
02314   ~Notification() {
02315     pthread_mutex_destroy(&mutex_);
02316   }
02317 
02318   // Notifies all threads created with this notification to start. Must
02319   // be called from the controller thread.
02320   void Notify() {
02321     pthread_mutex_lock(&mutex_);
02322     notified_ = true;
02323     pthread_mutex_unlock(&mutex_);
02324   }
02325 
02326   // Blocks until the controller thread notifies. Must be called from a test
02327   // thread.
02328   void WaitForNotification() {
02329     for (;;) {
02330       pthread_mutex_lock(&mutex_);
02331       const bool notified = notified_;
02332       pthread_mutex_unlock(&mutex_);
02333       if (notified)
02334         break;
02335       SleepMilliseconds(10);
02336     }
02337   }
02338 
02339  private:
02340   pthread_mutex_t mutex_;
02341   bool notified_;
02342 
02343   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
02344 };
02345 
02346 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
02347 // Consequently, it cannot select a correct instantiation of ThreadWithParam
02348 // in order to call its Run(). Introducing ThreadWithParamBase as a
02349 // non-templated base class for ThreadWithParam allows us to bypass this
02350 // problem.
02351 class ThreadWithParamBase {
02352  public:
02353   virtual ~ThreadWithParamBase() {}
02354   virtual void Run() = 0;
02355 };
02356 
02357 // pthread_create() accepts a pointer to a function type with the C linkage.
02358 // According to the Standard (7.5/1), function types with different linkages
02359 // are different even if they are otherwise identical.  Some compilers (for
02360 // example, SunStudio) treat them as different types.  Since class methods
02361 // cannot be defined with C-linkage we need to define a free C-function to
02362 // pass into pthread_create().
02363 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
02364   static_cast<ThreadWithParamBase*>(thread)->Run();
02365   return NULL;
02366 }
02367 
02368 // Helper class for testing Google Test's multi-threading constructs.
02369 // To use it, write:
02370 //
02371 //   void ThreadFunc(int param) { /* Do things with param */ }
02372 //   Notification thread_can_start;
02373 //   ...
02374 //   // The thread_can_start parameter is optional; you can supply NULL.
02375 //   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
02376 //   thread_can_start.Notify();
02377 //
02378 // These classes are only for testing Google Test's own constructs. Do
02379 // not use them in user tests, either directly or indirectly.
02380 template <typename T>
02381 class ThreadWithParam : public ThreadWithParamBase {
02382  public:
02383   typedef void (*UserThreadFunc)(T);
02384 
02385   ThreadWithParam(
02386       UserThreadFunc func, T param, Notification* thread_can_start)
02387       : func_(func),
02388         param_(param),
02389         thread_can_start_(thread_can_start),
02390         finished_(false) {
02391     ThreadWithParamBase* const base = this;
02392     // The thread can be created only after all fields except thread_
02393     // have been initialized.
02394     GTEST_CHECK_POSIX_SUCCESS_(
02395         pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
02396   }
02397   ~ThreadWithParam() { Join(); }
02398 
02399   void Join() {
02400     if (!finished_) {
02401       GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
02402       finished_ = true;
02403     }
02404   }
02405 
02406   virtual void Run() {
02407     if (thread_can_start_ != NULL)
02408       thread_can_start_->WaitForNotification();
02409     func_(param_);
02410   }
02411 
02412  private:
02413   const UserThreadFunc func_;  // User-supplied thread function.
02414   const T param_;  // User-supplied parameter to the thread function.
02415   // When non-NULL, used to block execution until the controller thread
02416   // notifies.
02417   Notification* const thread_can_start_;
02418   bool finished_;  // true iff we know that the thread function has finished.
02419   pthread_t thread_;  // The native thread object.
02420 
02421   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
02422 };
02423 
02424 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
02425 // are used in conjunction with class MutexLock:
02426 //
02427 //   Mutex mutex;
02428 //   ...
02429 //   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
02430 //                            // of the current scope.
02431 //
02432 // MutexBase implements behavior for both statically and dynamically
02433 // allocated mutexes.  Do not use MutexBase directly.  Instead, write
02434 // the following to define a static mutex:
02435 //
02436 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
02437 //
02438 // You can forward declare a static mutex like this:
02439 //
02440 //   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
02441 //
02442 // To create a dynamic mutex, just define an object of type Mutex.
02443 class MutexBase {
02444  public:
02445   // Acquires this mutex.
02446   void Lock() {
02447     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
02448     owner_ = pthread_self();
02449     has_owner_ = true;
02450   }
02451 
02452   // Releases this mutex.
02453   void Unlock() {
02454     // Since the lock is being released the owner_ field should no longer be
02455     // considered valid. We don't protect writing to has_owner_ here, as it's
02456     // the caller's responsibility to ensure that the current thread holds the
02457     // mutex when this is called.
02458     has_owner_ = false;
02459     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
02460   }
02461 
02462   // Does nothing if the current thread holds the mutex. Otherwise, crashes
02463   // with high probability.
02464   void AssertHeld() const {
02465     GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
02466         << "The current thread is not holding the mutex @" << this;
02467   }
02468 
02469   // A static mutex may be used before main() is entered.  It may even
02470   // be used before the dynamic initialization stage.  Therefore we
02471   // must be able to initialize a static mutex object at link time.
02472   // This means MutexBase has to be a POD and its member variables
02473   // have to be public.
02474  public:
02475   pthread_mutex_t mutex_;  // The underlying pthread mutex.
02476   // has_owner_ indicates whether the owner_ field below contains a valid thread
02477   // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
02478   // accesses to the owner_ field should be protected by a check of this field.
02479   // An alternative might be to memset() owner_ to all zeros, but there's no
02480   // guarantee that a zero'd pthread_t is necessarily invalid or even different
02481   // from pthread_self().
02482   bool has_owner_;
02483   pthread_t owner_;  // The thread holding the mutex.
02484 };
02485 
02486 // Forward-declares a static mutex.
02487 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
02488     extern ::testing::internal::MutexBase mutex
02489 
02490 // Defines and statically (i.e. at link time) initializes a static mutex.
02491 // The initialization list here does not explicitly initialize each field,
02492 // instead relying on default initialization for the unspecified fields. In
02493 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
02494 // This allows initialization to work whether pthread_t is a scalar or struct.
02495 // The flag -Wmissing-field-initializers must not be specified for this to work.
02496 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
02497     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
02498 
02499 // The Mutex class can only be used for mutexes created at runtime. It
02500 // shares its API with MutexBase otherwise.
02501 class Mutex : public MutexBase {
02502  public:
02503   Mutex() {
02504     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
02505     has_owner_ = false;
02506   }
02507   ~Mutex() {
02508     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
02509   }
02510 
02511  private:
02512   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
02513 };
02514 
02515 // We cannot name this class MutexLock as the ctor declaration would
02516 // conflict with a macro named MutexLock, which is defined on some
02517 // platforms.  Hence the typedef trick below.
02518 class GTestMutexLock {
02519  public:
02520   explicit GTestMutexLock(MutexBase* mutex)
02521       : mutex_(mutex) { mutex_->Lock(); }
02522 
02523   ~GTestMutexLock() { mutex_->Unlock(); }
02524 
02525  private:
02526   MutexBase* const mutex_;
02527 
02528   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
02529 };
02530 
02531 typedef GTestMutexLock MutexLock;
02532 
02533 // Helpers for ThreadLocal.
02534 
02535 // pthread_key_create() requires DeleteThreadLocalValue() to have
02536 // C-linkage.  Therefore it cannot be templatized to access
02537 // ThreadLocal<T>.  Hence the need for class
02538 // ThreadLocalValueHolderBase.
02539 class ThreadLocalValueHolderBase {
02540  public:
02541   virtual ~ThreadLocalValueHolderBase() {}
02542 };
02543 
02544 // Called by pthread to delete thread-local data stored by
02545 // pthread_setspecific().
02546 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
02547   delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
02548 }
02549 
02550 // Implements thread-local storage on pthreads-based systems.
02551 //
02552 //   // Thread 1
02553 //   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
02554 //
02555 //   // Thread 2
02556 //   tl.set(150);  // Changes the value for thread 2 only.
02557 //   EXPECT_EQ(150, tl.get());
02558 //
02559 //   // Thread 1
02560 //   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
02561 //   tl.set(200);
02562 //   EXPECT_EQ(200, tl.get());
02563 //
02564 // The template type argument T must have a public copy constructor.
02565 // In addition, the default ThreadLocal constructor requires T to have
02566 // a public default constructor.
02567 //
02568 // An object managed for a thread by a ThreadLocal instance is deleted
02569 // when the thread exits.  Or, if the ThreadLocal instance dies in
02570 // that thread, when the ThreadLocal dies.  It's the user's
02571 // responsibility to ensure that all other threads using a ThreadLocal
02572 // have exited when it dies, or the per-thread objects for those
02573 // threads will not be deleted.
02574 //
02575 // Google Test only uses global ThreadLocal objects.  That means they
02576 // will die after main() has returned.  Therefore, no per-thread
02577 // object managed by Google Test will be leaked as long as all threads
02578 // using Google Test have exited when main() returns.
02579 template <typename T>
02580 class ThreadLocal {
02581  public:
02582   ThreadLocal() : key_(CreateKey()),
02583                   default_() {}
02584   explicit ThreadLocal(const T& value) : key_(CreateKey()),
02585                                          default_(value) {}
02586 
02587   ~ThreadLocal() {
02588     // Destroys the managed object for the current thread, if any.
02589     DeleteThreadLocalValue(pthread_getspecific(key_));
02590 
02591     // Releases resources associated with the key.  This will *not*
02592     // delete managed objects for other threads.
02593     GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
02594   }
02595 
02596   T* pointer() { return GetOrCreateValue(); }
02597   const T* pointer() const { return GetOrCreateValue(); }
02598   const T& get() const { return *pointer(); }
02599   void set(const T& value) { *pointer() = value; }
02600 
02601  private:
02602   // Holds a value of type T.
02603   class ValueHolder : public ThreadLocalValueHolderBase {
02604    public:
02605     explicit ValueHolder(const T& value) : value_(value) {}
02606 
02607     T* pointer() { return &value_; }
02608 
02609    private:
02610     T value_;
02611     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
02612   };
02613 
02614   static pthread_key_t CreateKey() {
02615     pthread_key_t key;
02616     // When a thread exits, DeleteThreadLocalValue() will be called on
02617     // the object managed for that thread.
02618     GTEST_CHECK_POSIX_SUCCESS_(
02619         pthread_key_create(&key, &DeleteThreadLocalValue));
02620     return key;
02621   }
02622 
02623   T* GetOrCreateValue() const {
02624     ThreadLocalValueHolderBase* const holder =
02625         static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
02626     if (holder != NULL) {
02627       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
02628     }
02629 
02630     ValueHolder* const new_holder = new ValueHolder(default_);
02631     ThreadLocalValueHolderBase* const holder_base = new_holder;
02632     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
02633     return new_holder->pointer();
02634   }
02635 
02636   // A key pthreads uses for looking up per-thread values.
02637   const pthread_key_t key_;
02638   const T default_;  // The default value for each thread.
02639 
02640   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
02641 };
02642 
02643 # define GTEST_IS_THREADSAFE 1
02644 
02645 #else  // GTEST_HAS_PTHREAD
02646 
02647 // A dummy implementation of synchronization primitives (mutex, lock,
02648 // and thread-local variable).  Necessary for compiling Google Test where
02649 // mutex is not supported - using Google Test in multiple threads is not
02650 // supported on such platforms.
02651 
02652 class Mutex {
02653  public:
02654   Mutex() {}
02655   void Lock() {}
02656   void Unlock() {}
02657   void AssertHeld() const {}
02658 };
02659 
02660 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
02661   extern ::testing::internal::Mutex mutex
02662 
02663 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
02664 
02665 class GTestMutexLock {
02666  public:
02667   explicit GTestMutexLock(Mutex*) {}  // NOLINT
02668 };
02669 
02670 typedef GTestMutexLock MutexLock;
02671 
02672 template <typename T>
02673 class ThreadLocal {
02674  public:
02675   ThreadLocal() : value_() {}
02676   explicit ThreadLocal(const T& value) : value_(value) {}
02677   T* pointer() { return &value_; }
02678   const T* pointer() const { return &value_; }
02679   const T& get() const { return value_; }
02680   void set(const T& value) { value_ = value; }
02681  private:
02682   T value_;
02683 };
02684 
02685 // The above synchronization primitives have dummy implementations.
02686 // Therefore Google Test is not thread-safe.
02687 # define GTEST_IS_THREADSAFE 0
02688 
02689 #endif  // GTEST_HAS_PTHREAD
02690 
02691 // Returns the number of threads running in the process, or 0 to indicate that
02692 // we cannot detect it.
02693 GTEST_API_ size_t GetThreadCount();
02694 
02695 // Passing non-POD classes through ellipsis (...) crashes the ARM
02696 // compiler and generates a warning in Sun Studio.  The Nokia Symbian
02697 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
02698 // for objects passed through ellipsis (...), failing for uncopyable
02699 // objects.  We define this to ensure that only POD is passed through
02700 // ellipsis on these systems.
02701 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
02702 // We lose support for NULL detection where the compiler doesn't like
02703 // passing non-POD classes through ellipsis (...).
02704 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
02705 #else
02706 # define GTEST_CAN_COMPARE_NULL 1
02707 #endif
02708 
02709 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
02710 // const T& and const T* in a function template.  These compilers
02711 // _can_ decide between class template specializations for T and T*,
02712 // so a tr1::type_traits-like is_pointer works.
02713 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
02714 # define GTEST_NEEDS_IS_POINTER_ 1
02715 #endif
02716 
02717 template <bool bool_value>
02718 struct bool_constant {
02719   typedef bool_constant<bool_value> type;
02720   static const bool value = bool_value;
02721 };
02722 template <bool bool_value> const bool bool_constant<bool_value>::value;
02723 
02724 typedef bool_constant<false> false_type;
02725 typedef bool_constant<true> true_type;
02726 
02727 template <typename T>
02728 struct is_pointer : public false_type {};
02729 
02730 template <typename T>
02731 struct is_pointer<T*> : public true_type {};
02732 
02733 template <typename Iterator>
02734 struct IteratorTraits {
02735   typedef typename Iterator::value_type value_type;
02736 };
02737 
02738 template <typename T>
02739 struct IteratorTraits<T*> {
02740   typedef T value_type;
02741 };
02742 
02743 template <typename T>
02744 struct IteratorTraits<const T*> {
02745   typedef T value_type;
02746 };
02747 
02748 #if GTEST_OS_WINDOWS
02749 # define GTEST_PATH_SEP_ "\\"
02750 # define GTEST_HAS_ALT_PATH_SEP_ 1
02751 // The biggest signed integer type the compiler supports.
02752 typedef __int64 BiggestInt;
02753 #else
02754 # define GTEST_PATH_SEP_ "/"
02755 # define GTEST_HAS_ALT_PATH_SEP_ 0
02756 typedef long long BiggestInt;  // NOLINT
02757 #endif  // GTEST_OS_WINDOWS
02758 
02759 // Utilities for char.
02760 
02761 // isspace(int ch) and friends accept an unsigned char or EOF.  char
02762 // may be signed, depending on the compiler (or compiler flags).
02763 // Therefore we need to cast a char to unsigned char before calling
02764 // isspace(), etc.
02765 
02766 inline bool IsAlpha(char ch) {
02767   return isalpha(static_cast<unsigned char>(ch)) != 0;
02768 }
02769 inline bool IsAlNum(char ch) {
02770   return isalnum(static_cast<unsigned char>(ch)) != 0;
02771 }
02772 inline bool IsDigit(char ch) {
02773   return isdigit(static_cast<unsigned char>(ch)) != 0;
02774 }
02775 inline bool IsLower(char ch) {
02776   return islower(static_cast<unsigned char>(ch)) != 0;
02777 }
02778 inline bool IsSpace(char ch) {
02779   return isspace(static_cast<unsigned char>(ch)) != 0;
02780 }
02781 inline bool IsUpper(char ch) {
02782   return isupper(static_cast<unsigned char>(ch)) != 0;
02783 }
02784 inline bool IsXDigit(char ch) {
02785   return isxdigit(static_cast<unsigned char>(ch)) != 0;
02786 }
02787 inline bool IsXDigit(wchar_t ch) {
02788   const unsigned char low_byte = static_cast<unsigned char>(ch);
02789   return ch == low_byte && isxdigit(low_byte) != 0;
02790 }
02791 
02792 inline char ToLower(char ch) {
02793   return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
02794 }
02795 inline char ToUpper(char ch) {
02796   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
02797 }
02798 
02799 // The testing::internal::posix namespace holds wrappers for common
02800 // POSIX functions.  These wrappers hide the differences between
02801 // Windows/MSVC and POSIX systems.  Since some compilers define these
02802 // standard functions as macros, the wrapper cannot have the same name
02803 // as the wrapped function.
02804 
02805 namespace posix {
02806 
02807 // Functions with a different name on Windows.
02808 
02809 #if GTEST_OS_WINDOWS
02810 
02811 typedef struct _stat StatStruct;
02812 
02813 # ifdef __BORLANDC__
02814 inline int IsATTY(int fd) { return isatty(fd); }
02815 inline int StrCaseCmp(const char* s1, const char* s2) {
02816   return stricmp(s1, s2);
02817 }
02818 inline char* StrDup(const char* src) { return strdup(src); }
02819 # else  // !__BORLANDC__
02820 #  if GTEST_OS_WINDOWS_MOBILE
02821 inline int IsATTY(int /* fd */) { return 0; }
02822 #  else
02823 inline int IsATTY(int fd) { return _isatty(fd); }
02824 #  endif  // GTEST_OS_WINDOWS_MOBILE
02825 inline int StrCaseCmp(const char* s1, const char* s2) {
02826   return _stricmp(s1, s2);
02827 }
02828 inline char* StrDup(const char* src) { return _strdup(src); }
02829 # endif  // __BORLANDC__
02830 
02831 # if GTEST_OS_WINDOWS_MOBILE
02832 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
02833 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
02834 // time and thus not defined there.
02835 # else
02836 inline int FileNo(FILE* file) { return _fileno(file); }
02837 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
02838 inline int RmDir(const char* dir) { return _rmdir(dir); }
02839 inline bool IsDir(const StatStruct& st) {
02840   return (_S_IFDIR & st.st_mode) != 0;
02841 }
02842 # endif  // GTEST_OS_WINDOWS_MOBILE
02843 
02844 #else
02845 
02846 typedef struct stat StatStruct;
02847 
02848 inline int FileNo(FILE* file) { return fileno(file); }
02849 inline int IsATTY(int fd) { return isatty(fd); }
02850 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
02851 inline int StrCaseCmp(const char* s1, const char* s2) {
02852   return strcasecmp(s1, s2);
02853 }
02854 inline char* StrDup(const char* src) { return strdup(src); }
02855 inline int RmDir(const char* dir) { return rmdir(dir); }
02856 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
02857 
02858 #endif  // GTEST_OS_WINDOWS
02859 
02860 // Functions deprecated by MSVC 8.0.
02861 
02862 #ifdef _MSC_VER
02863 // Temporarily disable warning 4996 (deprecated function).
02864 # pragma warning(push)
02865 # pragma warning(disable:4996)
02866 #endif
02867 
02868 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
02869   return strncpy(dest, src, n);
02870 }
02871 
02872 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
02873 // StrError() aren't needed on Windows CE at this time and thus not
02874 // defined there.
02875 
02876 #if !GTEST_OS_WINDOWS_MOBILE
02877 inline int ChDir(const char* dir) { return chdir(dir); }
02878 #endif
02879 inline FILE* FOpen(const char* path, const char* mode) {
02880   return fopen(path, mode);
02881 }
02882 #if !GTEST_OS_WINDOWS_MOBILE
02883 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
02884   return freopen(path, mode, stream);
02885 }
02886 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
02887 #endif
02888 inline int FClose(FILE* fp) { return fclose(fp); }
02889 #if !GTEST_OS_WINDOWS_MOBILE
02890 inline int Read(int fd, void* buf, unsigned int count) {
02891   return static_cast<int>(read(fd, buf, count));
02892 }
02893 inline int Write(int fd, const void* buf, unsigned int count) {
02894   return static_cast<int>(write(fd, buf, count));
02895 }
02896 inline int Close(int fd) { return close(fd); }
02897 inline const char* StrError(int errnum) { return strerror(errnum); }
02898 #endif
02899 inline const char* GetEnv(const char* name) {
02900 #if GTEST_OS_WINDOWS_MOBILE
02901   // We are on Windows CE, which has no environment variables.
02902   return NULL;
02903 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
02904   // Environment variables which we programmatically clear will be set to the
02905   // empty string rather than unset (NULL).  Handle that case.
02906   const char* const env = getenv(name);
02907   return (env != NULL && env[0] != '\0') ? env : NULL;
02908 #else
02909   return getenv(name);
02910 #endif
02911 }
02912 
02913 #ifdef _MSC_VER
02914 # pragma warning(pop)  // Restores the warning state.
02915 #endif
02916 
02917 #if GTEST_OS_WINDOWS_MOBILE
02918 // Windows CE has no C library. The abort() function is used in
02919 // several places in Google Test. This implementation provides a reasonable
02920 // imitation of standard behaviour.
02921 void Abort();
02922 #else
02923 inline void Abort() { abort(); }
02924 #endif  // GTEST_OS_WINDOWS_MOBILE
02925 
02926 }  // namespace posix
02927 
02928 // MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
02929 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
02930 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
02931 // function in order to achieve that.  We use macro definition here because
02932 // snprintf is a variadic function.
02933 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
02934 // MSVC 2005 and above support variadic macros.
02935 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
02936      _snprintf_s(buffer, size, size, format, __VA_ARGS__)
02937 #elif defined(_MSC_VER)
02938 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
02939 // complain about _snprintf.
02940 # define GTEST_SNPRINTF_ _snprintf
02941 #else
02942 # define GTEST_SNPRINTF_ snprintf
02943 #endif
02944 
02945 // The maximum number a BiggestInt can represent.  This definition
02946 // works no matter BiggestInt is represented in one's complement or
02947 // two's complement.
02948 //
02949 // We cannot rely on numeric_limits in STL, as __int64 and long long
02950 // are not part of standard C++ and numeric_limits doesn't need to be
02951 // defined for them.
02952 const BiggestInt kMaxBiggestInt =
02953     ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
02954 
02955 // This template class serves as a compile-time function from size to
02956 // type.  It maps a size in bytes to a primitive type with that
02957 // size. e.g.
02958 //
02959 //   TypeWithSize<4>::UInt
02960 //
02961 // is typedef-ed to be unsigned int (unsigned integer made up of 4
02962 // bytes).
02963 //
02964 // Such functionality should belong to STL, but I cannot find it
02965 // there.
02966 //
02967 // Google Test uses this class in the implementation of floating-point
02968 // comparison.
02969 //
02970 // For now it only handles UInt (unsigned int) as that's all Google Test
02971 // needs.  Other types can be easily added in the future if need
02972 // arises.
02973 template <size_t size>
02974 class TypeWithSize {
02975  public:
02976   // This prevents the user from using TypeWithSize<N> with incorrect
02977   // values of N.
02978   typedef void UInt;
02979 };
02980 
02981 // The specialization for size 4.
02982 template <>
02983 class TypeWithSize<4> {
02984  public:
02985   // unsigned int has size 4 in both gcc and MSVC.
02986   //
02987   // As base/basictypes.h doesn't compile on Windows, we cannot use
02988   // uint32, uint64, and etc here.
02989   typedef int Int;
02990   typedef unsigned int UInt;
02991 };
02992 
02993 // The specialization for size 8.
02994 template <>
02995 class TypeWithSize<8> {
02996  public:
02997 #if GTEST_OS_WINDOWS
02998   typedef __int64 Int;
02999   typedef unsigned __int64 UInt;
03000 #else
03001   typedef long long Int;  // NOLINT
03002   typedef unsigned long long UInt;  // NOLINT
03003 #endif  // GTEST_OS_WINDOWS
03004 };
03005 
03006 // Integer types of known sizes.
03007 typedef TypeWithSize<4>::Int Int32;
03008 typedef TypeWithSize<4>::UInt UInt32;
03009 typedef TypeWithSize<8>::Int Int64;
03010 typedef TypeWithSize<8>::UInt UInt64;
03011 typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
03012 
03013 // Utilities for command line flags and environment variables.
03014 
03015 // Macro for referencing flags.
03016 #define GTEST_FLAG(name) FLAGS_gtest_##name
03017 
03018 // Macros for declaring flags.
03019 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
03020 #define GTEST_DECLARE_int32_(name) \
03021     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
03022 #define GTEST_DECLARE_string_(name) \
03023     GTEST_API_ extern ::std::string GTEST_FLAG(name)
03024 
03025 // Macros for defining flags.
03026 #define GTEST_DEFINE_bool_(name, default_val, doc) \
03027     GTEST_API_ bool GTEST_FLAG(name) = (default_val)
03028 #define GTEST_DEFINE_int32_(name, default_val, doc) \
03029     GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
03030 #define GTEST_DEFINE_string_(name, default_val, doc) \
03031     GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
03032 
03033 // Thread annotations
03034 #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
03035 #define GTEST_LOCK_EXCLUDED_(locks)
03036 
03037 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
03038 // to *value and returns true; otherwise leaves *value unchanged and returns
03039 // false.
03040 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
03041 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
03042 // function.
03043 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
03044 
03045 // Parses a bool/Int32/string from the environment variable
03046 // corresponding to the given Google Test flag.
03047 bool BoolFromGTestEnv(const char* flag, bool default_val);
03048 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
03049 const char* StringFromGTestEnv(const char* flag, const char* default_val);
03050 
03051 }  // namespace internal
03052 }  // namespace testing
03053 
03054 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
03055 
03056 #if GTEST_OS_LINUX
03057 # include <stdlib.h>
03058 # include <sys/types.h>
03059 # include <sys/wait.h>
03060 # include <unistd.h>
03061 #endif  // GTEST_OS_LINUX
03062 
03063 #if GTEST_HAS_EXCEPTIONS
03064 # include <stdexcept>
03065 #endif
03066 
03067 #include <ctype.h>
03068 #include <float.h>
03069 #include <string.h>
03070 #include <iomanip>
03071 #include <limits>
03072 #include <set>
03073 
03074 // Copyright 2005, Google Inc.
03075 // All rights reserved.
03076 //
03077 // Redistribution and use in source and binary forms, with or without
03078 // modification, are permitted provided that the following conditions are
03079 // met:
03080 //
03081 //     * Redistributions of source code must retain the above copyright
03082 // notice, this list of conditions and the following disclaimer.
03083 //     * Redistributions in binary form must reproduce the above
03084 // copyright notice, this list of conditions and the following disclaimer
03085 // in the documentation and/or other materials provided with the
03086 // distribution.
03087 //     * Neither the name of Google Inc. nor the names of its
03088 // contributors may be used to endorse or promote products derived from
03089 // this software without specific prior written permission.
03090 //
03091 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03092 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03093 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03094 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03095 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03096 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03097 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03098 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03099 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03100 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03101 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03102 //
03103 // Author: wan@google.com (Zhanyong Wan)
03104 //
03105 // The Google C++ Testing Framework (Google Test)
03106 //
03107 // This header file defines the Message class.
03108 //
03109 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
03110 // leave some internal implementation details in this header file.
03111 // They are clearly marked by comments like this:
03112 //
03113 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
03114 //
03115 // Such code is NOT meant to be used by a user directly, and is subject
03116 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
03117 // program!
03118 
03119 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
03120 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
03121 
03122 #include <limits>
03123 
03124 
03125 // Ensures that there is at least one operator<< in the global namespace.
03126 // See Message& operator<<(...) below for why.
03127 void operator<<(const testing::internal::Secret&, int);
03128 
03129 namespace testing {
03130 
03131 // The Message class works like an ostream repeater.
03132 //
03133 // Typical usage:
03134 //
03135 //   1. You stream a bunch of values to a Message object.
03136 //      It will remember the text in a stringstream.
03137 //   2. Then you stream the Message object to an ostream.
03138 //      This causes the text in the Message to be streamed
03139 //      to the ostream.
03140 //
03141 // For example;
03142 //
03143 //   testing::Message foo;
03144 //   foo << 1 << " != " << 2;
03145 //   std::cout << foo;
03146 //
03147 // will print "1 != 2".
03148 //
03149 // Message is not intended to be inherited from.  In particular, its
03150 // destructor is not virtual.
03151 //
03152 // Note that stringstream behaves differently in gcc and in MSVC.  You
03153 // can stream a NULL char pointer to it in the former, but not in the
03154 // latter (it causes an access violation if you do).  The Message
03155 // class hides this difference by treating a NULL char pointer as
03156 // "(null)".
03157 class GTEST_API_ Message {
03158  private:
03159   // The type of basic IO manipulators (endl, ends, and flush) for
03160   // narrow streams.
03161   typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
03162 
03163  public:
03164   // Constructs an empty Message.
03165   Message();
03166 
03167   // Copy constructor.
03168   Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
03169     *ss_ << msg.GetString();
03170   }
03171 
03172   // Constructs a Message from a C-string.
03173   explicit Message(const char* str) : ss_(new ::std::stringstream) {
03174     *ss_ << str;
03175   }
03176 
03177 #if GTEST_OS_SYMBIAN
03178   // Streams a value (either a pointer or not) to this object.
03179   template <typename T>
03180   inline Message& operator <<(const T& value) {
03181     StreamHelper(typename internal::is_pointer<T>::type(), value);
03182     return *this;
03183   }
03184 #else
03185   // Streams a non-pointer value to this object.
03186   template <typename T>
03187   inline Message& operator <<(const T& val) {
03188     // Some libraries overload << for STL containers.  These
03189     // overloads are defined in the global namespace instead of ::std.
03190     //
03191     // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
03192     // overloads are visible in either the std namespace or the global
03193     // namespace, but not other namespaces, including the testing
03194     // namespace which Google Test's Message class is in.
03195     //
03196     // To allow STL containers (and other types that has a << operator
03197     // defined in the global namespace) to be used in Google Test
03198     // assertions, testing::Message must access the custom << operator
03199     // from the global namespace.  With this using declaration,
03200     // overloads of << defined in the global namespace and those
03201     // visible via Koenig lookup are both exposed in this function.
03202     using ::operator <<;
03203     *ss_ << val;
03204     return *this;
03205   }
03206 
03207   // Streams a pointer value to this object.
03208   //
03209   // This function is an overload of the previous one.  When you
03210   // stream a pointer to a Message, this definition will be used as it
03211   // is more specialized.  (The C++ Standard, section
03212   // [temp.func.order].)  If you stream a non-pointer, then the
03213   // previous definition will be used.
03214   //
03215   // The reason for this overload is that streaming a NULL pointer to
03216   // ostream is undefined behavior.  Depending on the compiler, you
03217   // may get "0", "(nil)", "(null)", or an access violation.  To
03218   // ensure consistent result across compilers, we always treat NULL
03219   // as "(null)".
03220   template <typename T>
03221   inline Message& operator <<(T* const& pointer) {  // NOLINT
03222     if (pointer == NULL) {
03223       *ss_ << "(null)";
03224     } else {
03225       *ss_ << pointer;
03226     }
03227     return *this;
03228   }
03229 #endif  // GTEST_OS_SYMBIAN
03230 
03231   // Since the basic IO manipulators are overloaded for both narrow
03232   // and wide streams, we have to provide this specialized definition
03233   // of operator <<, even though its body is the same as the
03234   // templatized version above.  Without this definition, streaming
03235   // endl or other basic IO manipulators to Message will confuse the
03236   // compiler.
03237   Message& operator <<(BasicNarrowIoManip val) {
03238     *ss_ << val;
03239     return *this;
03240   }
03241 
03242   // Instead of 1/0, we want to see true/false for bool values.
03243   Message& operator <<(bool b) {
03244     return *this << (b ? "true" : "false");
03245   }
03246 
03247   // These two overloads allow streaming a wide C string to a Message
03248   // using the UTF-8 encoding.
03249   Message& operator <<(const wchar_t* wide_c_str);
03250   Message& operator <<(wchar_t* wide_c_str);
03251 
03252 #if GTEST_HAS_STD_WSTRING
03253   // Converts the given wide string to a narrow string using the UTF-8
03254   // encoding, and streams the result to this Message object.
03255   Message& operator <<(const ::std::wstring& wstr);
03256 #endif  // GTEST_HAS_STD_WSTRING
03257 
03258 #if GTEST_HAS_GLOBAL_WSTRING
03259   // Converts the given wide string to a narrow string using the UTF-8
03260   // encoding, and streams the result to this Message object.
03261   Message& operator <<(const ::wstring& wstr);
03262 #endif  // GTEST_HAS_GLOBAL_WSTRING
03263 
03264   // Gets the text streamed to this object so far as an std::string.
03265   // Each '\0' character in the buffer is replaced with "\\0".
03266   //
03267   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
03268   std::string GetString() const;
03269 
03270  private:
03271 
03272 #if GTEST_OS_SYMBIAN
03273   // These are needed as the Nokia Symbian Compiler cannot decide between
03274   // const T& and const T* in a function template. The Nokia compiler _can_
03275   // decide between class template specializations for T and T*, so a
03276   // tr1::type_traits-like is_pointer works, and we can overload on that.
03277   template <typename T>
03278   inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
03279     if (pointer == NULL) {
03280       *ss_ << "(null)";
03281     } else {
03282       *ss_ << pointer;
03283     }
03284   }
03285   template <typename T>
03286   inline void StreamHelper(internal::false_type /*is_pointer*/,
03287                            const T& value) {
03288     // See the comments in Message& operator <<(const T&) above for why
03289     // we need this using statement.
03290     using ::operator <<;
03291     *ss_ << value;
03292   }
03293 #endif  // GTEST_OS_SYMBIAN
03294 
03295   // We'll hold the text streamed to this object here.
03296   const internal::scoped_ptr< ::std::stringstream> ss_;
03297 
03298   // We declare (but don't implement) this to prevent the compiler
03299   // from implementing the assignment operator.
03300   void operator=(const Message&);
03301 };
03302 
03303 // Streams a Message to an ostream.
03304 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
03305   return os << sb.GetString();
03306 }
03307 
03308 namespace internal {
03309 
03310 // Converts a streamable value to an std::string.  A NULL pointer is
03311 // converted to "(null)".  When the input value is a ::string,
03312 // ::std::string, ::wstring, or ::std::wstring object, each NUL
03313 // character in it is replaced with "\\0".
03314 template <typename T>
03315 std::string StreamableToString(const T& streamable) {
03316   return (Message() << streamable).GetString();
03317 }
03318 
03319 }  // namespace internal
03320 }  // namespace testing
03321 
03322 #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
03323 // Copyright 2005, Google Inc.
03324 // All rights reserved.
03325 //
03326 // Redistribution and use in source and binary forms, with or without
03327 // modification, are permitted provided that the following conditions are
03328 // met:
03329 //
03330 //     * Redistributions of source code must retain the above copyright
03331 // notice, this list of conditions and the following disclaimer.
03332 //     * Redistributions in binary form must reproduce the above
03333 // copyright notice, this list of conditions and the following disclaimer
03334 // in the documentation and/or other materials provided with the
03335 // distribution.
03336 //     * Neither the name of Google Inc. nor the names of its
03337 // contributors may be used to endorse or promote products derived from
03338 // this software without specific prior written permission.
03339 //
03340 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03341 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03342 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03343 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03344 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03345 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03346 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03347 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03348 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03349 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03350 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03351 //
03352 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
03353 //
03354 // The Google C++ Testing Framework (Google Test)
03355 //
03356 // This header file declares the String class and functions used internally by
03357 // Google Test.  They are subject to change without notice. They should not used
03358 // by code external to Google Test.
03359 //
03360 // This header file is #included by <gtest/internal/gtest-internal.h>.
03361 // It should not be #included by other files.
03362 
03363 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03364 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03365 
03366 #ifdef __BORLANDC__
03367 // string.h is not guaranteed to provide strcpy on C++ Builder.
03368 # include <mem.h>
03369 #endif
03370 
03371 #include <string.h>
03372 #include <string>
03373 
03374 
03375 namespace testing {
03376 namespace internal {
03377 
03378 // String - an abstract class holding static string utilities.
03379 class GTEST_API_ String {
03380  public:
03381   // Static utility methods
03382 
03383   // Clones a 0-terminated C string, allocating memory using new.  The
03384   // caller is responsible for deleting the return value using
03385   // delete[].  Returns the cloned string, or NULL if the input is
03386   // NULL.
03387   //
03388   // This is different from strdup() in string.h, which allocates
03389   // memory using malloc().
03390   static const char* CloneCString(const char* c_str);
03391 
03392 #if GTEST_OS_WINDOWS_MOBILE
03393   // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
03394   // able to pass strings to Win32 APIs on CE we need to convert them
03395   // to 'Unicode', UTF-16.
03396 
03397   // Creates a UTF-16 wide string from the given ANSI string, allocating
03398   // memory using new. The caller is responsible for deleting the return
03399   // value using delete[]. Returns the wide string, or NULL if the
03400   // input is NULL.
03401   //
03402   // The wide string is created using the ANSI codepage (CP_ACP) to
03403   // match the behaviour of the ANSI versions of Win32 calls and the
03404   // C runtime.
03405   static LPCWSTR AnsiToUtf16(const char* c_str);
03406 
03407   // Creates an ANSI string from the given wide string, allocating
03408   // memory using new. The caller is responsible for deleting the return
03409   // value using delete[]. Returns the ANSI string, or NULL if the
03410   // input is NULL.
03411   //
03412   // The returned string is created using the ANSI codepage (CP_ACP) to
03413   // match the behaviour of the ANSI versions of Win32 calls and the
03414   // C runtime.
03415   static const char* Utf16ToAnsi(LPCWSTR utf16_str);
03416 #endif
03417 
03418   // Compares two C strings.  Returns true iff they have the same content.
03419   //
03420   // Unlike strcmp(), this function can handle NULL argument(s).  A
03421   // NULL C string is considered different to any non-NULL C string,
03422   // including the empty string.
03423   static bool CStringEquals(const char* lhs, const char* rhs);
03424 
03425   // Converts a wide C string to a String using the UTF-8 encoding.
03426   // NULL will be converted to "(null)".  If an error occurred during
03427   // the conversion, "(failed to convert from wide string)" is
03428   // returned.
03429   static std::string ShowWideCString(const wchar_t* wide_c_str);
03430 
03431   // Compares two wide C strings.  Returns true iff they have the same
03432   // content.
03433   //
03434   // Unlike wcscmp(), this function can handle NULL argument(s).  A
03435   // NULL C string is considered different to any non-NULL C string,
03436   // including the empty string.
03437   static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
03438 
03439   // Compares two C strings, ignoring case.  Returns true iff they
03440   // have the same content.
03441   //
03442   // Unlike strcasecmp(), this function can handle NULL argument(s).
03443   // A NULL C string is considered different to any non-NULL C string,
03444   // including the empty string.
03445   static bool CaseInsensitiveCStringEquals(const char* lhs,
03446                                            const char* rhs);
03447 
03448   // Compares two wide C strings, ignoring case.  Returns true iff they
03449   // have the same content.
03450   //
03451   // Unlike wcscasecmp(), this function can handle NULL argument(s).
03452   // A NULL C string is considered different to any non-NULL wide C string,
03453   // including the empty string.
03454   // NB: The implementations on different platforms slightly differ.
03455   // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
03456   // environment variable. On GNU platform this method uses wcscasecmp
03457   // which compares according to LC_CTYPE category of the current locale.
03458   // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
03459   // current locale.
03460   static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
03461                                                const wchar_t* rhs);
03462 
03463   // Returns true iff the given string ends with the given suffix, ignoring
03464   // case. Any string is considered to end with an empty suffix.
03465   static bool EndsWithCaseInsensitive(
03466       const std::string& str, const std::string& suffix);
03467 
03468   // Formats an int value as "%02d".
03469   static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
03470 
03471   // Formats an int value as "%X".
03472   static std::string FormatHexInt(int value);
03473 
03474   // Formats a byte as "%02X".
03475   static std::string FormatByte(unsigned char value);
03476 
03477  private:
03478   String();  // Not meant to be instantiated.
03479 };  // class String
03480 
03481 // Gets the content of the stringstream's buffer as an std::string.  Each '\0'
03482 // character in the buffer is replaced with "\\0".
03483 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
03484 
03485 }  // namespace internal
03486 }  // namespace testing
03487 
03488 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03489 // Copyright 2008, Google Inc.
03490 // All rights reserved.
03491 //
03492 // Redistribution and use in source and binary forms, with or without
03493 // modification, are permitted provided that the following conditions are
03494 // met:
03495 //
03496 //     * Redistributions of source code must retain the above copyright
03497 // notice, this list of conditions and the following disclaimer.
03498 //     * Redistributions in binary form must reproduce the above
03499 // copyright notice, this list of conditions and the following disclaimer
03500 // in the documentation and/or other materials provided with the
03501 // distribution.
03502 //     * Neither the name of Google Inc. nor the names of its
03503 // contributors may be used to endorse or promote products derived from
03504 // this software without specific prior written permission.
03505 //
03506 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03507 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03508 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03509 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03510 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03511 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03512 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03513 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03514 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03515 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03516 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03517 //
03518 // Author: keith.ray@gmail.com (Keith Ray)
03519 //
03520 // Google Test filepath utilities
03521 //
03522 // This header file declares classes and functions used internally by
03523 // Google Test.  They are subject to change without notice.
03524 //
03525 // This file is #included in <gtest/internal/gtest-internal.h>.
03526 // Do not include this header file separately!
03527 
03528 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03529 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03530 
03531 
03532 namespace testing {
03533 namespace internal {
03534 
03535 // FilePath - a class for file and directory pathname manipulation which
03536 // handles platform-specific conventions (like the pathname separator).
03537 // Used for helper functions for naming files in a directory for xml output.
03538 // Except for Set methods, all methods are const or static, which provides an
03539 // "immutable value object" -- useful for peace of mind.
03540 // A FilePath with a value ending in a path separator ("like/this/") represents
03541 // a directory, otherwise it is assumed to represent a file. In either case,
03542 // it may or may not represent an actual file or directory in the file system.
03543 // Names are NOT checked for syntax correctness -- no checking for illegal
03544 // characters, malformed paths, etc.
03545 
03546 class GTEST_API_ FilePath {
03547  public:
03548   FilePath() : pathname_("") { }
03549   FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
03550 
03551   explicit FilePath(const std::string& pathname) : pathname_(pathname) {
03552     Normalize();
03553   }
03554 
03555   FilePath& operator=(const FilePath& rhs) {
03556     Set(rhs);
03557     return *this;
03558   }
03559 
03560   void Set(const FilePath& rhs) {
03561     pathname_ = rhs.pathname_;
03562   }
03563 
03564   const std::string& string() const { return pathname_; }
03565   const char* c_str() const { return pathname_.c_str(); }
03566 
03567   // Returns the current working directory, or "" if unsuccessful.
03568   static FilePath GetCurrentDir();
03569 
03570   // Given directory = "dir", base_name = "test", number = 0,
03571   // extension = "xml", returns "dir/test.xml". If number is greater
03572   // than zero (e.g., 12), returns "dir/test_12.xml".
03573   // On Windows platform, uses \ as the separator rather than /.
03574   static FilePath MakeFileName(const FilePath& directory,
03575                                const FilePath& base_name,
03576                                int number,
03577                                const char* extension);
03578 
03579   // Given directory = "dir", relative_path = "test.xml",
03580   // returns "dir/test.xml".
03581   // On Windows, uses \ as the separator rather than /.
03582   static FilePath ConcatPaths(const FilePath& directory,
03583                               const FilePath& relative_path);
03584 
03585   // Returns a pathname for a file that does not currently exist. The pathname
03586   // will be directory/base_name.extension or
03587   // directory/base_name_<number>.extension if directory/base_name.extension
03588   // already exists. The number will be incremented until a pathname is found
03589   // that does not already exist.
03590   // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
03591   // There could be a race condition if two or more processes are calling this
03592   // function at the same time -- they could both pick the same filename.
03593   static FilePath GenerateUniqueFileName(const FilePath& directory,
03594                                          const FilePath& base_name,
03595                                          const char* extension);
03596 
03597   // Returns true iff the path is "".
03598   bool IsEmpty() const { return pathname_.empty(); }
03599 
03600   // If input name has a trailing separator character, removes it and returns
03601   // the name, otherwise return the name string unmodified.
03602   // On Windows platform, uses \ as the separator, other platforms use /.
03603   FilePath RemoveTrailingPathSeparator() const;
03604 
03605   // Returns a copy of the FilePath with the directory part removed.
03606   // Example: FilePath("path/to/file").RemoveDirectoryName() returns
03607   // FilePath("file"). If there is no directory part ("just_a_file"), it returns
03608   // the FilePath unmodified. If there is no file part ("just_a_dir/") it
03609   // returns an empty FilePath ("").
03610   // On Windows platform, '\' is the path separator, otherwise it is '/'.
03611   FilePath RemoveDirectoryName() const;
03612 
03613   // RemoveFileName returns the directory path with the filename removed.
03614   // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
03615   // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
03616   // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
03617   // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
03618   // On Windows platform, '\' is the path separator, otherwise it is '/'.
03619   FilePath RemoveFileName() const;
03620 
03621   // Returns a copy of the FilePath with the case-insensitive extension removed.
03622   // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
03623   // FilePath("dir/file"). If a case-insensitive extension is not
03624   // found, returns a copy of the original FilePath.
03625   FilePath RemoveExtension(const char* extension) const;
03626 
03627   // Creates directories so that path exists. Returns true if successful or if
03628   // the directories already exist; returns false if unable to create
03629   // directories for any reason. Will also return false if the FilePath does
03630   // not represent a directory (that is, it doesn't end with a path separator).
03631   bool CreateDirectoriesRecursively() const;
03632 
03633   // Create the directory so that path exists. Returns true if successful or
03634   // if the directory already exists; returns false if unable to create the
03635   // directory for any reason, including if the parent directory does not
03636   // exist. Not named "CreateDirectory" because that's a macro on Windows.
03637   bool CreateFolder() const;
03638 
03639   // Returns true if FilePath describes something in the file-system,
03640   // either a file, directory, or whatever, and that something exists.
03641   bool FileOrDirectoryExists() const;
03642 
03643   // Returns true if pathname describes a directory in the file-system
03644   // that exists.
03645   bool DirectoryExists() const;
03646 
03647   // Returns true if FilePath ends with a path separator, which indicates that
03648   // it is intended to represent a directory. Returns false otherwise.
03649   // This does NOT check that a directory (or file) actually exists.
03650   bool IsDirectory() const;
03651 
03652   // Returns true if pathname describes a root directory. (Windows has one
03653   // root directory per disk drive.)
03654   bool IsRootDirectory() const;
03655 
03656   // Returns true if pathname describes an absolute path.
03657   bool IsAbsolutePath() const;
03658 
03659  private:
03660   // Replaces multiple consecutive separators with a single separator.
03661   // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
03662   // redundancies that might be in a pathname involving "." or "..".
03663   //
03664   // A pathname with multiple consecutive separators may occur either through
03665   // user error or as a result of some scripts or APIs that generate a pathname
03666   // with a trailing separator. On other platforms the same API or script
03667   // may NOT generate a pathname with a trailing "/". Then elsewhere that
03668   // pathname may have another "/" and pathname components added to it,
03669   // without checking for the separator already being there.
03670   // The script language and operating system may allow paths like "foo//bar"
03671   // but some of the functions in FilePath will not handle that correctly. In
03672   // particular, RemoveTrailingPathSeparator() only removes one separator, and
03673   // it is called in CreateDirectoriesRecursively() assuming that it will change
03674   // a pathname from directory syntax (trailing separator) to filename syntax.
03675   //
03676   // On Windows this method also replaces the alternate path separator '/' with
03677   // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
03678   // "bar\\foo".
03679 
03680   void Normalize();
03681 
03682   // Returns a pointer to the last occurence of a valid path separator in
03683   // the FilePath. On Windows, for example, both '/' and '\' are valid path
03684   // separators. Returns NULL if no path separator was found.
03685   const char* FindLastPathSeparator() const;
03686 
03687   std::string pathname_;
03688 };  // class FilePath
03689 
03690 }  // namespace internal
03691 }  // namespace testing
03692 
03693 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03694 // This file was GENERATED by command:
03695 //     pump.py gtest-type-util.h.pump
03696 // DO NOT EDIT BY HAND!!!
03697 
03698 // Copyright 2008 Google Inc.
03699 // All Rights Reserved.
03700 //
03701 // Redistribution and use in source and binary forms, with or without
03702 // modification, are permitted provided that the following conditions are
03703 // met:
03704 //
03705 //     * Redistributions of source code must retain the above copyright
03706 // notice, this list of conditions and the following disclaimer.
03707 //     * Redistributions in binary form must reproduce the above
03708 // copyright notice, this list of conditions and the following disclaimer
03709 // in the documentation and/or other materials provided with the
03710 // distribution.
03711 //     * Neither the name of Google Inc. nor the names of its
03712 // contributors may be used to endorse or promote products derived from
03713 // this software without specific prior written permission.
03714 //
03715 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03716 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03717 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03718 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03719 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03720 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03721 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03722 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03723 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03724 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03725 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03726 //
03727 // Author: wan@google.com (Zhanyong Wan)
03728 
03729 // Type utilities needed for implementing typed and type-parameterized
03730 // tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
03731 //
03732 // Currently we support at most 50 types in a list, and at most 50
03733 // type-parameterized tests in one type-parameterized test case.
03734 // Please contact googletestframework@googlegroups.com if you need
03735 // more.
03736 
03737 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
03738 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
03739 
03740 
03741 // #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
03742 // libstdc++ (which is where cxxabi.h comes from).
03743 # if GTEST_HAS_CXXABI_H_
03744 #  include <cxxabi.h>
03745 # elif defined(__HP_aCC)
03746 #  include <acxx_demangle.h>
03747 # endif  // GTEST_HASH_CXXABI_H_
03748 
03749 namespace testing {
03750 namespace internal {
03751 
03752 // GetTypeName<T>() returns a human-readable name of type T.
03753 // NB: This function is also used in Google Mock, so don't move it inside of
03754 // the typed-test-only section below.
03755 template <typename T>
03756 std::string GetTypeName() {
03757 # if GTEST_HAS_RTTI
03758 
03759   const char* const name = typeid(T).name();
03760 #  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
03761   int status = 0;
03762   // gcc's implementation of typeid(T).name() mangles the type name,
03763   // so we have to demangle it.
03764 #   if GTEST_HAS_CXXABI_H_
03765   using abi::__cxa_demangle;
03766 #   endif  // GTEST_HAS_CXXABI_H_
03767   char* const readable_name = __cxa_demangle(name, 0, 0, &status);
03768   const std::string name_str(status == 0 ? readable_name : name);
03769   free(readable_name);
03770   return name_str;
03771 #  else
03772   return name;
03773 #  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
03774 
03775 # else
03776 
03777   return "<type>";
03778 
03779 # endif  // GTEST_HAS_RTTI
03780 }
03781 
03782 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
03783 
03784 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
03785 // type.  This can be used as a compile-time assertion to ensure that
03786 // two types are equal.
03787 
03788 template <typename T1, typename T2>
03789 struct AssertTypeEq;
03790 
03791 template <typename T>
03792 struct AssertTypeEq<T, T> {
03793   typedef bool type;
03794 };
03795 
03796 // A unique type used as the default value for the arguments of class
03797 // template Types.  This allows us to simulate variadic templates
03798 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
03799 // support directly.
03800 struct None {};
03801 
03802 // The following family of struct and struct templates are used to
03803 // represent type lists.  In particular, TypesN<T1, T2, ..., TN>
03804 // represents a type list with N types (T1, T2, ..., and TN) in it.
03805 // Except for Types0, every struct in the family has two member types:
03806 // Head for the first type in the list, and Tail for the rest of the
03807 // list.
03808 
03809 // The empty type list.
03810 struct Types0 {};
03811 
03812 // Type lists of length 1, 2, 3, and so on.
03813 
03814 template <typename T1>
03815 struct Types1 {
03816   typedef T1 Head;
03817   typedef Types0 Tail;
03818 };
03819 template <typename T1, typename T2>
03820 struct Types2 {
03821   typedef T1 Head;
03822   typedef Types1<T2> Tail;
03823 };
03824 
03825 template <typename T1, typename T2, typename T3>
03826 struct Types3 {
03827   typedef T1 Head;
03828   typedef Types2<T2, T3> Tail;
03829 };
03830 
03831 template <typename T1, typename T2, typename T3, typename T4>
03832 struct Types4 {
03833   typedef T1 Head;
03834   typedef Types3<T2, T3, T4> Tail;
03835 };
03836 
03837 template <typename T1, typename T2, typename T3, typename T4, typename T5>
03838 struct Types5 {
03839   typedef T1 Head;
03840   typedef Types4<T2, T3, T4, T5> Tail;
03841 };
03842 
03843 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03844     typename T6>
03845 struct Types6 {
03846   typedef T1 Head;
03847   typedef Types5<T2, T3, T4, T5, T6> Tail;
03848 };
03849 
03850 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03851     typename T6, typename T7>
03852 struct Types7 {
03853   typedef T1 Head;
03854   typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
03855 };
03856 
03857 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03858     typename T6, typename T7, typename T8>
03859 struct Types8 {
03860   typedef T1 Head;
03861   typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
03862 };
03863 
03864 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03865     typename T6, typename T7, typename T8, typename T9>
03866 struct Types9 {
03867   typedef T1 Head;
03868   typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
03869 };
03870 
03871 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03872     typename T6, typename T7, typename T8, typename T9, typename T10>
03873 struct Types10 {
03874   typedef T1 Head;
03875   typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
03876 };
03877 
03878 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03879     typename T6, typename T7, typename T8, typename T9, typename T10,
03880     typename T11>
03881 struct Types11 {
03882   typedef T1 Head;
03883   typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
03884 };
03885 
03886 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03887     typename T6, typename T7, typename T8, typename T9, typename T10,
03888     typename T11, typename T12>
03889 struct Types12 {
03890   typedef T1 Head;
03891   typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
03892 };
03893 
03894 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03895     typename T6, typename T7, typename T8, typename T9, typename T10,
03896     typename T11, typename T12, typename T13>
03897 struct Types13 {
03898   typedef T1 Head;
03899   typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
03900 };
03901 
03902 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03903     typename T6, typename T7, typename T8, typename T9, typename T10,
03904     typename T11, typename T12, typename T13, typename T14>
03905 struct Types14 {
03906   typedef T1 Head;
03907   typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
03908 };
03909 
03910 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03911     typename T6, typename T7, typename T8, typename T9, typename T10,
03912     typename T11, typename T12, typename T13, typename T14, typename T15>
03913 struct Types15 {
03914   typedef T1 Head;
03915   typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
03916       T15> Tail;
03917 };
03918 
03919 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03920     typename T6, typename T7, typename T8, typename T9, typename T10,
03921     typename T11, typename T12, typename T13, typename T14, typename T15,
03922     typename T16>
03923 struct Types16 {
03924   typedef T1 Head;
03925   typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03926       T16> Tail;
03927 };
03928 
03929 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03930     typename T6, typename T7, typename T8, typename T9, typename T10,
03931     typename T11, typename T12, typename T13, typename T14, typename T15,
03932     typename T16, typename T17>
03933 struct Types17 {
03934   typedef T1 Head;
03935   typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03936       T16, T17> Tail;
03937 };
03938 
03939 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03940     typename T6, typename T7, typename T8, typename T9, typename T10,
03941     typename T11, typename T12, typename T13, typename T14, typename T15,
03942     typename T16, typename T17, typename T18>
03943 struct Types18 {
03944   typedef T1 Head;
03945   typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03946       T16, T17, T18> Tail;
03947 };
03948 
03949 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03950     typename T6, typename T7, typename T8, typename T9, typename T10,
03951     typename T11, typename T12, typename T13, typename T14, typename T15,
03952     typename T16, typename T17, typename T18, typename T19>
03953 struct Types19 {
03954   typedef T1 Head;
03955   typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03956       T16, T17, T18, T19> Tail;
03957 };
03958 
03959 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03960     typename T6, typename T7, typename T8, typename T9, typename T10,
03961     typename T11, typename T12, typename T13, typename T14, typename T15,
03962     typename T16, typename T17, typename T18, typename T19, typename T20>
03963 struct Types20 {
03964   typedef T1 Head;
03965   typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03966       T16, T17, T18, T19, T20> Tail;
03967 };
03968 
03969 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03970     typename T6, typename T7, typename T8, typename T9, typename T10,
03971     typename T11, typename T12, typename T13, typename T14, typename T15,
03972     typename T16, typename T17, typename T18, typename T19, typename T20,
03973     typename T21>
03974 struct Types21 {
03975   typedef T1 Head;
03976   typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03977       T16, T17, T18, T19, T20, T21> Tail;
03978 };
03979 
03980 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03981     typename T6, typename T7, typename T8, typename T9, typename T10,
03982     typename T11, typename T12, typename T13, typename T14, typename T15,
03983     typename T16, typename T17, typename T18, typename T19, typename T20,
03984     typename T21, typename T22>
03985 struct Types22 {
03986   typedef T1 Head;
03987   typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03988       T16, T17, T18, T19, T20, T21, T22> Tail;
03989 };
03990 
03991 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03992     typename T6, typename T7, typename T8, typename T9, typename T10,
03993     typename T11, typename T12, typename T13, typename T14, typename T15,
03994     typename T16, typename T17, typename T18, typename T19, typename T20,
03995     typename T21, typename T22, typename T23>
03996 struct Types23 {
03997   typedef T1 Head;
03998   typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03999       T16, T17, T18, T19, T20, T21, T22, T23> Tail;
04000 };
04001 
04002 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04003     typename T6, typename T7, typename T8, typename T9, typename T10,
04004     typename T11, typename T12, typename T13, typename T14, typename T15,
04005     typename T16, typename T17, typename T18, typename T19, typename T20,
04006     typename T21, typename T22, typename T23, typename T24>
04007 struct Types24 {
04008   typedef T1 Head;
04009   typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04010       T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
04011 };
04012 
04013 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04014     typename T6, typename T7, typename T8, typename T9, typename T10,
04015     typename T11, typename T12, typename T13, typename T14, typename T15,
04016     typename T16, typename T17, typename T18, typename T19, typename T20,
04017     typename T21, typename T22, typename T23, typename T24, typename T25>
04018 struct Types25 {
04019   typedef T1 Head;
04020   typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04021       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
04022 };
04023 
04024 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04025     typename T6, typename T7, typename T8, typename T9, typename T10,
04026     typename T11, typename T12, typename T13, typename T14, typename T15,
04027     typename T16, typename T17, typename T18, typename T19, typename T20,
04028     typename T21, typename T22, typename T23, typename T24, typename T25,
04029     typename T26>
04030 struct Types26 {
04031   typedef T1 Head;
04032   typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04033       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
04034 };
04035 
04036 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04037     typename T6, typename T7, typename T8, typename T9, typename T10,
04038     typename T11, typename T12, typename T13, typename T14, typename T15,
04039     typename T16, typename T17, typename T18, typename T19, typename T20,
04040     typename T21, typename T22, typename T23, typename T24, typename T25,
04041     typename T26, typename T27>
04042 struct Types27 {
04043   typedef T1 Head;
04044   typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04045       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
04046 };
04047 
04048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04049     typename T6, typename T7, typename T8, typename T9, typename T10,
04050     typename T11, typename T12, typename T13, typename T14, typename T15,
04051     typename T16, typename T17, typename T18, typename T19, typename T20,
04052     typename T21, typename T22, typename T23, typename T24, typename T25,
04053     typename T26, typename T27, typename T28>
04054 struct Types28 {
04055   typedef T1 Head;
04056   typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04057       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
04058 };
04059 
04060 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04061     typename T6, typename T7, typename T8, typename T9, typename T10,
04062     typename T11, typename T12, typename T13, typename T14, typename T15,
04063     typename T16, typename T17, typename T18, typename T19, typename T20,
04064     typename T21, typename T22, typename T23, typename T24, typename T25,
04065     typename T26, typename T27, typename T28, typename T29>
04066 struct Types29 {
04067   typedef T1 Head;
04068   typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04069       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
04070       T29> Tail;
04071 };
04072 
04073 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04074     typename T6, typename T7, typename T8, typename T9, typename T10,
04075     typename T11, typename T12, typename T13, typename T14, typename T15,
04076     typename T16, typename T17, typename T18, typename T19, typename T20,
04077     typename T21, typename T22, typename T23, typename T24, typename T25,
04078     typename T26, typename T27, typename T28, typename T29, typename T30>
04079 struct Types30 {
04080   typedef T1 Head;
04081   typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04082       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04083       T30> Tail;
04084 };
04085 
04086 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04087     typename T6, typename T7, typename T8, typename T9, typename T10,
04088     typename T11, typename T12, typename T13, typename T14, typename T15,
04089     typename T16, typename T17, typename T18, typename T19, typename T20,
04090     typename T21, typename T22, typename T23, typename T24, typename T25,
04091     typename T26, typename T27, typename T28, typename T29, typename T30,
04092     typename T31>
04093 struct Types31 {
04094   typedef T1 Head;
04095   typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04096       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04097       T30, T31> Tail;
04098 };
04099 
04100 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04101     typename T6, typename T7, typename T8, typename T9, typename T10,
04102     typename T11, typename T12, typename T13, typename T14, typename T15,
04103     typename T16, typename T17, typename T18, typename T19, typename T20,
04104     typename T21, typename T22, typename T23, typename T24, typename T25,
04105     typename T26, typename T27, typename T28, typename T29, typename T30,
04106     typename T31, typename T32>
04107 struct Types32 {
04108   typedef T1 Head;
04109   typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04110       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04111       T30, T31, T32> Tail;
04112 };
04113 
04114 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04115     typename T6, typename T7, typename T8, typename T9, typename T10,
04116     typename T11, typename T12, typename T13, typename T14, typename T15,
04117     typename T16, typename T17, typename T18, typename T19, typename T20,
04118     typename T21, typename T22, typename T23, typename T24, typename T25,
04119     typename T26, typename T27, typename T28, typename T29, typename T30,
04120     typename T31, typename T32, typename T33>
04121 struct Types33 {
04122   typedef T1 Head;
04123   typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04124       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04125       T30, T31, T32, T33> Tail;
04126 };
04127 
04128 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04129     typename T6, typename T7, typename T8, typename T9, typename T10,
04130     typename T11, typename T12, typename T13, typename T14, typename T15,
04131     typename T16, typename T17, typename T18, typename T19, typename T20,
04132     typename T21, typename T22, typename T23, typename T24, typename T25,
04133     typename T26, typename T27, typename T28, typename T29, typename T30,
04134     typename T31, typename T32, typename T33, typename T34>
04135 struct Types34 {
04136   typedef T1 Head;
04137   typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04138       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04139       T30, T31, T32, T33, T34> Tail;
04140 };
04141 
04142 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04143     typename T6, typename T7, typename T8, typename T9, typename T10,
04144     typename T11, typename T12, typename T13, typename T14, typename T15,
04145     typename T16, typename T17, typename T18, typename T19, typename T20,
04146     typename T21, typename T22, typename T23, typename T24, typename T25,
04147     typename T26, typename T27, typename T28, typename T29, typename T30,
04148     typename T31, typename T32, typename T33, typename T34, typename T35>
04149 struct Types35 {
04150   typedef T1 Head;
04151   typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04152       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04153       T30, T31, T32, T33, T34, T35> Tail;
04154 };
04155 
04156 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04157     typename T6, typename T7, typename T8, typename T9, typename T10,
04158     typename T11, typename T12, typename T13, typename T14, typename T15,
04159     typename T16, typename T17, typename T18, typename T19, typename T20,
04160     typename T21, typename T22, typename T23, typename T24, typename T25,
04161     typename T26, typename T27, typename T28, typename T29, typename T30,
04162     typename T31, typename T32, typename T33, typename T34, typename T35,
04163     typename T36>
04164 struct Types36 {
04165   typedef T1 Head;
04166   typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04167       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04168       T30, T31, T32, T33, T34, T35, T36> Tail;
04169 };
04170 
04171 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04172     typename T6, typename T7, typename T8, typename T9, typename T10,
04173     typename T11, typename T12, typename T13, typename T14, typename T15,
04174     typename T16, typename T17, typename T18, typename T19, typename T20,
04175     typename T21, typename T22, typename T23, typename T24, typename T25,
04176     typename T26, typename T27, typename T28, typename T29, typename T30,
04177     typename T31, typename T32, typename T33, typename T34, typename T35,
04178     typename T36, typename T37>
04179 struct Types37 {
04180   typedef T1 Head;
04181   typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04182       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04183       T30, T31, T32, T33, T34, T35, T36, T37> Tail;
04184 };
04185 
04186 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04187     typename T6, typename T7, typename T8, typename T9, typename T10,
04188     typename T11, typename T12, typename T13, typename T14, typename T15,
04189     typename T16, typename T17, typename T18, typename T19, typename T20,
04190     typename T21, typename T22, typename T23, typename T24, typename T25,
04191     typename T26, typename T27, typename T28, typename T29, typename T30,
04192     typename T31, typename T32, typename T33, typename T34, typename T35,
04193     typename T36, typename T37, typename T38>
04194 struct Types38 {
04195   typedef T1 Head;
04196   typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04197       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04198       T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
04199 };
04200 
04201 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04202     typename T6, typename T7, typename T8, typename T9, typename T10,
04203     typename T11, typename T12, typename T13, typename T14, typename T15,
04204     typename T16, typename T17, typename T18, typename T19, typename T20,
04205     typename T21, typename T22, typename T23, typename T24, typename T25,
04206     typename T26, typename T27, typename T28, typename T29, typename T30,
04207     typename T31, typename T32, typename T33, typename T34, typename T35,
04208     typename T36, typename T37, typename T38, typename T39>
04209 struct Types39 {
04210   typedef T1 Head;
04211   typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04212       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04213       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
04214 };
04215 
04216 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04217     typename T6, typename T7, typename T8, typename T9, typename T10,
04218     typename T11, typename T12, typename T13, typename T14, typename T15,
04219     typename T16, typename T17, typename T18, typename T19, typename T20,
04220     typename T21, typename T22, typename T23, typename T24, typename T25,
04221     typename T26, typename T27, typename T28, typename T29, typename T30,
04222     typename T31, typename T32, typename T33, typename T34, typename T35,
04223     typename T36, typename T37, typename T38, typename T39, typename T40>
04224 struct Types40 {
04225   typedef T1 Head;
04226   typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04227       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04228       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
04229 };
04230 
04231 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04232     typename T6, typename T7, typename T8, typename T9, typename T10,
04233     typename T11, typename T12, typename T13, typename T14, typename T15,
04234     typename T16, typename T17, typename T18, typename T19, typename T20,
04235     typename T21, typename T22, typename T23, typename T24, typename T25,
04236     typename T26, typename T27, typename T28, typename T29, typename T30,
04237     typename T31, typename T32, typename T33, typename T34, typename T35,
04238     typename T36, typename T37, typename T38, typename T39, typename T40,
04239     typename T41>
04240 struct Types41 {
04241   typedef T1 Head;
04242   typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04243       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04244       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
04245 };
04246 
04247 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04248     typename T6, typename T7, typename T8, typename T9, typename T10,
04249     typename T11, typename T12, typename T13, typename T14, typename T15,
04250     typename T16, typename T17, typename T18, typename T19, typename T20,
04251     typename T21, typename T22, typename T23, typename T24, typename T25,
04252     typename T26, typename T27, typename T28, typename T29, typename T30,
04253     typename T31, typename T32, typename T33, typename T34, typename T35,
04254     typename T36, typename T37, typename T38, typename T39, typename T40,
04255     typename T41, typename T42>
04256 struct Types42 {
04257   typedef T1 Head;
04258   typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04259       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04260       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
04261 };
04262 
04263 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04264     typename T6, typename T7, typename T8, typename T9, typename T10,
04265     typename T11, typename T12, typename T13, typename T14, typename T15,
04266     typename T16, typename T17, typename T18, typename T19, typename T20,
04267     typename T21, typename T22, typename T23, typename T24, typename T25,
04268     typename T26, typename T27, typename T28, typename T29, typename T30,
04269     typename T31, typename T32, typename T33, typename T34, typename T35,
04270     typename T36, typename T37, typename T38, typename T39, typename T40,
04271     typename T41, typename T42, typename T43>
04272 struct Types43 {
04273   typedef T1 Head;
04274   typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04275       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04276       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
04277       T43> Tail;
04278 };
04279 
04280 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04281     typename T6, typename T7, typename T8, typename T9, typename T10,
04282     typename T11, typename T12, typename T13, typename T14, typename T15,
04283     typename T16, typename T17, typename T18, typename T19, typename T20,
04284     typename T21, typename T22, typename T23, typename T24, typename T25,
04285     typename T26, typename T27, typename T28, typename T29, typename T30,
04286     typename T31, typename T32, typename T33, typename T34, typename T35,
04287     typename T36, typename T37, typename T38, typename T39, typename T40,
04288     typename T41, typename T42, typename T43, typename T44>
04289 struct Types44 {
04290   typedef T1 Head;
04291   typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04292       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04293       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04294       T44> Tail;
04295 };
04296 
04297 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04298     typename T6, typename T7, typename T8, typename T9, typename T10,
04299     typename T11, typename T12, typename T13, typename T14, typename T15,
04300     typename T16, typename T17, typename T18, typename T19, typename T20,
04301     typename T21, typename T22, typename T23, typename T24, typename T25,
04302     typename T26, typename T27, typename T28, typename T29, typename T30,
04303     typename T31, typename T32, typename T33, typename T34, typename T35,
04304     typename T36, typename T37, typename T38, typename T39, typename T40,
04305     typename T41, typename T42, typename T43, typename T44, typename T45>
04306 struct Types45 {
04307   typedef T1 Head;
04308   typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04309       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04310       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04311       T44, T45> Tail;
04312 };
04313 
04314 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04315     typename T6, typename T7, typename T8, typename T9, typename T10,
04316     typename T11, typename T12, typename T13, typename T14, typename T15,
04317     typename T16, typename T17, typename T18, typename T19, typename T20,
04318     typename T21, typename T22, typename T23, typename T24, typename T25,
04319     typename T26, typename T27, typename T28, typename T29, typename T30,
04320     typename T31, typename T32, typename T33, typename T34, typename T35,
04321     typename T36, typename T37, typename T38, typename T39, typename T40,
04322     typename T41, typename T42, typename T43, typename T44, typename T45,
04323     typename T46>
04324 struct Types46 {
04325   typedef T1 Head;
04326   typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04327       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04328       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04329       T44, T45, T46> Tail;
04330 };
04331 
04332 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04333     typename T6, typename T7, typename T8, typename T9, typename T10,
04334     typename T11, typename T12, typename T13, typename T14, typename T15,
04335     typename T16, typename T17, typename T18, typename T19, typename T20,
04336     typename T21, typename T22, typename T23, typename T24, typename T25,
04337     typename T26, typename T27, typename T28, typename T29, typename T30,
04338     typename T31, typename T32, typename T33, typename T34, typename T35,
04339     typename T36, typename T37, typename T38, typename T39, typename T40,
04340     typename T41, typename T42, typename T43, typename T44, typename T45,
04341     typename T46, typename T47>
04342 struct Types47 {
04343   typedef T1 Head;
04344   typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04345       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04346       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04347       T44, T45, T46, T47> Tail;
04348 };
04349 
04350 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04351     typename T6, typename T7, typename T8, typename T9, typename T10,
04352     typename T11, typename T12, typename T13, typename T14, typename T15,
04353     typename T16, typename T17, typename T18, typename T19, typename T20,
04354     typename T21, typename T22, typename T23, typename T24, typename T25,
04355     typename T26, typename T27, typename T28, typename T29, typename T30,
04356     typename T31, typename T32, typename T33, typename T34, typename T35,
04357     typename T36, typename T37, typename T38, typename T39, typename T40,
04358     typename T41, typename T42, typename T43, typename T44, typename T45,
04359     typename T46, typename T47, typename T48>
04360 struct Types48 {
04361   typedef T1 Head;
04362   typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04363       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04364       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04365       T44, T45, T46, T47, T48> Tail;
04366 };
04367 
04368 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04369     typename T6, typename T7, typename T8, typename T9, typename T10,
04370     typename T11, typename T12, typename T13, typename T14, typename T15,
04371     typename T16, typename T17, typename T18, typename T19, typename T20,
04372     typename T21, typename T22, typename T23, typename T24, typename T25,
04373     typename T26, typename T27, typename T28, typename T29, typename T30,
04374     typename T31, typename T32, typename T33, typename T34, typename T35,
04375     typename T36, typename T37, typename T38, typename T39, typename T40,
04376     typename T41, typename T42, typename T43, typename T44, typename T45,
04377     typename T46, typename T47, typename T48, typename T49>
04378 struct Types49 {
04379   typedef T1 Head;
04380   typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04381       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04382       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04383       T44, T45, T46, T47, T48, T49> Tail;
04384 };
04385 
04386 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04387     typename T6, typename T7, typename T8, typename T9, typename T10,
04388     typename T11, typename T12, typename T13, typename T14, typename T15,
04389     typename T16, typename T17, typename T18, typename T19, typename T20,
04390     typename T21, typename T22, typename T23, typename T24, typename T25,
04391     typename T26, typename T27, typename T28, typename T29, typename T30,
04392     typename T31, typename T32, typename T33, typename T34, typename T35,
04393     typename T36, typename T37, typename T38, typename T39, typename T40,
04394     typename T41, typename T42, typename T43, typename T44, typename T45,
04395     typename T46, typename T47, typename T48, typename T49, typename T50>
04396 struct Types50 {
04397   typedef T1 Head;
04398   typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04399       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04400       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04401       T44, T45, T46, T47, T48, T49, T50> Tail;
04402 };
04403 
04404 
04405 }  // namespace internal
04406 
04407 // We don't want to require the users to write TypesN<...> directly,
04408 // as that would require them to count the length.  Types<...> is much
04409 // easier to write, but generates horrible messages when there is a
04410 // compiler error, as gcc insists on printing out each template
04411 // argument, even if it has the default value (this means Types<int>
04412 // will appear as Types<int, None, None, ..., None> in the compiler
04413 // errors).
04414 //
04415 // Our solution is to combine the best part of the two approaches: a
04416 // user would write Types<T1, ..., TN>, and Google Test will translate
04417 // that to TypesN<T1, ..., TN> internally to make error messages
04418 // readable.  The translation is done by the 'type' member of the
04419 // Types template.
04420 template <typename T1 = internal::None, typename T2 = internal::None,
04421     typename T3 = internal::None, typename T4 = internal::None,
04422     typename T5 = internal::None, typename T6 = internal::None,
04423     typename T7 = internal::None, typename T8 = internal::None,
04424     typename T9 = internal::None, typename T10 = internal::None,
04425     typename T11 = internal::None, typename T12 = internal::None,
04426     typename T13 = internal::None, typename T14 = internal::None,
04427     typename T15 = internal::None, typename T16 = internal::None,
04428     typename T17 = internal::None, typename T18 = internal::None,
04429     typename T19 = internal::None, typename T20 = internal::None,
04430     typename T21 = internal::None, typename T22 = internal::None,
04431     typename T23 = internal::None, typename T24 = internal::None,
04432     typename T25 = internal::None, typename T26 = internal::None,
04433     typename T27 = internal::None, typename T28 = internal::None,
04434     typename T29 = internal::None, typename T30 = internal::None,
04435     typename T31 = internal::None, typename T32 = internal::None,
04436     typename T33 = internal::None, typename T34 = internal::None,
04437     typename T35 = internal::None, typename T36 = internal::None,
04438     typename T37 = internal::None, typename T38 = internal::None,
04439     typename T39 = internal::None, typename T40 = internal::None,
04440     typename T41 = internal::None, typename T42 = internal::None,
04441     typename T43 = internal::None, typename T44 = internal::None,
04442     typename T45 = internal::None, typename T46 = internal::None,
04443     typename T47 = internal::None, typename T48 = internal::None,
04444     typename T49 = internal::None, typename T50 = internal::None>
04445 struct Types {
04446   typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04447       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04448       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
04449       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
04450 };
04451 
04452 template <>
04453 struct Types<internal::None, internal::None, internal::None, internal::None,
04454     internal::None, internal::None, internal::None, internal::None,
04455     internal::None, internal::None, internal::None, internal::None,
04456     internal::None, internal::None, internal::None, internal::None,
04457     internal::None, internal::None, internal::None, internal::None,
04458     internal::None, internal::None, internal::None, internal::None,
04459     internal::None, internal::None, internal::None, internal::None,
04460     internal::None, internal::None, internal::None, internal::None,
04461     internal::None, internal::None, internal::None, internal::None,
04462     internal::None, internal::None, internal::None, internal::None,
04463     internal::None, internal::None, internal::None, internal::None,
04464     internal::None, internal::None, internal::None, internal::None,
04465     internal::None, internal::None> {
04466   typedef internal::Types0 type;
04467 };
04468 template <typename T1>
04469 struct Types<T1, internal::None, internal::None, internal::None,
04470     internal::None, internal::None, internal::None, internal::None,
04471     internal::None, internal::None, internal::None, internal::None,
04472     internal::None, internal::None, internal::None, internal::None,
04473     internal::None, internal::None, internal::None, internal::None,
04474     internal::None, internal::None, internal::None, internal::None,
04475     internal::None, internal::None, internal::None, internal::None,
04476     internal::None, internal::None, internal::None, internal::None,
04477     internal::None, internal::None, internal::None, internal::None,
04478     internal::None, internal::None, internal::None, internal::None,
04479     internal::None, internal::None, internal::None, internal::None,
04480     internal::None, internal::None, internal::None, internal::None,
04481     internal::None, internal::None> {
04482   typedef internal::Types1<T1> type;
04483 };
04484 template <typename T1, typename T2>
04485 struct Types<T1, T2, internal::None, internal::None, internal::None,
04486     internal::None, internal::None, internal::None, internal::None,
04487     internal::None, internal::None, internal::None, internal::None,
04488     internal::None, internal::None, internal::None, internal::None,
04489     internal::None, internal::None, internal::None, internal::None,
04490     internal::None, internal::None, internal::None, internal::None,
04491     internal::None, internal::None, internal::None, internal::None,
04492     internal::None, internal::None, internal::None, internal::None,
04493     internal::None, internal::None, internal::None, internal::None,
04494     internal::None, internal::None, internal::None, internal::None,
04495     internal::None, internal::None, internal::None, internal::None,
04496     internal::None, internal::None, internal::None, internal::None,
04497     internal::None> {
04498   typedef internal::Types2<T1, T2> type;
04499 };
04500 template <typename T1, typename T2, typename T3>
04501 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
04502     internal::None, internal::None, internal::None, internal::None,
04503     internal::None, internal::None, internal::None, internal::None,
04504     internal::None, internal::None, internal::None, internal::None,
04505     internal::None, internal::None, internal::None, internal::None,
04506     internal::None, internal::None, internal::None, internal::None,
04507     internal::None, internal::None, internal::None, internal::None,
04508     internal::None, internal::None, internal::None, internal::None,
04509     internal::None, internal::None, internal::None, internal::None,
04510     internal::None, internal::None, internal::None, internal::None,
04511     internal::None, internal::None, internal::None, internal::None,
04512     internal::None, internal::None, internal::None, internal::None> {
04513   typedef internal::Types3<T1, T2, T3> type;
04514 };
04515 template <typename T1, typename T2, typename T3, typename T4>
04516 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
04517     internal::None, internal::None, internal::None, internal::None,
04518     internal::None, internal::None, internal::None, internal::None,
04519     internal::None, internal::None, internal::None, internal::None,
04520     internal::None, internal::None, internal::None, internal::None,
04521     internal::None, internal::None, internal::None, internal::None,
04522     internal::None, internal::None, internal::None, internal::None,
04523     internal::None, internal::None, internal::None, internal::None,
04524     internal::None, internal::None, internal::None, internal::None,
04525     internal::None, internal::None, internal::None, internal::None,
04526     internal::None, internal::None, internal::None, internal::None,
04527     internal::None, internal::None, internal::None> {
04528   typedef internal::Types4<T1, T2, T3, T4> type;
04529 };
04530 template <typename T1, typename T2, typename T3, typename T4, typename T5>
04531 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
04532     internal::None, internal::None, internal::None, internal::None,
04533     internal::None, internal::None, internal::None, internal::None,
04534     internal::None, internal::None, internal::None, internal::None,
04535     internal::None, internal::None, internal::None, internal::None,
04536     internal::None, internal::None, internal::None, internal::None,
04537     internal::None, internal::None, internal::None, internal::None,
04538     internal::None, internal::None, internal::None, internal::None,
04539     internal::None, internal::None, internal::None, internal::None,
04540     internal::None, internal::None, internal::None, internal::None,
04541     internal::None, internal::None, internal::None, internal::None,
04542     internal::None, internal::None, internal::None> {
04543   typedef internal::Types5<T1, T2, T3, T4, T5> type;
04544 };
04545 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04546     typename T6>
04547 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
04548     internal::None, internal::None, internal::None, internal::None,
04549     internal::None, internal::None, internal::None, internal::None,
04550     internal::None, internal::None, internal::None, internal::None,
04551     internal::None, internal::None, internal::None, internal::None,
04552     internal::None, internal::None, internal::None, internal::None,
04553     internal::None, internal::None, internal::None, internal::None,
04554     internal::None, internal::None, internal::None, internal::None,
04555     internal::None, internal::None, internal::None, internal::None,
04556     internal::None, internal::None, internal::None, internal::None,
04557     internal::None, internal::None, internal::None, internal::None,
04558     internal::None, internal::None> {
04559   typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
04560 };
04561 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04562     typename T6, typename T7>
04563 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
04564     internal::None, internal::None, internal::None, internal::None,
04565     internal::None, internal::None, internal::None, internal::None,
04566     internal::None, internal::None, internal::None, internal::None,
04567     internal::None, internal::None, internal::None, internal::None,
04568     internal::None, internal::None, internal::None, internal::None,
04569     internal::None, internal::None, internal::None, internal::None,
04570     internal::None, internal::None, internal::None, internal::None,
04571     internal::None, internal::None, internal::None, internal::None,
04572     internal::None, internal::None, internal::None, internal::None,
04573     internal::None, internal::None, internal::None, internal::None,
04574     internal::None> {
04575   typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
04576 };
04577 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04578     typename T6, typename T7, typename T8>
04579 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
04580     internal::None, internal::None, internal::None, internal::None,
04581     internal::None, internal::None, internal::None, internal::None,
04582     internal::None, internal::None, internal::None, internal::None,
04583     internal::None, internal::None, internal::None, internal::None,
04584     internal::None, internal::None, internal::None, internal::None,
04585     internal::None, internal::None, internal::None, internal::None,
04586     internal::None, internal::None, internal::None, internal::None,
04587     internal::None, internal::None, internal::None, internal::None,
04588     internal::None, internal::None, internal::None, internal::None,
04589     internal::None, internal::None, internal::None, internal::None> {
04590   typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
04591 };
04592 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04593     typename T6, typename T7, typename T8, typename T9>
04594 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
04595     internal::None, internal::None, internal::None, internal::None,
04596     internal::None, internal::None, internal::None, internal::None,
04597     internal::None, internal::None, internal::None, internal::None,
04598     internal::None, internal::None, internal::None, internal::None,
04599     internal::None, internal::None, internal::None, internal::None,
04600     internal::None, internal::None, internal::None, internal::None,
04601     internal::None, internal::None, internal::None, internal::None,
04602     internal::None, internal::None, internal::None, internal::None,
04603     internal::None, internal::None, internal::None, internal::None,
04604     internal::None, internal::None, internal::None, internal::None> {
04605   typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
04606 };
04607 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04608     typename T6, typename T7, typename T8, typename T9, typename T10>
04609 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
04610     internal::None, internal::None, internal::None, internal::None,
04611     internal::None, internal::None, internal::None, internal::None,
04612     internal::None, internal::None, internal::None, internal::None,
04613     internal::None, internal::None, internal::None, internal::None,
04614     internal::None, internal::None, internal::None, internal::None,
04615     internal::None, internal::None, internal::None, internal::None,
04616     internal::None, internal::None, internal::None, internal::None,
04617     internal::None, internal::None, internal::None, internal::None,
04618     internal::None, internal::None, internal::None, internal::None,
04619     internal::None, internal::None, internal::None> {
04620   typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
04621 };
04622 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04623     typename T6, typename T7, typename T8, typename T9, typename T10,
04624     typename T11>
04625 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
04626     internal::None, internal::None, internal::None, internal::None,
04627     internal::None, internal::None, internal::None, internal::None,
04628     internal::None, internal::None, internal::None, internal::None,
04629     internal::None, internal::None, internal::None, internal::None,
04630     internal::None, internal::None, internal::None, internal::None,
04631     internal::None, internal::None, internal::None, internal::None,
04632     internal::None, internal::None, internal::None, internal::None,
04633     internal::None, internal::None, internal::None, internal::None,
04634     internal::None, internal::None, internal::None, internal::None,
04635     internal::None, internal::None> {
04636   typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
04637 };
04638 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04639     typename T6, typename T7, typename T8, typename T9, typename T10,
04640     typename T11, typename T12>
04641 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
04642     internal::None, internal::None, internal::None, internal::None,
04643     internal::None, internal::None, internal::None, internal::None,
04644     internal::None, internal::None, internal::None, internal::None,
04645     internal::None, internal::None, internal::None, internal::None,
04646     internal::None, internal::None, internal::None, internal::None,
04647     internal::None, internal::None, internal::None, internal::None,
04648     internal::None, internal::None, internal::None, internal::None,
04649     internal::None, internal::None, internal::None, internal::None,
04650     internal::None, internal::None, internal::None, internal::None,
04651     internal::None> {
04652   typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
04653       T12> type;
04654 };
04655 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04656     typename T6, typename T7, typename T8, typename T9, typename T10,
04657     typename T11, typename T12, typename T13>
04658 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
04659     internal::None, internal::None, internal::None, internal::None,
04660     internal::None, internal::None, internal::None, internal::None,
04661     internal::None, internal::None, internal::None, internal::None,
04662     internal::None, internal::None, internal::None, internal::None,
04663     internal::None, internal::None, internal::None, internal::None,
04664     internal::None, internal::None, internal::None, internal::None,
04665     internal::None, internal::None, internal::None, internal::None,
04666     internal::None, internal::None, internal::None, internal::None,
04667     internal::None, internal::None, internal::None, internal::None,
04668     internal::None> {
04669   typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04670       T13> type;
04671 };
04672 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04673     typename T6, typename T7, typename T8, typename T9, typename T10,
04674     typename T11, typename T12, typename T13, typename T14>
04675 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
04676     internal::None, internal::None, internal::None, internal::None,
04677     internal::None, internal::None, internal::None, internal::None,
04678     internal::None, internal::None, internal::None, internal::None,
04679     internal::None, internal::None, internal::None, internal::None,
04680     internal::None, internal::None, internal::None, internal::None,
04681     internal::None, internal::None, internal::None, internal::None,
04682     internal::None, internal::None, internal::None, internal::None,
04683     internal::None, internal::None, internal::None, internal::None,
04684     internal::None, internal::None, internal::None, internal::None> {
04685   typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04686       T13, T14> type;
04687 };
04688 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04689     typename T6, typename T7, typename T8, typename T9, typename T10,
04690     typename T11, typename T12, typename T13, typename T14, typename T15>
04691 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04692     internal::None, internal::None, internal::None, internal::None,
04693     internal::None, internal::None, internal::None, internal::None,
04694     internal::None, internal::None, internal::None, internal::None,
04695     internal::None, internal::None, internal::None, internal::None,
04696     internal::None, internal::None, internal::None, internal::None,
04697     internal::None, internal::None, internal::None, internal::None,
04698     internal::None, internal::None, internal::None, internal::None,
04699     internal::None, internal::None, internal::None, internal::None,
04700     internal::None, internal::None, internal::None> {
04701   typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04702       T13, T14, T15> type;
04703 };
04704 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04705     typename T6, typename T7, typename T8, typename T9, typename T10,
04706     typename T11, typename T12, typename T13, typename T14, typename T15,
04707     typename T16>
04708 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04709     T16, internal::None, internal::None, internal::None, internal::None,
04710     internal::None, internal::None, internal::None, internal::None,
04711     internal::None, internal::None, internal::None, internal::None,
04712     internal::None, internal::None, internal::None, internal::None,
04713     internal::None, internal::None, internal::None, internal::None,
04714     internal::None, internal::None, internal::None, internal::None,
04715     internal::None, internal::None, internal::None, internal::None,
04716     internal::None, internal::None, internal::None, internal::None,
04717     internal::None, internal::None> {
04718   typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04719       T13, T14, T15, T16> type;
04720 };
04721 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04722     typename T6, typename T7, typename T8, typename T9, typename T10,
04723     typename T11, typename T12, typename T13, typename T14, typename T15,
04724     typename T16, typename T17>
04725 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04726     T16, T17, internal::None, internal::None, internal::None, internal::None,
04727     internal::None, internal::None, internal::None, internal::None,
04728     internal::None, internal::None, internal::None, internal::None,
04729     internal::None, internal::None, internal::None, internal::None,
04730     internal::None, internal::None, internal::None, internal::None,
04731     internal::None, internal::None, internal::None, internal::None,
04732     internal::None, internal::None, internal::None, internal::None,
04733     internal::None, internal::None, internal::None, internal::None,
04734     internal::None> {
04735   typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04736       T13, T14, T15, T16, T17> type;
04737 };
04738 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04739     typename T6, typename T7, typename T8, typename T9, typename T10,
04740     typename T11, typename T12, typename T13, typename T14, typename T15,
04741     typename T16, typename T17, typename T18>
04742 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04743     T16, T17, T18, internal::None, internal::None, internal::None,
04744     internal::None, internal::None, internal::None, internal::None,
04745     internal::None, internal::None, internal::None, internal::None,
04746     internal::None, internal::None, internal::None, internal::None,
04747     internal::None, internal::None, internal::None, internal::None,
04748     internal::None, internal::None, internal::None, internal::None,
04749     internal::None, internal::None, internal::None, internal::None,
04750     internal::None, internal::None, internal::None, internal::None,
04751     internal::None> {
04752   typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04753       T13, T14, T15, T16, T17, T18> type;
04754 };
04755 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04756     typename T6, typename T7, typename T8, typename T9, typename T10,
04757     typename T11, typename T12, typename T13, typename T14, typename T15,
04758     typename T16, typename T17, typename T18, typename T19>
04759 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04760     T16, T17, T18, T19, internal::None, internal::None, internal::None,
04761     internal::None, internal::None, internal::None, internal::None,
04762     internal::None, internal::None, internal::None, internal::None,
04763     internal::None, internal::None, internal::None, internal::None,
04764     internal::None, internal::None, internal::None, internal::None,
04765     internal::None, internal::None, internal::None, internal::None,
04766     internal::None, internal::None, internal::None, internal::None,
04767     internal::None, internal::None, internal::None, internal::None> {
04768   typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04769       T13, T14, T15, T16, T17, T18, T19> type;
04770 };
04771 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04772     typename T6, typename T7, typename T8, typename T9, typename T10,
04773     typename T11, typename T12, typename T13, typename T14, typename T15,
04774     typename T16, typename T17, typename T18, typename T19, typename T20>
04775 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04776     T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
04777     internal::None, internal::None, internal::None, internal::None,
04778     internal::None, internal::None, internal::None, internal::None,
04779     internal::None, internal::None, internal::None, internal::None,
04780     internal::None, internal::None, internal::None, internal::None,
04781     internal::None, internal::None, internal::None, internal::None,
04782     internal::None, internal::None, internal::None, internal::None,
04783     internal::None, internal::None, internal::None> {
04784   typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04785       T13, T14, T15, T16, T17, T18, T19, T20> type;
04786 };
04787 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04788     typename T6, typename T7, typename T8, typename T9, typename T10,
04789     typename T11, typename T12, typename T13, typename T14, typename T15,
04790     typename T16, typename T17, typename T18, typename T19, typename T20,
04791     typename T21>
04792 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04793     T16, T17, T18, T19, T20, T21, internal::None, internal::None,
04794     internal::None, internal::None, internal::None, internal::None,
04795     internal::None, internal::None, internal::None, internal::None,
04796     internal::None, internal::None, internal::None, internal::None,
04797     internal::None, internal::None, internal::None, internal::None,
04798     internal::None, internal::None, internal::None, internal::None,
04799     internal::None, internal::None, internal::None, internal::None,
04800     internal::None, internal::None, internal::None> {
04801   typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04802       T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
04803 };
04804 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04805     typename T6, typename T7, typename T8, typename T9, typename T10,
04806     typename T11, typename T12, typename T13, typename T14, typename T15,
04807     typename T16, typename T17, typename T18, typename T19, typename T20,
04808     typename T21, typename T22>
04809 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04810     T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
04811     internal::None, internal::None, internal::None, internal::None,
04812     internal::None, internal::None, internal::None, internal::None,
04813     internal::None, internal::None, internal::None, internal::None,
04814     internal::None, internal::None, internal::None, internal::None,
04815     internal::None, internal::None, internal::None, internal::None,
04816     internal::None, internal::None, internal::None, internal::None,
04817     internal::None, internal::None> {
04818   typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04819       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
04820 };
04821 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04822     typename T6, typename T7, typename T8, typename T9, typename T10,
04823     typename T11, typename T12, typename T13, typename T14, typename T15,
04824     typename T16, typename T17, typename T18, typename T19, typename T20,
04825     typename T21, typename T22, typename T23>
04826 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04827     T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
04828     internal::None, internal::None, internal::None, internal::None,
04829     internal::None, internal::None, internal::None, internal::None,
04830     internal::None, internal::None, internal::None, internal::None,
04831     internal::None, internal::None, internal::None, internal::None,
04832     internal::None, internal::None, internal::None, internal::None,
04833     internal::None, internal::None, internal::None, internal::None,
04834     internal::None> {
04835   typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04836       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
04837 };
04838 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04839     typename T6, typename T7, typename T8, typename T9, typename T10,
04840     typename T11, typename T12, typename T13, typename T14, typename T15,
04841     typename T16, typename T17, typename T18, typename T19, typename T20,
04842     typename T21, typename T22, typename T23, typename T24>
04843 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04844     T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
04845     internal::None, internal::None, internal::None, internal::None,
04846     internal::None, internal::None, internal::None, internal::None,
04847     internal::None, internal::None, internal::None, internal::None,
04848     internal::None, internal::None, internal::None, internal::None,
04849     internal::None, internal::None, internal::None, internal::None,
04850     internal::None, internal::None, internal::None, internal::None,
04851     internal::None> {
04852   typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04853       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
04854 };
04855 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04856     typename T6, typename T7, typename T8, typename T9, typename T10,
04857     typename T11, typename T12, typename T13, typename T14, typename T15,
04858     typename T16, typename T17, typename T18, typename T19, typename T20,
04859     typename T21, typename T22, typename T23, typename T24, typename T25>
04860 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04861     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
04862     internal::None, internal::None, internal::None, internal::None,
04863     internal::None, internal::None, internal::None, internal::None,
04864     internal::None, internal::None, internal::None, internal::None,
04865     internal::None, internal::None, internal::None, internal::None,
04866     internal::None, internal::None, internal::None, internal::None,
04867     internal::None, internal::None, internal::None, internal::None> {
04868   typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04869       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
04870 };
04871 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04872     typename T6, typename T7, typename T8, typename T9, typename T10,
04873     typename T11, typename T12, typename T13, typename T14, typename T15,
04874     typename T16, typename T17, typename T18, typename T19, typename T20,
04875     typename T21, typename T22, typename T23, typename T24, typename T25,
04876     typename T26>
04877 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04878     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
04879     internal::None, internal::None, internal::None, internal::None,
04880     internal::None, internal::None, internal::None, internal::None,
04881     internal::None, internal::None, internal::None, internal::None,
04882     internal::None, internal::None, internal::None, internal::None,
04883     internal::None, internal::None, internal::None, internal::None,
04884     internal::None, internal::None, internal::None> {
04885   typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04886       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
04887       T26> type;
04888 };
04889 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04890     typename T6, typename T7, typename T8, typename T9, typename T10,
04891     typename T11, typename T12, typename T13, typename T14, typename T15,
04892     typename T16, typename T17, typename T18, typename T19, typename T20,
04893     typename T21, typename T22, typename T23, typename T24, typename T25,
04894     typename T26, typename T27>
04895 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04896     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
04897     internal::None, internal::None, internal::None, internal::None,
04898     internal::None, internal::None, internal::None, internal::None,
04899     internal::None, internal::None, internal::None, internal::None,
04900     internal::None, internal::None, internal::None, internal::None,
04901     internal::None, internal::None, internal::None, internal::None,
04902     internal::None, internal::None> {
04903   typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04904       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04905       T27> type;
04906 };
04907 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04908     typename T6, typename T7, typename T8, typename T9, typename T10,
04909     typename T11, typename T12, typename T13, typename T14, typename T15,
04910     typename T16, typename T17, typename T18, typename T19, typename T20,
04911     typename T21, typename T22, typename T23, typename T24, typename T25,
04912     typename T26, typename T27, typename T28>
04913 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04914     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
04915     internal::None, internal::None, internal::None, internal::None,
04916     internal::None, internal::None, internal::None, internal::None,
04917     internal::None, internal::None, internal::None, internal::None,
04918     internal::None, internal::None, internal::None, internal::None,
04919     internal::None, internal::None, internal::None, internal::None,
04920     internal::None, internal::None> {
04921   typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04922       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04923       T27, T28> type;
04924 };
04925 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04926     typename T6, typename T7, typename T8, typename T9, typename T10,
04927     typename T11, typename T12, typename T13, typename T14, typename T15,
04928     typename T16, typename T17, typename T18, typename T19, typename T20,
04929     typename T21, typename T22, typename T23, typename T24, typename T25,
04930     typename T26, typename T27, typename T28, typename T29>
04931 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04932     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04933     internal::None, internal::None, internal::None, internal::None,
04934     internal::None, internal::None, internal::None, internal::None,
04935     internal::None, internal::None, internal::None, internal::None,
04936     internal::None, internal::None, internal::None, internal::None,
04937     internal::None, internal::None, internal::None, internal::None,
04938     internal::None> {
04939   typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04940       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04941       T27, T28, T29> type;
04942 };
04943 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04944     typename T6, typename T7, typename T8, typename T9, typename T10,
04945     typename T11, typename T12, typename T13, typename T14, typename T15,
04946     typename T16, typename T17, typename T18, typename T19, typename T20,
04947     typename T21, typename T22, typename T23, typename T24, typename T25,
04948     typename T26, typename T27, typename T28, typename T29, typename T30>
04949 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04950     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04951     internal::None, internal::None, internal::None, internal::None,
04952     internal::None, internal::None, internal::None, internal::None,
04953     internal::None, internal::None, internal::None, internal::None,
04954     internal::None, internal::None, internal::None, internal::None,
04955     internal::None, internal::None, internal::None, internal::None> {
04956   typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04957       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04958       T27, T28, T29, T30> type;
04959 };
04960 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04961     typename T6, typename T7, typename T8, typename T9, typename T10,
04962     typename T11, typename T12, typename T13, typename T14, typename T15,
04963     typename T16, typename T17, typename T18, typename T19, typename T20,
04964     typename T21, typename T22, typename T23, typename T24, typename T25,
04965     typename T26, typename T27, typename T28, typename T29, typename T30,
04966     typename T31>
04967 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04968     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04969     T31, internal::None, internal::None, internal::None, internal::None,
04970     internal::None, internal::None, internal::None, internal::None,
04971     internal::None, internal::None, internal::None, internal::None,
04972     internal::None, internal::None, internal::None, internal::None,
04973     internal::None, internal::None, internal::None> {
04974   typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04975       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04976       T27, T28, T29, T30, T31> type;
04977 };
04978 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04979     typename T6, typename T7, typename T8, typename T9, typename T10,
04980     typename T11, typename T12, typename T13, typename T14, typename T15,
04981     typename T16, typename T17, typename T18, typename T19, typename T20,
04982     typename T21, typename T22, typename T23, typename T24, typename T25,
04983     typename T26, typename T27, typename T28, typename T29, typename T30,
04984     typename T31, typename T32>
04985 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04986     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04987     T31, T32, internal::None, internal::None, internal::None, internal::None,
04988     internal::None, internal::None, internal::None, internal::None,
04989     internal::None, internal::None, internal::None, internal::None,
04990     internal::None, internal::None, internal::None, internal::None,
04991     internal::None, internal::None> {
04992   typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04993       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04994       T27, T28, T29, T30, T31, T32> type;
04995 };
04996 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04997     typename T6, typename T7, typename T8, typename T9, typename T10,
04998     typename T11, typename T12, typename T13, typename T14, typename T15,
04999     typename T16, typename T17, typename T18, typename T19, typename T20,
05000     typename T21, typename T22, typename T23, typename T24, typename T25,
05001     typename T26, typename T27, typename T28, typename T29, typename T30,
05002     typename T31, typename T32, typename T33>
05003 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05004     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05005     T31, T32, T33, internal::None, internal::None, internal::None,
05006     internal::None, internal::None, internal::None, internal::None,
05007     internal::None, internal::None, internal::None, internal::None,
05008     internal::None, internal::None, internal::None, internal::None,
05009     internal::None, internal::None> {
05010   typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05011       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05012       T27, T28, T29, T30, T31, T32, T33> type;
05013 };
05014 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05015     typename T6, typename T7, typename T8, typename T9, typename T10,
05016     typename T11, typename T12, typename T13, typename T14, typename T15,
05017     typename T16, typename T17, typename T18, typename T19, typename T20,
05018     typename T21, typename T22, typename T23, typename T24, typename T25,
05019     typename T26, typename T27, typename T28, typename T29, typename T30,
05020     typename T31, typename T32, typename T33, typename T34>
05021 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05022     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05023     T31, T32, T33, T34, internal::None, internal::None, internal::None,
05024     internal::None, internal::None, internal::None, internal::None,
05025     internal::None, internal::None, internal::None, internal::None,
05026     internal::None, internal::None, internal::None, internal::None,
05027     internal::None> {
05028   typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05029       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05030       T27, T28, T29, T30, T31, T32, T33, T34> type;
05031 };
05032 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05033     typename T6, typename T7, typename T8, typename T9, typename T10,
05034     typename T11, typename T12, typename T13, typename T14, typename T15,
05035     typename T16, typename T17, typename T18, typename T19, typename T20,
05036     typename T21, typename T22, typename T23, typename T24, typename T25,
05037     typename T26, typename T27, typename T28, typename T29, typename T30,
05038     typename T31, typename T32, typename T33, typename T34, typename T35>
05039 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05040     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05041     T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
05042     internal::None, internal::None, internal::None, internal::None,
05043     internal::None, internal::None, internal::None, internal::None,
05044     internal::None, internal::None, internal::None, internal::None> {
05045   typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05046       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05047       T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
05048 };
05049 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05050     typename T6, typename T7, typename T8, typename T9, typename T10,
05051     typename T11, typename T12, typename T13, typename T14, typename T15,
05052     typename T16, typename T17, typename T18, typename T19, typename T20,
05053     typename T21, typename T22, typename T23, typename T24, typename T25,
05054     typename T26, typename T27, typename T28, typename T29, typename T30,
05055     typename T31, typename T32, typename T33, typename T34, typename T35,
05056     typename T36>
05057 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05058     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05059     T31, T32, T33, T34, T35, T36, internal::None, internal::None,
05060     internal::None, internal::None, internal::None, internal::None,
05061     internal::None, internal::None, internal::None, internal::None,
05062     internal::None, internal::None, internal::None, internal::None> {
05063   typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05064       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05065       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
05066 };
05067 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05068     typename T6, typename T7, typename T8, typename T9, typename T10,
05069     typename T11, typename T12, typename T13, typename T14, typename T15,
05070     typename T16, typename T17, typename T18, typename T19, typename T20,
05071     typename T21, typename T22, typename T23, typename T24, typename T25,
05072     typename T26, typename T27, typename T28, typename T29, typename T30,
05073     typename T31, typename T32, typename T33, typename T34, typename T35,
05074     typename T36, typename T37>
05075 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05076     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05077     T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
05078     internal::None, internal::None, internal::None, internal::None,
05079     internal::None, internal::None, internal::None, internal::None,
05080     internal::None, internal::None, internal::None> {
05081   typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05082       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05083       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
05084 };
05085 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05086     typename T6, typename T7, typename T8, typename T9, typename T10,
05087     typename T11, typename T12, typename T13, typename T14, typename T15,
05088     typename T16, typename T17, typename T18, typename T19, typename T20,
05089     typename T21, typename T22, typename T23, typename T24, typename T25,
05090     typename T26, typename T27, typename T28, typename T29, typename T30,
05091     typename T31, typename T32, typename T33, typename T34, typename T35,
05092     typename T36, typename T37, typename T38>
05093 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05094     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05095     T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
05096     internal::None, internal::None, internal::None, internal::None,
05097     internal::None, internal::None, internal::None, internal::None,
05098     internal::None, internal::None> {
05099   typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05100       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05101       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
05102 };
05103 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05104     typename T6, typename T7, typename T8, typename T9, typename T10,
05105     typename T11, typename T12, typename T13, typename T14, typename T15,
05106     typename T16, typename T17, typename T18, typename T19, typename T20,
05107     typename T21, typename T22, typename T23, typename T24, typename T25,
05108     typename T26, typename T27, typename T28, typename T29, typename T30,
05109     typename T31, typename T32, typename T33, typename T34, typename T35,
05110     typename T36, typename T37, typename T38, typename T39>
05111 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05112     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05113     T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
05114     internal::None, internal::None, internal::None, internal::None,
05115     internal::None, internal::None, internal::None, internal::None,
05116     internal::None, internal::None> {
05117   typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05118       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05119       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
05120 };
05121 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05122     typename T6, typename T7, typename T8, typename T9, typename T10,
05123     typename T11, typename T12, typename T13, typename T14, typename T15,
05124     typename T16, typename T17, typename T18, typename T19, typename T20,
05125     typename T21, typename T22, typename T23, typename T24, typename T25,
05126     typename T26, typename T27, typename T28, typename T29, typename T30,
05127     typename T31, typename T32, typename T33, typename T34, typename T35,
05128     typename T36, typename T37, typename T38, typename T39, typename T40>
05129 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05130     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05131     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
05132     internal::None, internal::None, internal::None, internal::None,
05133     internal::None, internal::None, internal::None, internal::None,
05134     internal::None> {
05135   typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05136       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05137       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
05138       T40> type;
05139 };
05140 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05141     typename T6, typename T7, typename T8, typename T9, typename T10,
05142     typename T11, typename T12, typename T13, typename T14, typename T15,
05143     typename T16, typename T17, typename T18, typename T19, typename T20,
05144     typename T21, typename T22, typename T23, typename T24, typename T25,
05145     typename T26, typename T27, typename T28, typename T29, typename T30,
05146     typename T31, typename T32, typename T33, typename T34, typename T35,
05147     typename T36, typename T37, typename T38, typename T39, typename T40,
05148     typename T41>
05149 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05150     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05151     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
05152     internal::None, internal::None, internal::None, internal::None,
05153     internal::None, internal::None, internal::None, internal::None> {
05154   typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05155       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05156       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05157       T41> type;
05158 };
05159 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05160     typename T6, typename T7, typename T8, typename T9, typename T10,
05161     typename T11, typename T12, typename T13, typename T14, typename T15,
05162     typename T16, typename T17, typename T18, typename T19, typename T20,
05163     typename T21, typename T22, typename T23, typename T24, typename T25,
05164     typename T26, typename T27, typename T28, typename T29, typename T30,
05165     typename T31, typename T32, typename T33, typename T34, typename T35,
05166     typename T36, typename T37, typename T38, typename T39, typename T40,
05167     typename T41, typename T42>
05168 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05169     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05170     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
05171     internal::None, internal::None, internal::None, internal::None,
05172     internal::None, internal::None, internal::None> {
05173   typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05174       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05175       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05176       T41, T42> type;
05177 };
05178 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05179     typename T6, typename T7, typename T8, typename T9, typename T10,
05180     typename T11, typename T12, typename T13, typename T14, typename T15,
05181     typename T16, typename T17, typename T18, typename T19, typename T20,
05182     typename T21, typename T22, typename T23, typename T24, typename T25,
05183     typename T26, typename T27, typename T28, typename T29, typename T30,
05184     typename T31, typename T32, typename T33, typename T34, typename T35,
05185     typename T36, typename T37, typename T38, typename T39, typename T40,
05186     typename T41, typename T42, typename T43>
05187 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05188     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05189     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
05190     internal::None, internal::None, internal::None, internal::None,
05191     internal::None, internal::None, internal::None> {
05192   typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05193       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05194       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05195       T41, T42, T43> type;
05196 };
05197 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05198     typename T6, typename T7, typename T8, typename T9, typename T10,
05199     typename T11, typename T12, typename T13, typename T14, typename T15,
05200     typename T16, typename T17, typename T18, typename T19, typename T20,
05201     typename T21, typename T22, typename T23, typename T24, typename T25,
05202     typename T26, typename T27, typename T28, typename T29, typename T30,
05203     typename T31, typename T32, typename T33, typename T34, typename T35,
05204     typename T36, typename T37, typename T38, typename T39, typename T40,
05205     typename T41, typename T42, typename T43, typename T44>
05206 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05207     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05208     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
05209     internal::None, internal::None, internal::None, internal::None,
05210     internal::None, internal::None> {
05211   typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05212       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05213       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05214       T41, T42, T43, T44> type;
05215 };
05216 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05217     typename T6, typename T7, typename T8, typename T9, typename T10,
05218     typename T11, typename T12, typename T13, typename T14, typename T15,
05219     typename T16, typename T17, typename T18, typename T19, typename T20,
05220     typename T21, typename T22, typename T23, typename T24, typename T25,
05221     typename T26, typename T27, typename T28, typename T29, typename T30,
05222     typename T31, typename T32, typename T33, typename T34, typename T35,
05223     typename T36, typename T37, typename T38, typename T39, typename T40,
05224     typename T41, typename T42, typename T43, typename T44, typename T45>
05225 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05226     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05227     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05228     internal::None, internal::None, internal::None, internal::None,
05229     internal::None> {
05230   typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05231       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05232       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05233       T41, T42, T43, T44, T45> type;
05234 };
05235 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05236     typename T6, typename T7, typename T8, typename T9, typename T10,
05237     typename T11, typename T12, typename T13, typename T14, typename T15,
05238     typename T16, typename T17, typename T18, typename T19, typename T20,
05239     typename T21, typename T22, typename T23, typename T24, typename T25,
05240     typename T26, typename T27, typename T28, typename T29, typename T30,
05241     typename T31, typename T32, typename T33, typename T34, typename T35,
05242     typename T36, typename T37, typename T38, typename T39, typename T40,
05243     typename T41, typename T42, typename T43, typename T44, typename T45,
05244     typename T46>
05245 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05246     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05247     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05248     T46, internal::None, internal::None, internal::None, internal::None> {
05249   typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05250       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05251       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05252       T41, T42, T43, T44, T45, T46> type;
05253 };
05254 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05255     typename T6, typename T7, typename T8, typename T9, typename T10,
05256     typename T11, typename T12, typename T13, typename T14, typename T15,
05257     typename T16, typename T17, typename T18, typename T19, typename T20,
05258     typename T21, typename T22, typename T23, typename T24, typename T25,
05259     typename T26, typename T27, typename T28, typename T29, typename T30,
05260     typename T31, typename T32, typename T33, typename T34, typename T35,
05261     typename T36, typename T37, typename T38, typename T39, typename T40,
05262     typename T41, typename T42, typename T43, typename T44, typename T45,
05263     typename T46, typename T47>
05264 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05265     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05266     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05267     T46, T47, internal::None, internal::None, internal::None> {
05268   typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05269       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05270       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05271       T41, T42, T43, T44, T45, T46, T47> type;
05272 };
05273 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05274     typename T6, typename T7, typename T8, typename T9, typename T10,
05275     typename T11, typename T12, typename T13, typename T14, typename T15,
05276     typename T16, typename T17, typename T18, typename T19, typename T20,
05277     typename T21, typename T22, typename T23, typename T24, typename T25,
05278     typename T26, typename T27, typename T28, typename T29, typename T30,
05279     typename T31, typename T32, typename T33, typename T34, typename T35,
05280     typename T36, typename T37, typename T38, typename T39, typename T40,
05281     typename T41, typename T42, typename T43, typename T44, typename T45,
05282     typename T46, typename T47, typename T48>
05283 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05284     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05285     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05286     T46, T47, T48, internal::None, internal::None> {
05287   typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05288       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05289       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05290       T41, T42, T43, T44, T45, T46, T47, T48> type;
05291 };
05292 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05293     typename T6, typename T7, typename T8, typename T9, typename T10,
05294     typename T11, typename T12, typename T13, typename T14, typename T15,
05295     typename T16, typename T17, typename T18, typename T19, typename T20,
05296     typename T21, typename T22, typename T23, typename T24, typename T25,
05297     typename T26, typename T27, typename T28, typename T29, typename T30,
05298     typename T31, typename T32, typename T33, typename T34, typename T35,
05299     typename T36, typename T37, typename T38, typename T39, typename T40,
05300     typename T41, typename T42, typename T43, typename T44, typename T45,
05301     typename T46, typename T47, typename T48, typename T49>
05302 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05303     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05304     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05305     T46, T47, T48, T49, internal::None> {
05306   typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05307       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05308       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05309       T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
05310 };
05311 
05312 namespace internal {
05313 
05314 # define GTEST_TEMPLATE_ template <typename T> class
05315 
05316 // The template "selector" struct TemplateSel<Tmpl> is used to
05317 // represent Tmpl, which must be a class template with one type
05318 // parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
05319 // as the type Tmpl<T>.  This allows us to actually instantiate the
05320 // template "selected" by TemplateSel<Tmpl>.
05321 //
05322 // This trick is necessary for simulating typedef for class templates,
05323 // which C++ doesn't support directly.
05324 template <GTEST_TEMPLATE_ Tmpl>
05325 struct TemplateSel {
05326   template <typename T>
05327   struct Bind {
05328     typedef Tmpl<T> type;
05329   };
05330 };
05331 
05332 # define GTEST_BIND_(TmplSel, T) \
05333   TmplSel::template Bind<T>::type
05334 
05335 // A unique struct template used as the default value for the
05336 // arguments of class template Templates.  This allows us to simulate
05337 // variadic templates (e.g. Templates<int>, Templates<int, double>,
05338 // and etc), which C++ doesn't support directly.
05339 template <typename T>
05340 struct NoneT {};
05341 
05342 // The following family of struct and struct templates are used to
05343 // represent template lists.  In particular, TemplatesN<T1, T2, ...,
05344 // TN> represents a list of N templates (T1, T2, ..., and TN).  Except
05345 // for Templates0, every struct in the family has two member types:
05346 // Head for the selector of the first template in the list, and Tail
05347 // for the rest of the list.
05348 
05349 // The empty template list.
05350 struct Templates0 {};
05351 
05352 // Template lists of length 1, 2, 3, and so on.
05353 
05354 template <GTEST_TEMPLATE_ T1>
05355 struct Templates1 {
05356   typedef TemplateSel<T1> Head;
05357   typedef Templates0 Tail;
05358 };
05359 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
05360 struct Templates2 {
05361   typedef TemplateSel<T1> Head;
05362   typedef Templates1<T2> Tail;
05363 };
05364 
05365 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
05366 struct Templates3 {
05367   typedef TemplateSel<T1> Head;
05368   typedef Templates2<T2, T3> Tail;
05369 };
05370 
05371 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05372     GTEST_TEMPLATE_ T4>
05373 struct Templates4 {
05374   typedef TemplateSel<T1> Head;
05375   typedef Templates3<T2, T3, T4> Tail;
05376 };
05377 
05378 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05379     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
05380 struct Templates5 {
05381   typedef TemplateSel<T1> Head;
05382   typedef Templates4<T2, T3, T4, T5> Tail;
05383 };
05384 
05385 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05386     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
05387 struct Templates6 {
05388   typedef TemplateSel<T1> Head;
05389   typedef Templates5<T2, T3, T4, T5, T6> Tail;
05390 };
05391 
05392 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05393     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05394     GTEST_TEMPLATE_ T7>
05395 struct Templates7 {
05396   typedef TemplateSel<T1> Head;
05397   typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
05398 };
05399 
05400 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05401     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05402     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
05403 struct Templates8 {
05404   typedef TemplateSel<T1> Head;
05405   typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
05406 };
05407 
05408 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05409     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05410     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
05411 struct Templates9 {
05412   typedef TemplateSel<T1> Head;
05413   typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
05414 };
05415 
05416 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05417     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05418     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05419     GTEST_TEMPLATE_ T10>
05420 struct Templates10 {
05421   typedef TemplateSel<T1> Head;
05422   typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
05423 };
05424 
05425 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05426     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05427     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05428     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
05429 struct Templates11 {
05430   typedef TemplateSel<T1> Head;
05431   typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
05432 };
05433 
05434 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05435     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05436     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05437     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
05438 struct Templates12 {
05439   typedef TemplateSel<T1> Head;
05440   typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
05441 };
05442 
05443 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05444     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05445     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05446     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05447     GTEST_TEMPLATE_ T13>
05448 struct Templates13 {
05449   typedef TemplateSel<T1> Head;
05450   typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
05451 };
05452 
05453 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05454     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05455     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05456     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05457     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
05458 struct Templates14 {
05459   typedef TemplateSel<T1> Head;
05460   typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
05461       T14> Tail;
05462 };
05463 
05464 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05465     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05466     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05467     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05468     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
05469 struct Templates15 {
05470   typedef TemplateSel<T1> Head;
05471   typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05472       T15> Tail;
05473 };
05474 
05475 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05476     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05477     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05478     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05479     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05480     GTEST_TEMPLATE_ T16>
05481 struct Templates16 {
05482   typedef TemplateSel<T1> Head;
05483   typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05484       T15, T16> Tail;
05485 };
05486 
05487 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05488     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05489     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05490     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05491     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05492     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
05493 struct Templates17 {
05494   typedef TemplateSel<T1> Head;
05495   typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05496       T15, T16, T17> Tail;
05497 };
05498 
05499 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05500     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05501     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05502     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05503     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05504     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
05505 struct Templates18 {
05506   typedef TemplateSel<T1> Head;
05507   typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05508       T15, T16, T17, T18> Tail;
05509 };
05510 
05511 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05512     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05513     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05514     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05515     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05516     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05517     GTEST_TEMPLATE_ T19>
05518 struct Templates19 {
05519   typedef TemplateSel<T1> Head;
05520   typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05521       T15, T16, T17, T18, T19> Tail;
05522 };
05523 
05524 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05525     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05526     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05527     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05528     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05529     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05530     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
05531 struct Templates20 {
05532   typedef TemplateSel<T1> Head;
05533   typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05534       T15, T16, T17, T18, T19, T20> Tail;
05535 };
05536 
05537 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05538     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05539     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05540     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05541     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05542     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05543     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
05544 struct Templates21 {
05545   typedef TemplateSel<T1> Head;
05546   typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05547       T15, T16, T17, T18, T19, T20, T21> Tail;
05548 };
05549 
05550 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05551     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05552     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05553     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05554     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05555     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05556     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05557     GTEST_TEMPLATE_ T22>
05558 struct Templates22 {
05559   typedef TemplateSel<T1> Head;
05560   typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05561       T15, T16, T17, T18, T19, T20, T21, T22> Tail;
05562 };
05563 
05564 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05565     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05566     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05567     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05568     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05569     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05570     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05571     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
05572 struct Templates23 {
05573   typedef TemplateSel<T1> Head;
05574   typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05575       T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
05576 };
05577 
05578 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05579     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05580     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05581     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05582     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05583     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05584     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05585     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
05586 struct Templates24 {
05587   typedef TemplateSel<T1> Head;
05588   typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05589       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
05590 };
05591 
05592 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05593     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05594     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05595     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05596     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05597     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05598     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05599     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05600     GTEST_TEMPLATE_ T25>
05601 struct Templates25 {
05602   typedef TemplateSel<T1> Head;
05603   typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05604       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
05605 };
05606 
05607 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05608     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05609     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05610     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05611     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05612     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05613     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05614     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05615     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
05616 struct Templates26 {
05617   typedef TemplateSel<T1> Head;
05618   typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05619       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
05620 };
05621 
05622 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05623     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05624     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05625     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05626     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05627     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05628     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05629     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05630     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
05631 struct Templates27 {
05632   typedef TemplateSel<T1> Head;
05633   typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05634       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
05635 };
05636 
05637 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05638     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05639     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05640     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05641     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05642     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05643     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05644     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05645     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05646     GTEST_TEMPLATE_ T28>
05647 struct Templates28 {
05648   typedef TemplateSel<T1> Head;
05649   typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05650       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
05651       T28> Tail;
05652 };
05653 
05654 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05655     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05656     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05657     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05658     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05659     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05660     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05661     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05662     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05663     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
05664 struct Templates29 {
05665   typedef TemplateSel<T1> Head;
05666   typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05667       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05668       T29> Tail;
05669 };
05670 
05671 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05672     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05673     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05674     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05675     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05676     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05677     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05678     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05679     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05680     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
05681 struct Templates30 {
05682   typedef TemplateSel<T1> Head;
05683   typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05684       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05685       T29, T30> Tail;
05686 };
05687 
05688 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05689     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05690     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05691     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05692     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05693     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05694     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05695     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05696     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05697     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05698     GTEST_TEMPLATE_ T31>
05699 struct Templates31 {
05700   typedef TemplateSel<T1> Head;
05701   typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05702       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05703       T29, T30, T31> Tail;
05704 };
05705 
05706 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05707     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05708     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05709     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05710     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05711     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05712     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05713     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05714     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05715     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05716     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
05717 struct Templates32 {
05718   typedef TemplateSel<T1> Head;
05719   typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05720       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05721       T29, T30, T31, T32> Tail;
05722 };
05723 
05724 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05725     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05726     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05727     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05728     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05729     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05730     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05731     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05732     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05733     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05734     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
05735 struct Templates33 {
05736   typedef TemplateSel<T1> Head;
05737   typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05738       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05739       T29, T30, T31, T32, T33> Tail;
05740 };
05741 
05742 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05743     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05744     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05745     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05746     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05747     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05748     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05749     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05750     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05751     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05752     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05753     GTEST_TEMPLATE_ T34>
05754 struct Templates34 {
05755   typedef TemplateSel<T1> Head;
05756   typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05757       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05758       T29, T30, T31, T32, T33, T34> Tail;
05759 };
05760 
05761 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05762     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05763     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05764     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05765     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05766     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05767     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05768     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05769     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05770     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05771     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05772     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
05773 struct Templates35 {
05774   typedef TemplateSel<T1> Head;
05775   typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05776       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05777       T29, T30, T31, T32, T33, T34, T35> Tail;
05778 };
05779 
05780 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05781     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05782     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05783     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05784     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05785     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05786     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05787     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05788     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05789     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05790     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05791     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
05792 struct Templates36 {
05793   typedef TemplateSel<T1> Head;
05794   typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05795       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05796       T29, T30, T31, T32, T33, T34, T35, T36> Tail;
05797 };
05798 
05799 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05800     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05801     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05802     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05803     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05804     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05805     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05806     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05807     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05808     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05809     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05810     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05811     GTEST_TEMPLATE_ T37>
05812 struct Templates37 {
05813   typedef TemplateSel<T1> Head;
05814   typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05815       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05816       T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
05817 };
05818 
05819 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05820     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05821     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05822     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05823     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05824     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05825     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05826     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05827     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05828     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05829     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05830     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05831     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
05832 struct Templates38 {
05833   typedef TemplateSel<T1> Head;
05834   typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05835       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05836       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
05837 };
05838 
05839 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05840     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05841     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05842     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05843     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05844     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05845     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05846     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05847     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05848     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05849     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05850     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05851     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
05852 struct Templates39 {
05853   typedef TemplateSel<T1> Head;
05854   typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05855       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05856       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
05857 };
05858 
05859 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05860     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05861     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05862     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05863     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05864     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05865     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05866     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05867     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05868     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05869     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05870     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05871     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05872     GTEST_TEMPLATE_ T40>
05873 struct Templates40 {
05874   typedef TemplateSel<T1> Head;
05875   typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05876       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05877       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
05878 };
05879 
05880 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05881     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05882     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05883     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05884     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05885     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05886     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05887     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05888     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05889     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05890     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05891     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05892     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05893     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
05894 struct Templates41 {
05895   typedef TemplateSel<T1> Head;
05896   typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05897       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05898       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
05899 };
05900 
05901 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05902     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05903     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05904     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05905     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05906     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05907     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05908     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05909     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05910     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05911     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05912     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05913     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05914     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
05915 struct Templates42 {
05916   typedef TemplateSel<T1> Head;
05917   typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05918       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05919       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
05920       T42> Tail;
05921 };
05922 
05923 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05924     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05925     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05926     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05927     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05928     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05929     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05930     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05931     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05932     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05933     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05934     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05935     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05936     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05937     GTEST_TEMPLATE_ T43>
05938 struct Templates43 {
05939   typedef TemplateSel<T1> Head;
05940   typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05941       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05942       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05943       T43> Tail;
05944 };
05945 
05946 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05947     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05948     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05949     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05950     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05951     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05952     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05953     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05954     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05955     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05956     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05957     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05958     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05959     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05960     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
05961 struct Templates44 {
05962   typedef TemplateSel<T1> Head;
05963   typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05964       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05965       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05966       T43, T44> Tail;
05967 };
05968 
05969 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05970     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05971     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05972     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05973     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05974     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05975     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05976     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05977     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05978     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05979     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05980     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05981     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05982     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05983     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
05984 struct Templates45 {
05985   typedef TemplateSel<T1> Head;
05986   typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05987       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05988       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05989       T43, T44, T45> Tail;
05990 };
05991 
05992 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05993     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05994     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05995     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05996     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05997     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05998     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05999     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06000     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06001     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06002     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06003     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06004     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06005     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06006     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06007     GTEST_TEMPLATE_ T46>
06008 struct Templates46 {
06009   typedef TemplateSel<T1> Head;
06010   typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06011       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06012       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06013       T43, T44, T45, T46> Tail;
06014 };
06015 
06016 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06017     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06018     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06019     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06020     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06021     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06022     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06023     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06024     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06025     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06026     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06027     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06028     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06029     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06030     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06031     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
06032 struct Templates47 {
06033   typedef TemplateSel<T1> Head;
06034   typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06035       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06036       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06037       T43, T44, T45, T46, T47> Tail;
06038 };
06039 
06040 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06041     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06042     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06043     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06044     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06045     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06046     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06047     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06048     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06049     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06050     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06051     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06052     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06053     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06054     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06055     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
06056 struct Templates48 {
06057   typedef TemplateSel<T1> Head;
06058   typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06059       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06060       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06061       T43, T44, T45, T46, T47, T48> Tail;
06062 };
06063 
06064 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06065     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06066     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06067     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06068     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06069     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06070     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06071     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06072     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06073     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06074     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06075     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06076     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06077     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06078     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06079     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06080     GTEST_TEMPLATE_ T49>
06081 struct Templates49 {
06082   typedef TemplateSel<T1> Head;
06083   typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06084       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06085       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06086       T43, T44, T45, T46, T47, T48, T49> Tail;
06087 };
06088 
06089 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06090     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06091     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06092     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06093     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06094     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06095     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06096     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06097     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06098     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06099     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06100     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06101     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06102     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06103     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06104     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06105     GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
06106 struct Templates50 {
06107   typedef TemplateSel<T1> Head;
06108   typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06109       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06110       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06111       T43, T44, T45, T46, T47, T48, T49, T50> Tail;
06112 };
06113 
06114 
06115 // We don't want to require the users to write TemplatesN<...> directly,
06116 // as that would require them to count the length.  Templates<...> is much
06117 // easier to write, but generates horrible messages when there is a
06118 // compiler error, as gcc insists on printing out each template
06119 // argument, even if it has the default value (this means Templates<list>
06120 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
06121 // errors).
06122 //
06123 // Our solution is to combine the best part of the two approaches: a
06124 // user would write Templates<T1, ..., TN>, and Google Test will translate
06125 // that to TemplatesN<T1, ..., TN> internally to make error messages
06126 // readable.  The translation is done by the 'type' member of the
06127 // Templates template.
06128 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
06129     GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
06130     GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
06131     GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
06132     GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
06133     GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
06134     GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
06135     GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
06136     GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
06137     GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
06138     GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
06139     GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
06140     GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
06141     GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
06142     GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
06143     GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
06144     GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
06145     GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
06146     GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
06147     GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
06148     GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
06149     GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
06150     GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
06151     GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
06152     GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
06153 struct Templates {
06154   typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06155       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06156       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06157       T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
06158 };
06159 
06160 template <>
06161 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06162     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06163     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06164     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06165     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06166     NoneT> {
06167   typedef Templates0 type;
06168 };
06169 template <GTEST_TEMPLATE_ T1>
06170 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06171     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06172     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06173     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06174     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06175     NoneT> {
06176   typedef Templates1<T1> type;
06177 };
06178 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
06179 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06180     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06181     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06182     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06183     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06184     NoneT> {
06185   typedef Templates2<T1, T2> type;
06186 };
06187 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
06188 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06189     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06190     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06191     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06192     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06193   typedef Templates3<T1, T2, T3> type;
06194 };
06195 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06196     GTEST_TEMPLATE_ T4>
06197 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06198     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06199     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06200     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06201     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06202   typedef Templates4<T1, T2, T3, T4> type;
06203 };
06204 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06205     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
06206 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06207     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06208     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06209     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06210     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06211   typedef Templates5<T1, T2, T3, T4, T5> type;
06212 };
06213 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06214     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
06215 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
06216     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06217     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06218     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06219     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06220   typedef Templates6<T1, T2, T3, T4, T5, T6> type;
06221 };
06222 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06223     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06224     GTEST_TEMPLATE_ T7>
06225 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
06226     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06227     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06228     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06229     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06230   typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
06231 };
06232 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06233     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06234     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
06235 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
06236     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06237     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06238     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06239     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06240   typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
06241 };
06242 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06243     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06244     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
06245 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
06246     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06247     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06248     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06249     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06250   typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
06251 };
06252 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06253     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06254     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06255     GTEST_TEMPLATE_ T10>
06256 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
06257     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06258     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06259     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06260     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06261   typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
06262 };
06263 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06264     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06265     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06266     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
06267 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
06268     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06269     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06270     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06271     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06272   typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
06273 };
06274 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06275     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06276     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06277     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
06278 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
06279     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06280     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06281     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06282     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06283   typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
06284 };
06285 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06286     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06287     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06288     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06289     GTEST_TEMPLATE_ T13>
06290 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
06291     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06292     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06293     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06294     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06295   typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
06296       T13> type;
06297 };
06298 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06299     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06300     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06301     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06302     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
06303 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06304     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06305     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06306     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06307     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06308   typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06309       T14> type;
06310 };
06311 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06312     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06313     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06314     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06315     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
06316 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06317     T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06318     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06319     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06320     NoneT, NoneT, NoneT, NoneT, NoneT> {
06321   typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06322       T14, T15> type;
06323 };
06324 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06325     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06326     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06327     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06328     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06329     GTEST_TEMPLATE_ T16>
06330 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06331     T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06332     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06333     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06334     NoneT, NoneT, NoneT, NoneT, NoneT> {
06335   typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06336       T14, T15, T16> type;
06337 };
06338 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06339     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06340     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06341     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06342     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06343     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
06344 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06345     T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06346     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06347     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06348     NoneT, NoneT, NoneT, NoneT, NoneT> {
06349   typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06350       T14, T15, T16, T17> type;
06351 };
06352 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06353     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06354     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06355     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06356     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06357     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
06358 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06359     T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06360     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06361     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06362     NoneT, NoneT, NoneT, NoneT> {
06363   typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06364       T14, T15, T16, T17, T18> type;
06365 };
06366 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06367     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06368     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06369     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06370     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06371     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06372     GTEST_TEMPLATE_ T19>
06373 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06374     T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06375     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06376     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06377     NoneT, NoneT, NoneT, NoneT> {
06378   typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06379       T14, T15, T16, T17, T18, T19> type;
06380 };
06381 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06382     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06383     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06384     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06385     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06386     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06387     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
06388 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06389     T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06390     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06391     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06392     NoneT, NoneT, NoneT, NoneT> {
06393   typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06394       T14, T15, T16, T17, T18, T19, T20> type;
06395 };
06396 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06397     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06398     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06399     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06400     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06401     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06402     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
06403 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06404     T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
06405     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06406     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06407     NoneT, NoneT, NoneT, NoneT> {
06408   typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06409       T14, T15, T16, T17, T18, T19, T20, T21> type;
06410 };
06411 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06412     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06413     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06414     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06415     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06416     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06417     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06418     GTEST_TEMPLATE_ T22>
06419 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06420     T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
06421     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06422     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06423     NoneT, NoneT, NoneT> {
06424   typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06425       T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
06426 };
06427 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06428     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06429     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06430     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06431     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06432     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06433     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06434     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
06435 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06436     T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
06437     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06438     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06439     NoneT, NoneT, NoneT> {
06440   typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06441       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
06442 };
06443 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06444     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06445     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06446     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06447     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06448     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06449     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06450     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
06451 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06452     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
06453     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06454     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06455     NoneT, NoneT, NoneT> {
06456   typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06457       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
06458 };
06459 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06460     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06461     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06462     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06463     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06464     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06465     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06466     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06467     GTEST_TEMPLATE_ T25>
06468 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06469     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
06470     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06471     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06472     NoneT, NoneT> {
06473   typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06474       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
06475 };
06476 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06477     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06478     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06479     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06480     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06481     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06482     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06483     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06484     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
06485 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06486     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
06487     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06488     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06489     NoneT, NoneT> {
06490   typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06491       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
06492 };
06493 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06494     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06495     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06496     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06497     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06498     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06499     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06500     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06501     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
06502 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06503     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
06504     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06505     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06506     NoneT, NoneT> {
06507   typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06508       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
06509       T27> type;
06510 };
06511 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06512     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06513     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06514     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06515     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06516     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06517     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06518     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06519     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06520     GTEST_TEMPLATE_ T28>
06521 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06522     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06523     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06524     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06525     NoneT, NoneT> {
06526   typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06527       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06528       T28> type;
06529 };
06530 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06531     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06532     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06533     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06534     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06535     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06536     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06537     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06538     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06539     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
06540 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06541     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06542     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06543     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06544     NoneT> {
06545   typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06546       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06547       T28, T29> type;
06548 };
06549 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06550     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06551     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06552     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06553     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06554     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06555     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06556     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06557     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06558     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
06559 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06560     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06561     T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06562     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06563   typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06564       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06565       T28, T29, T30> type;
06566 };
06567 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06568     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06569     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06570     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06571     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06572     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06573     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06574     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06575     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06576     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06577     GTEST_TEMPLATE_ T31>
06578 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06579     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06580     T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06581     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06582   typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06583       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06584       T28, T29, T30, T31> type;
06585 };
06586 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06587     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06588     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06589     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06590     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06591     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06592     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06593     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06594     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06595     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06596     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
06597 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06598     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06599     T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06600     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06601   typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06602       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06603       T28, T29, T30, T31, T32> type;
06604 };
06605 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06606     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06607     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06608     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06609     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06610     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06611     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06612     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06613     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06614     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06615     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
06616 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06617     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06618     T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06619     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06620   typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06621       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06622       T28, T29, T30, T31, T32, T33> type;
06623 };
06624 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06625     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06626     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06627     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06628     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06629     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06630     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06631     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06632     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06633     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06634     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06635     GTEST_TEMPLATE_ T34>
06636 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06637     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06638     T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06639     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06640   typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06641       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06642       T28, T29, T30, T31, T32, T33, T34> type;
06643 };
06644 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06645     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06646     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06647     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06648     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06649     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06650     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06651     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06652     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06653     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06654     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06655     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
06656 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06657     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06658     T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06659     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06660   typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06661       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06662       T28, T29, T30, T31, T32, T33, T34, T35> type;
06663 };
06664 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06665     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06666     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06667     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06668     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06669     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06670     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06671     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06672     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06673     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06674     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06675     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
06676 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06677     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06678     T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
06679     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06680   typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06681       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06682       T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
06683 };
06684 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06685     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06686     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06687     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06688     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06689     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06690     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06691     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06692     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06693     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06694     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06695     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06696     GTEST_TEMPLATE_ T37>
06697 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06698     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06699     T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
06700     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06701   typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06702       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06703       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
06704 };
06705 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06706     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06707     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06708     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06709     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06710     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06711     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06712     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06713     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06714     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06715     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06716     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06717     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
06718 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06719     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06720     T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
06721     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06722   typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06723       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06724       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
06725 };
06726 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06727     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06728     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06729     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06730     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06731     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06732     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06733     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06734     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06735     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06736     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06737     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06738     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
06739 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06740     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06741     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
06742     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06743   typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06744       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06745       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
06746 };
06747 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06748     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06749     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06750     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06751     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06752     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06753     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06754     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06755     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06756     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06757     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06758     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06759     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06760     GTEST_TEMPLATE_ T40>
06761 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06762     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06763     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
06764     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06765   typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06766       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06767       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
06768 };
06769 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06770     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06771     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06772     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06773     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06774     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06775     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06776     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06777     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06778     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06779     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06780     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06781     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06782     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
06783 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06784     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06785     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
06786     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06787   typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06788       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06789       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
06790       T41> type;
06791 };
06792 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06793     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06794     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06795     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06796     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06797     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06798     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06799     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06800     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06801     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06802     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06803     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06804     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06805     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
06806 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06807     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06808     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
06809     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06810   typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06811       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06812       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06813       T42> type;
06814 };
06815 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06816     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06817     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06818     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06819     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06820     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06821     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06822     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06823     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06824     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06825     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06826     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06827     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06828     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06829     GTEST_TEMPLATE_ T43>
06830 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06831     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06832     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
06833     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06834   typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06835       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06836       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06837       T42, T43> type;
06838 };
06839 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06840     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06841     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06842     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06843     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06844     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06845     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06846     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06847     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06848     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06849     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06850     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06851     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06852     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06853     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
06854 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06855     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06856     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06857     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06858   typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06859       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06860       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06861       T42, T43, T44> type;
06862 };
06863 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06864     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06865     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06866     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06867     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06868     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06869     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06870     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06871     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06872     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06873     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06874     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06875     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06876     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06877     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
06878 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06879     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06880     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06881     T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
06882   typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06883       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06884       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06885       T42, T43, T44, T45> type;
06886 };
06887 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06888     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06889     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06890     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06891     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06892     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06893     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06894     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06895     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06896     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06897     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06898     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06899     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06900     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06901     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06902     GTEST_TEMPLATE_ T46>
06903 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06904     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06905     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06906     T45, T46, NoneT, NoneT, NoneT, NoneT> {
06907   typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06908       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06909       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06910       T42, T43, T44, T45, T46> type;
06911 };
06912 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06913     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06914     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06915     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06916     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06917     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06918     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06919     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06920     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06921     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06922     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06923     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06924     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06925     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06926     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06927     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
06928 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06929     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06930     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06931     T45, T46, T47, NoneT, NoneT, NoneT> {
06932   typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06933       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06934       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06935       T42, T43, T44, T45, T46, T47> type;
06936 };
06937 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06938     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06939     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06940     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06941     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06942     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06943     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06944     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06945     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06946     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06947     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06948     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06949     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06950     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06951     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06952     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
06953 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06954     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06955     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06956     T45, T46, T47, T48, NoneT, NoneT> {
06957   typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06958       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06959       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06960       T42, T43, T44, T45, T46, T47, T48> type;
06961 };
06962 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06963     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06964     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06965     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06966     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06967     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06968     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06969     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06970     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06971     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06972     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06973     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06974     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06975     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06976     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06977     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06978     GTEST_TEMPLATE_ T49>
06979 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06980     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06981     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06982     T45, T46, T47, T48, T49, NoneT> {
06983   typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06984       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06985       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06986       T42, T43, T44, T45, T46, T47, T48, T49> type;
06987 };
06988 
06989 // The TypeList template makes it possible to use either a single type
06990 // or a Types<...> list in TYPED_TEST_CASE() and
06991 // INSTANTIATE_TYPED_TEST_CASE_P().
06992 
06993 template <typename T>
06994 struct TypeList {
06995   typedef Types1<T> type;
06996 };
06997 
06998 template <typename T1, typename T2, typename T3, typename T4, typename T5,
06999     typename T6, typename T7, typename T8, typename T9, typename T10,
07000     typename T11, typename T12, typename T13, typename T14, typename T15,
07001     typename T16, typename T17, typename T18, typename T19, typename T20,
07002     typename T21, typename T22, typename T23, typename T24, typename T25,
07003     typename T26, typename T27, typename T28, typename T29, typename T30,
07004     typename T31, typename T32, typename T33, typename T34, typename T35,
07005     typename T36, typename T37, typename T38, typename T39, typename T40,
07006     typename T41, typename T42, typename T43, typename T44, typename T45,
07007     typename T46, typename T47, typename T48, typename T49, typename T50>
07008 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
07009     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
07010     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
07011     T44, T45, T46, T47, T48, T49, T50> > {
07012   typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
07013       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
07014       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
07015       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
07016 };
07017 
07018 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07019 
07020 }  // namespace internal
07021 }  // namespace testing
07022 
07023 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
07024 
07025 // Due to C++ preprocessor weirdness, we need double indirection to
07026 // concatenate two tokens when one of them is __LINE__.  Writing
07027 //
07028 //   foo ## __LINE__
07029 //
07030 // will result in the token foo__LINE__, instead of foo followed by
07031 // the current line number.  For more details, see
07032 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
07033 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
07034 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
07035 
07036 class ProtocolMessage;
07037 namespace proto2 { class Message; }
07038 
07039 namespace testing {
07040 
07041 // Forward declarations.
07042 
07043 class AssertionResult;                 // Result of an assertion.
07044 class Message;                         // Represents a failure message.
07045 class Test;                            // Represents a test.
07046 class TestInfo;                        // Information about a test.
07047 class TestPartResult;                  // Result of a test part.
07048 class UnitTest;                        // A collection of test cases.
07049 
07050 template <typename T>
07051 ::std::string PrintToString(const T& value);
07052 
07053 namespace internal {
07054 
07055 struct TraceInfo;                      // Information about a trace point.
07056 class ScopedTrace;                     // Implements scoped trace.
07057 class TestInfoImpl;                    // Opaque implementation of TestInfo
07058 class UnitTestImpl;                    // Opaque implementation of UnitTest
07059 
07060 // How many times InitGoogleTest() has been called.
07061 GTEST_API_ extern int g_init_gtest_count;
07062 
07063 // The text used in failure messages to indicate the start of the
07064 // stack trace.
07065 GTEST_API_ extern const char kStackTraceMarker[];
07066 
07067 // Two overloaded helpers for checking at compile time whether an
07068 // expression is a null pointer literal (i.e. NULL or any 0-valued
07069 // compile-time integral constant).  Their return values have
07070 // different sizes, so we can use sizeof() to test which version is
07071 // picked by the compiler.  These helpers have no implementations, as
07072 // we only need their signatures.
07073 //
07074 // Given IsNullLiteralHelper(x), the compiler will pick the first
07075 // version if x can be implicitly converted to Secret*, and pick the
07076 // second version otherwise.  Since Secret is a secret and incomplete
07077 // type, the only expression a user can write that has type Secret* is
07078 // a null pointer literal.  Therefore, we know that x is a null
07079 // pointer literal if and only if the first version is picked by the
07080 // compiler.
07081 char IsNullLiteralHelper(Secret* p);
07082 char (&IsNullLiteralHelper(...))[2];  // NOLINT
07083 
07084 // A compile-time bool constant that is true if and only if x is a
07085 // null pointer literal (i.e. NULL or any 0-valued compile-time
07086 // integral constant).
07087 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
07088 // We lose support for NULL detection where the compiler doesn't like
07089 // passing non-POD classes through ellipsis (...).
07090 # define GTEST_IS_NULL_LITERAL_(x) false
07091 #else
07092 # define GTEST_IS_NULL_LITERAL_(x) \
07093     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
07094 #endif  // GTEST_ELLIPSIS_NEEDS_POD_
07095 
07096 // Appends the user-supplied message to the Google-Test-generated message.
07097 GTEST_API_ std::string AppendUserMessage(
07098     const std::string& gtest_msg, const Message& user_msg);
07099 
07100 #if GTEST_HAS_EXCEPTIONS
07101 
07102 // This exception is thrown by (and only by) a failed Google Test
07103 // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
07104 // are enabled).  We derive it from std::runtime_error, which is for
07105 // errors presumably detectable only at run time.  Since
07106 // std::runtime_error inherits from std::exception, many testing
07107 // frameworks know how to extract and print the message inside it.
07108 class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
07109  public:
07110   explicit GoogleTestFailureException(const TestPartResult& failure);
07111 };
07112 
07113 #endif  // GTEST_HAS_EXCEPTIONS
07114 
07115 // A helper class for creating scoped traces in user programs.
07116 class GTEST_API_ ScopedTrace {
07117  public:
07118   // The c'tor pushes the given source file location and message onto
07119   // a trace stack maintained by Google Test.
07120   ScopedTrace(const char* file, int line, const Message& message);
07121 
07122   // The d'tor pops the info pushed by the c'tor.
07123   //
07124   // Note that the d'tor is not virtual in order to be efficient.
07125   // Don't inherit from ScopedTrace!
07126   ~ScopedTrace();
07127 
07128  private:
07129   GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
07130 } GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
07131                             // c'tor and d'tor.  Therefore it doesn't
07132                             // need to be used otherwise.
07133 
07134 // Constructs and returns the message for an equality assertion
07135 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
07136 //
07137 // The first four parameters are the expressions used in the assertion
07138 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
07139 // where foo is 5 and bar is 6, we have:
07140 //
07141 //   expected_expression: "foo"
07142 //   actual_expression:   "bar"
07143 //   expected_value:      "5"
07144 //   actual_value:        "6"
07145 //
07146 // The ignoring_case parameter is true iff the assertion is a
07147 // *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
07148 // be inserted into the message.
07149 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
07150                                      const char* actual_expression,
07151                                      const std::string& expected_value,
07152                                      const std::string& actual_value,
07153                                      bool ignoring_case);
07154 
07155 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
07156 GTEST_API_ std::string GetBoolAssertionFailureMessage(
07157     const AssertionResult& assertion_result,
07158     const char* expression_text,
07159     const char* actual_predicate_value,
07160     const char* expected_predicate_value);
07161 
07162 // This template class represents an IEEE floating-point number
07163 // (either single-precision or double-precision, depending on the
07164 // template parameters).
07165 //
07166 // The purpose of this class is to do more sophisticated number
07167 // comparison.  (Due to round-off error, etc, it's very unlikely that
07168 // two floating-points will be equal exactly.  Hence a naive
07169 // comparison by the == operation often doesn't work.)
07170 //
07171 // Format of IEEE floating-point:
07172 //
07173 //   The most-significant bit being the leftmost, an IEEE
07174 //   floating-point looks like
07175 //
07176 //     sign_bit exponent_bits fraction_bits
07177 //
07178 //   Here, sign_bit is a single bit that designates the sign of the
07179 //   number.
07180 //
07181 //   For float, there are 8 exponent bits and 23 fraction bits.
07182 //
07183 //   For double, there are 11 exponent bits and 52 fraction bits.
07184 //
07185 //   More details can be found at
07186 //   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
07187 //
07188 // Template parameter:
07189 //
07190 //   RawType: the raw floating-point type (either float or double)
07191 template <typename RawType>
07192 class FloatingPoint {
07193  public:
07194   // Defines the unsigned integer type that has the same size as the
07195   // floating point number.
07196   typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
07197 
07198   // Constants.
07199 
07200   // # of bits in a number.
07201   static const size_t kBitCount = 8*sizeof(RawType);
07202 
07203   // # of fraction bits in a number.
07204   static const size_t kFractionBitCount =
07205     std::numeric_limits<RawType>::digits - 1;
07206 
07207   // # of exponent bits in a number.
07208   static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
07209 
07210   // The mask for the sign bit.
07211   static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
07212 
07213   // The mask for the fraction bits.
07214   static const Bits kFractionBitMask =
07215     ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
07216 
07217   // The mask for the exponent bits.
07218   static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
07219 
07220   // How many ULP's (Units in the Last Place) we want to tolerate when
07221   // comparing two numbers.  The larger the value, the more error we
07222   // allow.  A 0 value means that two numbers must be exactly the same
07223   // to be considered equal.
07224   //
07225   // The maximum error of a single floating-point operation is 0.5
07226   // units in the last place.  On Intel CPU's, all floating-point
07227   // calculations are done with 80-bit precision, while double has 64
07228   // bits.  Therefore, 4 should be enough for ordinary use.
07229   //
07230   // See the following article for more details on ULP:
07231   // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
07232   static const size_t kMaxUlps = 4;
07233 
07234   // Constructs a FloatingPoint from a raw floating-point number.
07235   //
07236   // On an Intel CPU, passing a non-normalized NAN (Not a Number)
07237   // around may change its bits, although the new value is guaranteed
07238   // to be also a NAN.  Therefore, don't expect this constructor to
07239   // preserve the bits in x when x is a NAN.
07240   explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
07241 
07242   // Static methods
07243 
07244   // Reinterprets a bit pattern as a floating-point number.
07245   //
07246   // This function is needed to test the AlmostEquals() method.
07247   static RawType ReinterpretBits(const Bits bits) {
07248     FloatingPoint fp(0);
07249     fp.u_.bits_ = bits;
07250     return fp.u_.value_;
07251   }
07252 
07253   // Returns the floating-point number that represent positive infinity.
07254   static RawType Infinity() {
07255     return ReinterpretBits(kExponentBitMask);
07256   }
07257 
07258   // Returns the maximum representable finite floating-point number.
07259   static RawType Max();
07260 
07261   // Non-static methods
07262 
07263   // Returns the bits that represents this number.
07264   const Bits &bits() const { return u_.bits_; }
07265 
07266   // Returns the exponent bits of this number.
07267   Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
07268 
07269   // Returns the fraction bits of this number.
07270   Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
07271 
07272   // Returns the sign bit of this number.
07273   Bits sign_bit() const { return kSignBitMask & u_.bits_; }
07274 
07275   // Returns true iff this is NAN (not a number).
07276   bool is_nan() const {
07277     // It's a NAN if the exponent bits are all ones and the fraction
07278     // bits are not entirely zeros.
07279     return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
07280   }
07281 
07282   // Returns true iff this number is at most kMaxUlps ULP's away from
07283   // rhs.  In particular, this function:
07284   //
07285   //   - returns false if either number is (or both are) NAN.
07286   //   - treats really large numbers as almost equal to infinity.
07287   //   - thinks +0.0 and -0.0 are 0 DLP's apart.
07288   bool AlmostEquals(const FloatingPoint& rhs) const {
07289     // The IEEE standard says that any comparison operation involving
07290     // a NAN must return false.
07291     if (is_nan() || rhs.is_nan()) return false;
07292 
07293     return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
07294         <= kMaxUlps;
07295   }
07296 
07297  private:
07298   // The data type used to store the actual floating-point number.
07299   union FloatingPointUnion {
07300     RawType value_;  // The raw floating-point number.
07301     Bits bits_;      // The bits that represent the number.
07302   };
07303 
07304   // Converts an integer from the sign-and-magnitude representation to
07305   // the biased representation.  More precisely, let N be 2 to the
07306   // power of (kBitCount - 1), an integer x is represented by the
07307   // unsigned number x + N.
07308   //
07309   // For instance,
07310   //
07311   //   -N + 1 (the most negative number representable using
07312   //          sign-and-magnitude) is represented by 1;
07313   //   0      is represented by N; and
07314   //   N - 1  (the biggest number representable using
07315   //          sign-and-magnitude) is represented by 2N - 1.
07316   //
07317   // Read http://en.wikipedia.org/wiki/Signed_number_representations
07318   // for more details on signed number representations.
07319   static Bits SignAndMagnitudeToBiased(const Bits &sam) {
07320     if (kSignBitMask & sam) {
07321       // sam represents a negative number.
07322       return ~sam + 1;
07323     } else {
07324       // sam represents a positive number.
07325       return kSignBitMask | sam;
07326     }
07327   }
07328 
07329   // Given two numbers in the sign-and-magnitude representation,
07330   // returns the distance between them as an unsigned number.
07331   static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
07332                                                      const Bits &sam2) {
07333     const Bits biased1 = SignAndMagnitudeToBiased(sam1);
07334     const Bits biased2 = SignAndMagnitudeToBiased(sam2);
07335     return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
07336   }
07337 
07338   FloatingPointUnion u_;
07339 };
07340 
07341 // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
07342 // macro defined by <windows.h>.
07343 template <>
07344 inline float FloatingPoint<float>::Max() { return FLT_MAX; }
07345 template <>
07346 inline double FloatingPoint<double>::Max() { return DBL_MAX; }
07347 
07348 // Typedefs the instances of the FloatingPoint template class that we
07349 // care to use.
07350 typedef FloatingPoint<float> Float;
07351 typedef FloatingPoint<double> Double;
07352 
07353 // In order to catch the mistake of putting tests that use different
07354 // test fixture classes in the same test case, we need to assign
07355 // unique IDs to fixture classes and compare them.  The TypeId type is
07356 // used to hold such IDs.  The user should treat TypeId as an opaque
07357 // type: the only operation allowed on TypeId values is to compare
07358 // them for equality using the == operator.
07359 typedef const void* TypeId;
07360 
07361 template <typename T>
07362 class TypeIdHelper {
07363  public:
07364   // dummy_ must not have a const type.  Otherwise an overly eager
07365   // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
07366   // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
07367   static bool dummy_;
07368 };
07369 
07370 template <typename T>
07371 bool TypeIdHelper<T>::dummy_ = false;
07372 
07373 // GetTypeId<T>() returns the ID of type T.  Different values will be
07374 // returned for different types.  Calling the function twice with the
07375 // same type argument is guaranteed to return the same ID.
07376 template <typename T>
07377 TypeId GetTypeId() {
07378   // The compiler is required to allocate a different
07379   // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
07380   // the template.  Therefore, the address of dummy_ is guaranteed to
07381   // be unique.
07382   return &(TypeIdHelper<T>::dummy_);
07383 }
07384 
07385 // Returns the type ID of ::testing::Test.  Always call this instead
07386 // of GetTypeId< ::testing::Test>() to get the type ID of
07387 // ::testing::Test, as the latter may give the wrong result due to a
07388 // suspected linker bug when compiling Google Test as a Mac OS X
07389 // framework.
07390 GTEST_API_ TypeId GetTestTypeId();
07391 
07392 // Defines the abstract factory interface that creates instances
07393 // of a Test object.
07394 class TestFactoryBase {
07395  public:
07396   virtual ~TestFactoryBase() {}
07397 
07398   // Creates a test instance to run. The instance is both created and destroyed
07399   // within TestInfoImpl::Run()
07400   virtual Test* CreateTest() = 0;
07401 
07402  protected:
07403   TestFactoryBase() {}
07404 
07405  private:
07406   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
07407 };
07408 
07409 // This class provides implementation of TeastFactoryBase interface.
07410 // It is used in TEST and TEST_F macros.
07411 template <class TestClass>
07412 class TestFactoryImpl : public TestFactoryBase {
07413  public:
07414   virtual Test* CreateTest() { return new TestClass; }
07415 };
07416 
07417 #if GTEST_OS_WINDOWS
07418 
07419 // Predicate-formatters for implementing the HRESULT checking macros
07420 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
07421 // We pass a long instead of HRESULT to avoid causing an
07422 // include dependency for the HRESULT type.
07423 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
07424                                             long hr);  // NOLINT
07425 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
07426                                             long hr);  // NOLINT
07427 
07428 #endif  // GTEST_OS_WINDOWS
07429 
07430 // Types of SetUpTestCase() and TearDownTestCase() functions.
07431 typedef void (*SetUpTestCaseFunc)();
07432 typedef void (*TearDownTestCaseFunc)();
07433 
07434 // Creates a new TestInfo object and registers it with Google Test;
07435 // returns the created object.
07436 //
07437 // Arguments:
07438 //
07439 //   test_case_name:   name of the test case
07440 //   name:             name of the test
07441 //   type_param        the name of the test's type parameter, or NULL if
07442 //                     this is not a typed or a type-parameterized test.
07443 //   value_param       text representation of the test's value parameter,
07444 //                     or NULL if this is not a type-parameterized test.
07445 //   fixture_class_id: ID of the test fixture class
07446 //   set_up_tc:        pointer to the function that sets up the test case
07447 //   tear_down_tc:     pointer to the function that tears down the test case
07448 //   factory:          pointer to the factory that creates a test object.
07449 //                     The newly created TestInfo instance will assume
07450 //                     ownership of the factory object.
07451 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
07452     const char* test_case_name,
07453     const char* name,
07454     const char* type_param,
07455     const char* value_param,
07456     TypeId fixture_class_id,
07457     SetUpTestCaseFunc set_up_tc,
07458     TearDownTestCaseFunc tear_down_tc,
07459     TestFactoryBase* factory);
07460 
07461 // If *pstr starts with the given prefix, modifies *pstr to be right
07462 // past the prefix and returns true; otherwise leaves *pstr unchanged
07463 // and returns false.  None of pstr, *pstr, and prefix can be NULL.
07464 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
07465 
07466 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07467 
07468 // State of the definition of a type-parameterized test case.
07469 class GTEST_API_ TypedTestCasePState {
07470  public:
07471   TypedTestCasePState() : registered_(false) {}
07472 
07473   // Adds the given test name to defined_test_names_ and return true
07474   // if the test case hasn't been registered; otherwise aborts the
07475   // program.
07476   bool AddTestName(const char* file, int line, const char* case_name,
07477                    const char* test_name) {
07478     if (registered_) {
07479       fprintf(stderr, "%s Test %s must be defined before "
07480               "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
07481               FormatFileLocation(file, line).c_str(), test_name, case_name);
07482       fflush(stderr);
07483       posix::Abort();
07484     }
07485     defined_test_names_.insert(test_name);
07486     return true;
07487   }
07488 
07489   // Verifies that registered_tests match the test names in
07490   // defined_test_names_; returns registered_tests if successful, or
07491   // aborts the program otherwise.
07492   const char* VerifyRegisteredTestNames(
07493       const char* file, int line, const char* registered_tests);
07494 
07495  private:
07496   bool registered_;
07497   ::std::set<const char*> defined_test_names_;
07498 };
07499 
07500 // Skips to the first non-space char after the first comma in 'str';
07501 // returns NULL if no comma is found in 'str'.
07502 inline const char* SkipComma(const char* str) {
07503   const char* comma = strchr(str, ',');
07504   if (comma == NULL) {
07505     return NULL;
07506   }
07507   while (IsSpace(*(++comma))) {}
07508   return comma;
07509 }
07510 
07511 // Returns the prefix of 'str' before the first comma in it; returns
07512 // the entire string if it contains no comma.
07513 inline std::string GetPrefixUntilComma(const char* str) {
07514   const char* comma = strchr(str, ',');
07515   return comma == NULL ? str : std::string(str, comma);
07516 }
07517 
07518 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
07519 // registers a list of type-parameterized tests with Google Test.  The
07520 // return value is insignificant - we just need to return something
07521 // such that we can call this function in a namespace scope.
07522 //
07523 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
07524 // template parameter.  It's defined in gtest-type-util.h.
07525 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
07526 class TypeParameterizedTest {
07527  public:
07528   // 'index' is the index of the test in the type list 'Types'
07529   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
07530   // Types).  Valid values for 'index' are [0, N - 1] where N is the
07531   // length of Types.
07532   static bool Register(const char* prefix, const char* case_name,
07533                        const char* test_names, int index) {
07534     typedef typename Types::Head Type;
07535     typedef Fixture<Type> FixtureClass;
07536     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
07537 
07538     // First, registers the first type-parameterized test in the type
07539     // list.
07540     MakeAndRegisterTestInfo(
07541         (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
07542          + StreamableToString(index)).c_str(),
07543         GetPrefixUntilComma(test_names).c_str(),
07544         GetTypeName<Type>().c_str(),
07545         NULL,  // No value parameter.
07546         GetTypeId<FixtureClass>(),
07547         TestClass::SetUpTestCase,
07548         TestClass::TearDownTestCase,
07549         new TestFactoryImpl<TestClass>);
07550 
07551     // Next, recurses (at compile time) with the tail of the type list.
07552     return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
07553         ::Register(prefix, case_name, test_names, index + 1);
07554   }
07555 };
07556 
07557 // The base case for the compile time recursion.
07558 template <GTEST_TEMPLATE_ Fixture, class TestSel>
07559 class TypeParameterizedTest<Fixture, TestSel, Types0> {
07560  public:
07561   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
07562                        const char* /*test_names*/, int /*index*/) {
07563     return true;
07564   }
07565 };
07566 
07567 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
07568 // registers *all combinations* of 'Tests' and 'Types' with Google
07569 // Test.  The return value is insignificant - we just need to return
07570 // something such that we can call this function in a namespace scope.
07571 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
07572 class TypeParameterizedTestCase {
07573  public:
07574   static bool Register(const char* prefix, const char* case_name,
07575                        const char* test_names) {
07576     typedef typename Tests::Head Head;
07577 
07578     // First, register the first test in 'Test' for each type in 'Types'.
07579     TypeParameterizedTest<Fixture, Head, Types>::Register(
07580         prefix, case_name, test_names, 0);
07581 
07582     // Next, recurses (at compile time) with the tail of the test list.
07583     return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
07584         ::Register(prefix, case_name, SkipComma(test_names));
07585   }
07586 };
07587 
07588 // The base case for the compile time recursion.
07589 template <GTEST_TEMPLATE_ Fixture, typename Types>
07590 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
07591  public:
07592   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
07593                        const char* /*test_names*/) {
07594     return true;
07595   }
07596 };
07597 
07598 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07599 
07600 // Returns the current OS stack trace as an std::string.
07601 //
07602 // The maximum number of stack frames to be included is specified by
07603 // the gtest_stack_trace_depth flag.  The skip_count parameter
07604 // specifies the number of top frames to be skipped, which doesn't
07605 // count against the number of frames to be included.
07606 //
07607 // For example, if Foo() calls Bar(), which in turn calls
07608 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
07609 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
07610 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
07611     UnitTest* unit_test, int skip_count);
07612 
07613 // Helpers for suppressing warnings on unreachable code or constant
07614 // condition.
07615 
07616 // Always returns true.
07617 GTEST_API_ bool AlwaysTrue();
07618 
07619 // Always returns false.
07620 inline bool AlwaysFalse() { return !AlwaysTrue(); }
07621 
07622 // Helper for suppressing false warning from Clang on a const char*
07623 // variable declared in a conditional expression always being NULL in
07624 // the else branch.
07625 struct GTEST_API_ ConstCharPtr {
07626   ConstCharPtr(const char* str) : value(str) {}
07627   operator bool() const { return true; }
07628   const char* value;
07629 };
07630 
07631 // A simple Linear Congruential Generator for generating random
07632 // numbers with a uniform distribution.  Unlike rand() and srand(), it
07633 // doesn't use global state (and therefore can't interfere with user
07634 // code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
07635 // but it's good enough for our purposes.
07636 class GTEST_API_ Random {
07637  public:
07638   static const UInt32 kMaxRange = 1u << 31;
07639 
07640   explicit Random(UInt32 seed) : state_(seed) {}
07641 
07642   void Reseed(UInt32 seed) { state_ = seed; }
07643 
07644   // Generates a random number from [0, range).  Crashes if 'range' is
07645   // 0 or greater than kMaxRange.
07646   UInt32 Generate(UInt32 range);
07647 
07648  private:
07649   UInt32 state_;
07650   GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
07651 };
07652 
07653 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
07654 // compiler error iff T1 and T2 are different types.
07655 template <typename T1, typename T2>
07656 struct CompileAssertTypesEqual;
07657 
07658 template <typename T>
07659 struct CompileAssertTypesEqual<T, T> {
07660 };
07661 
07662 // Removes the reference from a type if it is a reference type,
07663 // otherwise leaves it unchanged.  This is the same as
07664 // tr1::remove_reference, which is not widely available yet.
07665 template <typename T>
07666 struct RemoveReference { typedef T type; };  // NOLINT
07667 template <typename T>
07668 struct RemoveReference<T&> { typedef T type; };  // NOLINT
07669 
07670 // A handy wrapper around RemoveReference that works when the argument
07671 // T depends on template parameters.
07672 #define GTEST_REMOVE_REFERENCE_(T) \
07673     typename ::testing::internal::RemoveReference<T>::type
07674 
07675 // Removes const from a type if it is a const type, otherwise leaves
07676 // it unchanged.  This is the same as tr1::remove_const, which is not
07677 // widely available yet.
07678 template <typename T>
07679 struct RemoveConst { typedef T type; };  // NOLINT
07680 template <typename T>
07681 struct RemoveConst<const T> { typedef T type; };  // NOLINT
07682 
07683 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
07684 // definition to fail to remove the const in 'const int[3]' and 'const
07685 // char[3][4]'.  The following specialization works around the bug.
07686 template <typename T, size_t N>
07687 struct RemoveConst<const T[N]> {
07688   typedef typename RemoveConst<T>::type type[N];
07689 };
07690 
07691 #if defined(_MSC_VER) && _MSC_VER < 1400
07692 // This is the only specialization that allows VC++ 7.1 to remove const in
07693 // 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
07694 // and thus needs to be conditionally compiled.
07695 template <typename T, size_t N>
07696 struct RemoveConst<T[N]> {
07697   typedef typename RemoveConst<T>::type type[N];
07698 };
07699 #endif
07700 
07701 // A handy wrapper around RemoveConst that works when the argument
07702 // T depends on template parameters.
07703 #define GTEST_REMOVE_CONST_(T) \
07704     typename ::testing::internal::RemoveConst<T>::type
07705 
07706 // Turns const U&, U&, const U, and U all into U.
07707 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
07708     GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
07709 
07710 // Adds reference to a type if it is not a reference type,
07711 // otherwise leaves it unchanged.  This is the same as
07712 // tr1::add_reference, which is not widely available yet.
07713 template <typename T>
07714 struct AddReference { typedef T& type; };  // NOLINT
07715 template <typename T>
07716 struct AddReference<T&> { typedef T& type; };  // NOLINT
07717 
07718 // A handy wrapper around AddReference that works when the argument T
07719 // depends on template parameters.
07720 #define GTEST_ADD_REFERENCE_(T) \
07721     typename ::testing::internal::AddReference<T>::type
07722 
07723 // Adds a reference to const on top of T as necessary.  For example,
07724 // it transforms
07725 //
07726 //   char         ==> const char&
07727 //   const char   ==> const char&
07728 //   char&        ==> const char&
07729 //   const char&  ==> const char&
07730 //
07731 // The argument T must depend on some template parameters.
07732 #define GTEST_REFERENCE_TO_CONST_(T) \
07733     GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
07734 
07735 // ImplicitlyConvertible<From, To>::value is a compile-time bool
07736 // constant that's true iff type From can be implicitly converted to
07737 // type To.
07738 template <typename From, typename To>
07739 class ImplicitlyConvertible {
07740  private:
07741   // We need the following helper functions only for their types.
07742   // They have no implementations.
07743 
07744   // MakeFrom() is an expression whose type is From.  We cannot simply
07745   // use From(), as the type From may not have a public default
07746   // constructor.
07747   static From MakeFrom();
07748 
07749   // These two functions are overloaded.  Given an expression
07750   // Helper(x), the compiler will pick the first version if x can be
07751   // implicitly converted to type To; otherwise it will pick the
07752   // second version.
07753   //
07754   // The first version returns a value of size 1, and the second
07755   // version returns a value of size 2.  Therefore, by checking the
07756   // size of Helper(x), which can be done at compile time, we can tell
07757   // which version of Helper() is used, and hence whether x can be
07758   // implicitly converted to type To.
07759   static char Helper(To);
07760   static char (&Helper(...))[2];  // NOLINT
07761 
07762   // We have to put the 'public' section after the 'private' section,
07763   // or MSVC refuses to compile the code.
07764  public:
07765   // MSVC warns about implicitly converting from double to int for
07766   // possible loss of data, so we need to temporarily disable the
07767   // warning.
07768 #ifdef _MSC_VER
07769 # pragma warning(push)          // Saves the current warning state.
07770 # pragma warning(disable:4244)  // Temporarily disables warning 4244.
07771 
07772   static const bool value =
07773       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
07774 # pragma warning(pop)           // Restores the warning state.
07775 #elif defined(__BORLANDC__)
07776   // C++Builder cannot use member overload resolution during template
07777   // instantiation.  The simplest workaround is to use its C++0x type traits
07778   // functions (C++Builder 2009 and above only).
07779   static const bool value = __is_convertible(From, To);
07780 #else
07781   static const bool value =
07782       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
07783 #endif  // _MSV_VER
07784 };
07785 template <typename From, typename To>
07786 const bool ImplicitlyConvertible<From, To>::value;
07787 
07788 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
07789 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
07790 // of those.
07791 template <typename T>
07792 struct IsAProtocolMessage
07793     : public bool_constant<
07794   ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
07795   ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
07796 };
07797 
07798 // When the compiler sees expression IsContainerTest<C>(0), if C is an
07799 // STL-style container class, the first overload of IsContainerTest
07800 // will be viable (since both C::iterator* and C::const_iterator* are
07801 // valid types and NULL can be implicitly converted to them).  It will
07802 // be picked over the second overload as 'int' is a perfect match for
07803 // the type of argument 0.  If C::iterator or C::const_iterator is not
07804 // a valid type, the first overload is not viable, and the second
07805 // overload will be picked.  Therefore, we can determine whether C is
07806 // a container class by checking the type of IsContainerTest<C>(0).
07807 // The value of the expression is insignificant.
07808 //
07809 // Note that we look for both C::iterator and C::const_iterator.  The
07810 // reason is that C++ injects the name of a class as a member of the
07811 // class itself (e.g. you can refer to class iterator as either
07812 // 'iterator' or 'iterator::iterator').  If we look for C::iterator
07813 // only, for example, we would mistakenly think that a class named
07814 // iterator is an STL container.
07815 //
07816 // Also note that the simpler approach of overloading
07817 // IsContainerTest(typename C::const_iterator*) and
07818 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
07819 typedef int IsContainer;
07820 template <class C>
07821 IsContainer IsContainerTest(int /* dummy */,
07822                             typename C::iterator* /* it */ = NULL,
07823                             typename C::const_iterator* /* const_it */ = NULL) {
07824   return 0;
07825 }
07826 
07827 typedef char IsNotContainer;
07828 template <class C>
07829 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
07830 
07831 // EnableIf<condition>::type is void when 'Cond' is true, and
07832 // undefined when 'Cond' is false.  To use SFINAE to make a function
07833 // overload only apply when a particular expression is true, add
07834 // "typename EnableIf<expression>::type* = 0" as the last parameter.
07835 template<bool> struct EnableIf;
07836 template<> struct EnableIf<true> { typedef void type; };  // NOLINT
07837 
07838 // Utilities for native arrays.
07839 
07840 // ArrayEq() compares two k-dimensional native arrays using the
07841 // elements' operator==, where k can be any integer >= 0.  When k is
07842 // 0, ArrayEq() degenerates into comparing a single pair of values.
07843 
07844 template <typename T, typename U>
07845 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
07846 
07847 // This generic version is used when k is 0.
07848 template <typename T, typename U>
07849 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
07850 
07851 // This overload is used when k >= 1.
07852 template <typename T, typename U, size_t N>
07853 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
07854   return internal::ArrayEq(lhs, N, rhs);
07855 }
07856 
07857 // This helper reduces code bloat.  If we instead put its logic inside
07858 // the previous ArrayEq() function, arrays with different sizes would
07859 // lead to different copies of the template code.
07860 template <typename T, typename U>
07861 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
07862   for (size_t i = 0; i != size; i++) {
07863     if (!internal::ArrayEq(lhs[i], rhs[i]))
07864       return false;
07865   }
07866   return true;
07867 }
07868 
07869 // Finds the first element in the iterator range [begin, end) that
07870 // equals elem.  Element may be a native array type itself.
07871 template <typename Iter, typename Element>
07872 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
07873   for (Iter it = begin; it != end; ++it) {
07874     if (internal::ArrayEq(*it, elem))
07875       return it;
07876   }
07877   return end;
07878 }
07879 
07880 // CopyArray() copies a k-dimensional native array using the elements'
07881 // operator=, where k can be any integer >= 0.  When k is 0,
07882 // CopyArray() degenerates into copying a single value.
07883 
07884 template <typename T, typename U>
07885 void CopyArray(const T* from, size_t size, U* to);
07886 
07887 // This generic version is used when k is 0.
07888 template <typename T, typename U>
07889 inline void CopyArray(const T& from, U* to) { *to = from; }
07890 
07891 // This overload is used when k >= 1.
07892 template <typename T, typename U, size_t N>
07893 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
07894   internal::CopyArray(from, N, *to);
07895 }
07896 
07897 // This helper reduces code bloat.  If we instead put its logic inside
07898 // the previous CopyArray() function, arrays with different sizes
07899 // would lead to different copies of the template code.
07900 template <typename T, typename U>
07901 void CopyArray(const T* from, size_t size, U* to) {
07902   for (size_t i = 0; i != size; i++) {
07903     internal::CopyArray(from[i], to + i);
07904   }
07905 }
07906 
07907 // The relation between an NativeArray object (see below) and the
07908 // native array it represents.
07909 enum RelationToSource {
07910   kReference,  // The NativeArray references the native array.
07911   kCopy        // The NativeArray makes a copy of the native array and
07912                // owns the copy.
07913 };
07914 
07915 // Adapts a native array to a read-only STL-style container.  Instead
07916 // of the complete STL container concept, this adaptor only implements
07917 // members useful for Google Mock's container matchers.  New members
07918 // should be added as needed.  To simplify the implementation, we only
07919 // support Element being a raw type (i.e. having no top-level const or
07920 // reference modifier).  It's the client's responsibility to satisfy
07921 // this requirement.  Element can be an array type itself (hence
07922 // multi-dimensional arrays are supported).
07923 template <typename Element>
07924 class NativeArray {
07925  public:
07926   // STL-style container typedefs.
07927   typedef Element value_type;
07928   typedef Element* iterator;
07929   typedef const Element* const_iterator;
07930 
07931   // Constructs from a native array.
07932   NativeArray(const Element* array, size_t count, RelationToSource relation) {
07933     Init(array, count, relation);
07934   }
07935 
07936   // Copy constructor.
07937   NativeArray(const NativeArray& rhs) {
07938     Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
07939   }
07940 
07941   ~NativeArray() {
07942     // Ensures that the user doesn't instantiate NativeArray with a
07943     // const or reference type.
07944     static_cast<void>(StaticAssertTypeEqHelper<Element,
07945         GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
07946     if (relation_to_source_ == kCopy)
07947       delete[] array_;
07948   }
07949 
07950   // STL-style container methods.
07951   size_t size() const { return size_; }
07952   const_iterator begin() const { return array_; }
07953   const_iterator end() const { return array_ + size_; }
07954   bool operator==(const NativeArray& rhs) const {
07955     return size() == rhs.size() &&
07956         ArrayEq(begin(), size(), rhs.begin());
07957   }
07958 
07959  private:
07960   // Initializes this object; makes a copy of the input array if
07961   // 'relation' is kCopy.
07962   void Init(const Element* array, size_t a_size, RelationToSource relation) {
07963     if (relation == kReference) {
07964       array_ = array;
07965     } else {
07966       Element* const copy = new Element[a_size];
07967       CopyArray(array, a_size, copy);
07968       array_ = copy;
07969     }
07970     size_ = a_size;
07971     relation_to_source_ = relation;
07972   }
07973 
07974   const Element* array_;
07975   size_t size_;
07976   RelationToSource relation_to_source_;
07977 
07978   GTEST_DISALLOW_ASSIGN_(NativeArray);
07979 };
07980 
07981 }  // namespace internal
07982 }  // namespace testing
07983 
07984 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
07985   ::testing::internal::AssertHelper(result_type, file, line, message) \
07986     = ::testing::Message()
07987 
07988 #define GTEST_MESSAGE_(message, result_type) \
07989   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
07990 
07991 #define GTEST_FATAL_FAILURE_(message) \
07992   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
07993 
07994 #define GTEST_NONFATAL_FAILURE_(message) \
07995   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
07996 
07997 #define GTEST_SUCCESS_(message) \
07998   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
07999 
08000 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
08001 // statement if it returns or throws (or doesn't return or throw in some
08002 // situations).
08003 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
08004   if (::testing::internal::AlwaysTrue()) { statement; }
08005 
08006 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
08007   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08008   if (::testing::internal::ConstCharPtr gtest_msg = "") { \
08009     bool gtest_caught_expected = false; \
08010     try { \
08011       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08012     } \
08013     catch (expected_exception const&) { \
08014       gtest_caught_expected = true; \
08015     } \
08016     catch (...) { \
08017       gtest_msg.value = \
08018           "Expected: " #statement " throws an exception of type " \
08019           #expected_exception ".\n  Actual: it throws a different type."; \
08020       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
08021     } \
08022     if (!gtest_caught_expected) { \
08023       gtest_msg.value = \
08024           "Expected: " #statement " throws an exception of type " \
08025           #expected_exception ".\n  Actual: it throws nothing."; \
08026       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
08027     } \
08028   } else \
08029     GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
08030       fail(gtest_msg.value)
08031 
08032 #define GTEST_TEST_NO_THROW_(statement, fail) \
08033   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08034   if (::testing::internal::AlwaysTrue()) { \
08035     try { \
08036       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08037     } \
08038     catch (...) { \
08039       goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
08040     } \
08041   } else \
08042     GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
08043       fail("Expected: " #statement " doesn't throw an exception.\n" \
08044            "  Actual: it throws.")
08045 
08046 #define GTEST_TEST_ANY_THROW_(statement, fail) \
08047   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08048   if (::testing::internal::AlwaysTrue()) { \
08049     bool gtest_caught_any = false; \
08050     try { \
08051       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08052     } \
08053     catch (...) { \
08054       gtest_caught_any = true; \
08055     } \
08056     if (!gtest_caught_any) { \
08057       goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
08058     } \
08059   } else \
08060     GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
08061       fail("Expected: " #statement " throws an exception.\n" \
08062            "  Actual: it doesn't.")
08063 
08064 
08065 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
08066 // either a boolean expression or an AssertionResult. text is a textual
08067 // represenation of expression as it was passed into the EXPECT_TRUE.
08068 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
08069   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08070   if (const ::testing::AssertionResult gtest_ar_ = \
08071       ::testing::AssertionResult(expression)) \
08072     ; \
08073   else \
08074     fail(::testing::internal::GetBoolAssertionFailureMessage(\
08075         gtest_ar_, text, #actual, #expected).c_str())
08076 
08077 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
08078   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08079   if (::testing::internal::AlwaysTrue()) { \
08080     ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
08081     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08082     if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
08083       goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
08084     } \
08085   } else \
08086     GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
08087       fail("Expected: " #statement " doesn't generate new fatal " \
08088            "failures in the current thread.\n" \
08089            "  Actual: it does.")
08090 
08091 // Expands to the name of the class that implements the given test.
08092 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
08093   test_case_name##_##test_name##_Test
08094 
08095 // Helper macro for defining tests.
08096 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
08097 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
08098  public:\
08099   GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
08100  private:\
08101   virtual void TestBody();\
08102   static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
08103   GTEST_DISALLOW_COPY_AND_ASSIGN_(\
08104       GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
08105 };\
08106 \
08107 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
08108   ::test_info_ =\
08109     ::testing::internal::MakeAndRegisterTestInfo(\
08110         #test_case_name, #test_name, NULL, NULL, \
08111         (parent_id), \
08112         parent_class::SetUpTestCase, \
08113         parent_class::TearDownTestCase, \
08114         new ::testing::internal::TestFactoryImpl<\
08115             GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
08116 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
08117 
08118 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
08119 // Copyright 2005, Google Inc.
08120 // All rights reserved.
08121 //
08122 // Redistribution and use in source and binary forms, with or without
08123 // modification, are permitted provided that the following conditions are
08124 // met:
08125 //
08126 //     * Redistributions of source code must retain the above copyright
08127 // notice, this list of conditions and the following disclaimer.
08128 //     * Redistributions in binary form must reproduce the above
08129 // copyright notice, this list of conditions and the following disclaimer
08130 // in the documentation and/or other materials provided with the
08131 // distribution.
08132 //     * Neither the name of Google Inc. nor the names of its
08133 // contributors may be used to endorse or promote products derived from
08134 // this software without specific prior written permission.
08135 //
08136 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08137 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08138 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08139 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08140 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08141 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08142 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08143 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08144 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08145 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08146 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08147 //
08148 // Author: wan@google.com (Zhanyong Wan)
08149 //
08150 // The Google C++ Testing Framework (Google Test)
08151 //
08152 // This header file defines the public API for death tests.  It is
08153 // #included by gtest.h so a user doesn't need to include this
08154 // directly.
08155 
08156 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08157 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08158 
08159 // Copyright 2005, Google Inc.
08160 // All rights reserved.
08161 //
08162 // Redistribution and use in source and binary forms, with or without
08163 // modification, are permitted provided that the following conditions are
08164 // met:
08165 //
08166 //     * Redistributions of source code must retain the above copyright
08167 // notice, this list of conditions and the following disclaimer.
08168 //     * Redistributions in binary form must reproduce the above
08169 // copyright notice, this list of conditions and the following disclaimer
08170 // in the documentation and/or other materials provided with the
08171 // distribution.
08172 //     * Neither the name of Google Inc. nor the names of its
08173 // contributors may be used to endorse or promote products derived from
08174 // this software without specific prior written permission.
08175 //
08176 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08177 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08178 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08179 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08180 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08181 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08182 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08183 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08184 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08185 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08186 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08187 //
08188 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
08189 //
08190 // The Google C++ Testing Framework (Google Test)
08191 //
08192 // This header file defines internal utilities needed for implementing
08193 // death tests.  They are subject to change without notice.
08194 
08195 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08196 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08197 
08198 
08199 #include <stdio.h>
08200 
08201 namespace testing {
08202 namespace internal {
08203 
08204 GTEST_DECLARE_string_(internal_run_death_test);
08205 
08206 // Names of the flags (needed for parsing Google Test flags).
08207 const char kDeathTestStyleFlag[] = "death_test_style";
08208 const char kDeathTestUseFork[] = "death_test_use_fork";
08209 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
08210 
08211 #if GTEST_HAS_DEATH_TEST
08212 
08213 // DeathTest is a class that hides much of the complexity of the
08214 // GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
08215 // returns a concrete class that depends on the prevailing death test
08216 // style, as defined by the --gtest_death_test_style and/or
08217 // --gtest_internal_run_death_test flags.
08218 
08219 // In describing the results of death tests, these terms are used with
08220 // the corresponding definitions:
08221 //
08222 // exit status:  The integer exit information in the format specified
08223 //               by wait(2)
08224 // exit code:    The integer code passed to exit(3), _exit(2), or
08225 //               returned from main()
08226 class GTEST_API_ DeathTest {
08227  public:
08228   // Create returns false if there was an error determining the
08229   // appropriate action to take for the current death test; for example,
08230   // if the gtest_death_test_style flag is set to an invalid value.
08231   // The LastMessage method will return a more detailed message in that
08232   // case.  Otherwise, the DeathTest pointer pointed to by the "test"
08233   // argument is set.  If the death test should be skipped, the pointer
08234   // is set to NULL; otherwise, it is set to the address of a new concrete
08235   // DeathTest object that controls the execution of the current test.
08236   static bool Create(const char* statement, const RE* regex,
08237                      const char* file, int line, DeathTest** test);
08238   DeathTest();
08239   virtual ~DeathTest() { }
08240 
08241   // A helper class that aborts a death test when it's deleted.
08242   class ReturnSentinel {
08243    public:
08244     explicit ReturnSentinel(DeathTest* test) : test_(test) { }
08245     ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
08246    private:
08247     DeathTest* const test_;
08248     GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
08249   } GTEST_ATTRIBUTE_UNUSED_;
08250 
08251   // An enumeration of possible roles that may be taken when a death
08252   // test is encountered.  EXECUTE means that the death test logic should
08253   // be executed immediately.  OVERSEE means that the program should prepare
08254   // the appropriate environment for a child process to execute the death
08255   // test, then wait for it to complete.
08256   enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
08257 
08258   // An enumeration of the three reasons that a test might be aborted.
08259   enum AbortReason {
08260     TEST_ENCOUNTERED_RETURN_STATEMENT,
08261     TEST_THREW_EXCEPTION,
08262     TEST_DID_NOT_DIE
08263   };
08264 
08265   // Assumes one of the above roles.
08266   virtual TestRole AssumeRole() = 0;
08267 
08268   // Waits for the death test to finish and returns its status.
08269   virtual int Wait() = 0;
08270 
08271   // Returns true if the death test passed; that is, the test process
08272   // exited during the test, its exit status matches a user-supplied
08273   // predicate, and its stderr output matches a user-supplied regular
08274   // expression.
08275   // The user-supplied predicate may be a macro expression rather
08276   // than a function pointer or functor, or else Wait and Passed could
08277   // be combined.
08278   virtual bool Passed(bool exit_status_ok) = 0;
08279 
08280   // Signals that the death test did not die as expected.
08281   virtual void Abort(AbortReason reason) = 0;
08282 
08283   // Returns a human-readable outcome message regarding the outcome of
08284   // the last death test.
08285   static const char* LastMessage();
08286 
08287   static void set_last_death_test_message(const std::string& message);
08288 
08289  private:
08290   // A string containing a description of the outcome of the last death test.
08291   static std::string last_death_test_message_;
08292 
08293   GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
08294 };
08295 
08296 // Factory interface for death tests.  May be mocked out for testing.
08297 class DeathTestFactory {
08298  public:
08299   virtual ~DeathTestFactory() { }
08300   virtual bool Create(const char* statement, const RE* regex,
08301                       const char* file, int line, DeathTest** test) = 0;
08302 };
08303 
08304 // A concrete DeathTestFactory implementation for normal use.
08305 class DefaultDeathTestFactory : public DeathTestFactory {
08306  public:
08307   virtual bool Create(const char* statement, const RE* regex,
08308                       const char* file, int line, DeathTest** test);
08309 };
08310 
08311 // Returns true if exit_status describes a process that was terminated
08312 // by a signal, or exited normally with a nonzero exit code.
08313 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
08314 
08315 // Traps C++ exceptions escaping statement and reports them as test
08316 // failures. Note that trapping SEH exceptions is not implemented here.
08317 # if GTEST_HAS_EXCEPTIONS
08318 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
08319   try { \
08320     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08321   } catch (const ::std::exception& gtest_exception) { \
08322     fprintf(\
08323         stderr, \
08324         "\n%s: Caught std::exception-derived exception escaping the " \
08325         "death test statement. Exception message: %s\n", \
08326         ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
08327         gtest_exception.what()); \
08328     fflush(stderr); \
08329     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
08330   } catch (...) { \
08331     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
08332   }
08333 
08334 # else
08335 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
08336   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
08337 
08338 # endif
08339 
08340 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
08341 // ASSERT_EXIT*, and EXPECT_EXIT*.
08342 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
08343   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08344   if (::testing::internal::AlwaysTrue()) { \
08345     const ::testing::internal::RE& gtest_regex = (regex); \
08346     ::testing::internal::DeathTest* gtest_dt; \
08347     if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
08348         __FILE__, __LINE__, &gtest_dt)) { \
08349       goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
08350     } \
08351     if (gtest_dt != NULL) { \
08352       ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
08353           gtest_dt_ptr(gtest_dt); \
08354       switch (gtest_dt->AssumeRole()) { \
08355         case ::testing::internal::DeathTest::OVERSEE_TEST: \
08356           if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
08357             goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
08358           } \
08359           break; \
08360         case ::testing::internal::DeathTest::EXECUTE_TEST: { \
08361           ::testing::internal::DeathTest::ReturnSentinel \
08362               gtest_sentinel(gtest_dt); \
08363           GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
08364           gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
08365           break; \
08366         } \
08367         default: \
08368           break; \
08369       } \
08370     } \
08371   } else \
08372     GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
08373       fail(::testing::internal::DeathTest::LastMessage())
08374 // The symbol "fail" here expands to something into which a message
08375 // can be streamed.
08376 
08377 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
08378 // NDEBUG mode. In this case we need the statements to be executed, the regex is
08379 // ignored, and the macro must accept a streamed message even though the message
08380 // is never printed.
08381 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
08382   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08383   if (::testing::internal::AlwaysTrue()) { \
08384      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08385   } else \
08386     ::testing::Message()
08387 
08388 // A class representing the parsed contents of the
08389 // --gtest_internal_run_death_test flag, as it existed when
08390 // RUN_ALL_TESTS was called.
08391 class InternalRunDeathTestFlag {
08392  public:
08393   InternalRunDeathTestFlag(const std::string& a_file,
08394                            int a_line,
08395                            int an_index,
08396                            int a_write_fd)
08397       : file_(a_file), line_(a_line), index_(an_index),
08398         write_fd_(a_write_fd) {}
08399 
08400   ~InternalRunDeathTestFlag() {
08401     if (write_fd_ >= 0)
08402       posix::Close(write_fd_);
08403   }
08404 
08405   const std::string& file() const { return file_; }
08406   int line() const { return line_; }
08407   int index() const { return index_; }
08408   int write_fd() const { return write_fd_; }
08409 
08410  private:
08411   std::string file_;
08412   int line_;
08413   int index_;
08414   int write_fd_;
08415 
08416   GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
08417 };
08418 
08419 // Returns a newly created InternalRunDeathTestFlag object with fields
08420 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
08421 // the flag is specified; otherwise returns NULL.
08422 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
08423 
08424 #else  // GTEST_HAS_DEATH_TEST
08425 
08426 // This macro is used for implementing macros such as
08427 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
08428 // death tests are not supported. Those macros must compile on such systems
08429 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
08430 // systems that support death tests. This allows one to write such a macro
08431 // on a system that does not support death tests and be sure that it will
08432 // compile on a death-test supporting system.
08433 //
08434 // Parameters:
08435 //   statement -  A statement that a macro such as EXPECT_DEATH would test
08436 //                for program termination. This macro has to make sure this
08437 //                statement is compiled but not executed, to ensure that
08438 //                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
08439 //                parameter iff EXPECT_DEATH compiles with it.
08440 //   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
08441 //                the output of statement.  This parameter has to be
08442 //                compiled but not evaluated by this macro, to ensure that
08443 //                this macro only accepts expressions that a macro such as
08444 //                EXPECT_DEATH would accept.
08445 //   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
08446 //                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
08447 //                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
08448 //                compile inside functions where ASSERT_DEATH doesn't
08449 //                compile.
08450 //
08451 //  The branch that has an always false condition is used to ensure that
08452 //  statement and regex are compiled (and thus syntactically correct) but
08453 //  never executed. The unreachable code macro protects the terminator
08454 //  statement from generating an 'unreachable code' warning in case
08455 //  statement unconditionally returns or throws. The Message constructor at
08456 //  the end allows the syntax of streaming additional messages into the
08457 //  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
08458 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
08459     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08460     if (::testing::internal::AlwaysTrue()) { \
08461       GTEST_LOG_(WARNING) \
08462           << "Death tests are not supported on this platform.\n" \
08463           << "Statement '" #statement "' cannot be verified."; \
08464     } else if (::testing::internal::AlwaysFalse()) { \
08465       ::testing::internal::RE::PartialMatch(".*", (regex)); \
08466       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08467       terminator; \
08468     } else \
08469       ::testing::Message()
08470 
08471 #endif  // GTEST_HAS_DEATH_TEST
08472 
08473 }  // namespace internal
08474 }  // namespace testing
08475 
08476 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08477 
08478 namespace testing {
08479 
08480 // This flag controls the style of death tests.  Valid values are "threadsafe",
08481 // meaning that the death test child process will re-execute the test binary
08482 // from the start, running only a single death test, or "fast",
08483 // meaning that the child process will execute the test logic immediately
08484 // after forking.
08485 GTEST_DECLARE_string_(death_test_style);
08486 
08487 #if GTEST_HAS_DEATH_TEST
08488 
08489 namespace internal {
08490 
08491 // Returns a Boolean value indicating whether the caller is currently
08492 // executing in the context of the death test child process.  Tools such as
08493 // Valgrind heap checkers may need this to modify their behavior in death
08494 // tests.  IMPORTANT: This is an internal utility.  Using it may break the
08495 // implementation of death tests.  User code MUST NOT use it.
08496 GTEST_API_ bool InDeathTestChild();
08497 
08498 }  // namespace internal
08499 
08500 // The following macros are useful for writing death tests.
08501 
08502 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
08503 // executed:
08504 //
08505 //   1. It generates a warning if there is more than one active
08506 //   thread.  This is because it's safe to fork() or clone() only
08507 //   when there is a single thread.
08508 //
08509 //   2. The parent process clone()s a sub-process and runs the death
08510 //   test in it; the sub-process exits with code 0 at the end of the
08511 //   death test, if it hasn't exited already.
08512 //
08513 //   3. The parent process waits for the sub-process to terminate.
08514 //
08515 //   4. The parent process checks the exit code and error message of
08516 //   the sub-process.
08517 //
08518 // Examples:
08519 //
08520 //   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
08521 //   for (int i = 0; i < 5; i++) {
08522 //     EXPECT_DEATH(server.ProcessRequest(i),
08523 //                  "Invalid request .* in ProcessRequest()")
08524 //                  << "Failed to die on request " << i;
08525 //   }
08526 //
08527 //   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
08528 //
08529 //   bool KilledBySIGHUP(int exit_code) {
08530 //     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
08531 //   }
08532 //
08533 //   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
08534 //
08535 // On the regular expressions used in death tests:
08536 //
08537 //   On POSIX-compliant systems (*nix), we use the <regex.h> library,
08538 //   which uses the POSIX extended regex syntax.
08539 //
08540 //   On other platforms (e.g. Windows), we only support a simple regex
08541 //   syntax implemented as part of Google Test.  This limited
08542 //   implementation should be enough most of the time when writing
08543 //   death tests; though it lacks many features you can find in PCRE
08544 //   or POSIX extended regex syntax.  For example, we don't support
08545 //   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
08546 //   repetition count ("x{5,7}"), among others.
08547 //
08548 //   Below is the syntax that we do support.  We chose it to be a
08549 //   subset of both PCRE and POSIX extended regex, so it's easy to
08550 //   learn wherever you come from.  In the following: 'A' denotes a
08551 //   literal character, period (.), or a single \\ escape sequence;
08552 //   'x' and 'y' denote regular expressions; 'm' and 'n' are for
08553 //   natural numbers.
08554 //
08555 //     c     matches any literal character c
08556 //     \\d   matches any decimal digit
08557 //     \\D   matches any character that's not a decimal digit
08558 //     \\f   matches \f
08559 //     \\n   matches \n
08560 //     \\r   matches \r
08561 //     \\s   matches any ASCII whitespace, including \n
08562 //     \\S   matches any character that's not a whitespace
08563 //     \\t   matches \t
08564 //     \\v   matches \v
08565 //     \\w   matches any letter, _, or decimal digit
08566 //     \\W   matches any character that \\w doesn't match
08567 //     \\c   matches any literal character c, which must be a punctuation
08568 //     .     matches any single character except \n
08569 //     A?    matches 0 or 1 occurrences of A
08570 //     A*    matches 0 or many occurrences of A
08571 //     A+    matches 1 or many occurrences of A
08572 //     ^     matches the beginning of a string (not that of each line)
08573 //     $     matches the end of a string (not that of each line)
08574 //     xy    matches x followed by y
08575 //
08576 //   If you accidentally use PCRE or POSIX extended regex features
08577 //   not implemented by us, you will get a run-time failure.  In that
08578 //   case, please try to rewrite your regular expression within the
08579 //   above syntax.
08580 //
08581 //   This implementation is *not* meant to be as highly tuned or robust
08582 //   as a compiled regex library, but should perform well enough for a
08583 //   death test, which already incurs significant overhead by launching
08584 //   a child process.
08585 //
08586 // Known caveats:
08587 //
08588 //   A "threadsafe" style death test obtains the path to the test
08589 //   program from argv[0] and re-executes it in the sub-process.  For
08590 //   simplicity, the current implementation doesn't search the PATH
08591 //   when launching the sub-process.  This means that the user must
08592 //   invoke the test program via a path that contains at least one
08593 //   path separator (e.g. path/to/foo_test and
08594 //   /absolute/path/to/bar_test are fine, but foo_test is not).  This
08595 //   is rarely a problem as people usually don't put the test binary
08596 //   directory in PATH.
08597 //
08598 // TODO(wan@google.com): make thread-safe death tests search the PATH.
08599 
08600 // Asserts that a given statement causes the program to exit, with an
08601 // integer exit status that satisfies predicate, and emitting error output
08602 // that matches regex.
08603 # define ASSERT_EXIT(statement, predicate, regex) \
08604     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
08605 
08606 // Like ASSERT_EXIT, but continues on to successive tests in the
08607 // test case, if any:
08608 # define EXPECT_EXIT(statement, predicate, regex) \
08609     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
08610 
08611 // Asserts that a given statement causes the program to exit, either by
08612 // explicitly exiting with a nonzero exit code or being killed by a
08613 // signal, and emitting error output that matches regex.
08614 # define ASSERT_DEATH(statement, regex) \
08615     ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
08616 
08617 // Like ASSERT_DEATH, but continues on to successive tests in the
08618 // test case, if any:
08619 # define EXPECT_DEATH(statement, regex) \
08620     EXPECT_EXIT(statement, ::testing::internal::