1 // Copyright 2005, Google Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 //     * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 //     * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 //     * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 //
31 // The Google C++ Testing and Mocking Framework (Google Test)
32 //
33 // This header file defines the public API for Google Test.  It should be
34 // included by any test program that uses Google Test.
35 //
36 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
37 // leave some internal implementation details in this header file.
38 // They are clearly marked by comments like this:
39 //
40 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
41 //
42 // Such code is NOT meant to be used by a user directly, and is subject
43 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
44 // program!
45 //
46 // Acknowledgment: Google Test borrowed the idea of automatic test
47 // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
48 // easyUnit framework.
49 
50 // GOOGLETEST_CM0001 DO NOT DELETE
51 
52 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
53 #define GTEST_INCLUDE_GTEST_GTEST_H_
54 
55 #include <limits>
56 #include <ostream>
57 #include <vector>
58 
59 // Copyright 2005, Google Inc.
60 // All rights reserved.
61 //
62 // Redistribution and use in source and binary forms, with or without
63 // modification, are permitted provided that the following conditions are
64 // met:
65 //
66 //     * Redistributions of source code must retain the above copyright
67 // notice, this list of conditions and the following disclaimer.
68 //     * Redistributions in binary form must reproduce the above
69 // copyright notice, this list of conditions and the following disclaimer
70 // in the documentation and/or other materials provided with the
71 // distribution.
72 //     * Neither the name of Google Inc. nor the names of its
73 // contributors may be used to endorse or promote products derived from
74 // this software without specific prior written permission.
75 //
76 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
77 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
78 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
79 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
80 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
81 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
82 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
83 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
84 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
85 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
86 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
87 //
88 // The Google C++ Testing and Mocking Framework (Google Test)
89 //
90 // This header file declares functions and macros used internally by
91 // Google Test.  They are subject to change without notice.
92 
93 // GOOGLETEST_CM0001 DO NOT DELETE
94 
95 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
96 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
97 
98 // Copyright 2005, Google Inc.
99 // All rights reserved.
100 //
101 // Redistribution and use in source and binary forms, with or without
102 // modification, are permitted provided that the following conditions are
103 // met:
104 //
105 //     * Redistributions of source code must retain the above copyright
106 // notice, this list of conditions and the following disclaimer.
107 //     * Redistributions in binary form must reproduce the above
108 // copyright notice, this list of conditions and the following disclaimer
109 // in the documentation and/or other materials provided with the
110 // distribution.
111 //     * Neither the name of Google Inc. nor the names of its
112 // contributors may be used to endorse or promote products derived from
113 // this software without specific prior written permission.
114 //
115 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
116 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
117 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
118 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
119 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
120 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
121 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
122 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
123 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
125 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126 //
127 // Low-level types and utilities for porting Google Test to various
128 // platforms.  All macros ending with _ and symbols defined in an
129 // internal namespace are subject to change without notice.  Code
130 // outside Google Test MUST NOT USE THEM DIRECTLY.  Macros that don't
131 // end with _ are part of Google Test's public API and can be used by
132 // code outside Google Test.
133 //
134 // This file is fundamental to Google Test.  All other Google Test source
135 // files are expected to #include this.  Therefore, it cannot #include
136 // any other Google Test header.
137 
138 // GOOGLETEST_CM0001 DO NOT DELETE
139 
140 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
141 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
142 
143 // Environment-describing macros
144 // -----------------------------
145 //
146 // Google Test can be used in many different environments.  Macros in
147 // this section tell Google Test what kind of environment it is being
148 // used in, such that Google Test can provide environment-specific
149 // features and implementations.
150 //
151 // Google Test tries to automatically detect the properties of its
152 // environment, so users usually don't need to worry about these
153 // macros.  However, the automatic detection is not perfect.
154 // Sometimes it's necessary for a user to define some of the following
155 // macros in the build script to override Google Test's decisions.
156 //
157 // If the user doesn't define a macro in the list, Google Test will
158 // provide a default definition.  After this header is #included, all
159 // macros in this list will be defined to either 1 or 0.
160 //
161 // Notes to maintainers:
162 //   - Each macro here is a user-tweakable knob; do not grow the list
163 //     lightly.
164 //   - Use #if to key off these macros.  Don't use #ifdef or "#if
165 //     defined(...)", which will not work as these macros are ALWAYS
166 //     defined.
167 //
168 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
169 //                              is/isn't available.
170 //   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
171 //                              are enabled.
172 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
173 //                              is/isn't available
174 //   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring
175 //                              is/isn't available
176 //   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
177 //                              expressions are/aren't available.
178 //   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
179 //                              is/isn't available.
180 //   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
181 //                              enabled.
182 //   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
183 //                              std::wstring does/doesn't work (Google Test can
184 //                              be used where std::wstring is unavailable).
185 //   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
186 //                              is/isn't available.
187 //   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
188 //                              compiler supports Microsoft's "Structured
189 //                              Exception Handling".
190 //   GTEST_HAS_STREAM_REDIRECTION
191 //                            - Define it to 1/0 to indicate whether the
192 //                              platform supports I/O stream redirection using
193 //                              dup() and dup2().
194 //   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
195 //                              Test's own tr1 tuple implementation should be
196 //                              used.  Unused when the user sets
197 //                              GTEST_HAS_TR1_TUPLE to 0.
198 //   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
199 //                              is building in C++11/C++98 mode.
200 //   GTEST_LINKED_AS_SHARED_LIBRARY
201 //                            - Define to 1 when compiling tests that use
202 //                              Google Test as a shared library (known as
203 //                              DLL on Windows).
204 //   GTEST_CREATE_SHARED_LIBRARY
205 //                            - Define to 1 when compiling Google Test itself
206 //                              as a shared library.
207 //   GTEST_DEFAULT_DEATH_TEST_STYLE
208 //                            - The default value of --gtest_death_test_style.
209 //                              The legacy default has been "fast" in the open
210 //                              source version since 2008. The recommended value
211 //                              is "threadsafe", and can be set in
212 //                              custom/gtest-port.h.
213 
214 // Platform-indicating macros
215 // --------------------------
216 //
217 // Macros indicating the platform on which Google Test is being used
218 // (a macro is defined to 1 if compiled on the given platform;
219 // otherwise UNDEFINED -- it's never defined to 0.).  Google Test
220 // defines these macros automatically.  Code outside Google Test MUST
221 // NOT define them.
222 //
223 //   GTEST_OS_AIX      - IBM AIX
224 //   GTEST_OS_CYGWIN   - Cygwin
225 //   GTEST_OS_FREEBSD  - FreeBSD
226 //   GTEST_OS_FUCHSIA  - Fuchsia
227 //   GTEST_OS_HPUX     - HP-UX
228 //   GTEST_OS_LINUX    - Linux
229 //     GTEST_OS_LINUX_ANDROID - Google Android
230 //   GTEST_OS_MAC      - Mac OS X
231 //     GTEST_OS_IOS    - iOS
232 //   GTEST_OS_NACL     - Google Native Client (NaCl)
233 //   GTEST_OS_NETBSD   - NetBSD
234 //   GTEST_OS_OPENBSD  - OpenBSD
235 //   GTEST_OS_QNX      - QNX
236 //   GTEST_OS_SOLARIS  - Sun Solaris
237 //   GTEST_OS_SYMBIAN  - Symbian
238 //   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
239 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
240 //     GTEST_OS_WINDOWS_MINGW    - MinGW
241 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
242 //     GTEST_OS_WINDOWS_PHONE    - Windows Phone
243 //     GTEST_OS_WINDOWS_RT       - Windows Store App/WinRT
244 //   GTEST_OS_ZOS      - z/OS
245 //
246 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
247 // most stable support.  Since core members of the Google Test project
248 // don't have access to other platforms, support for them may be less
249 // stable.  If you notice any problems on your platform, please notify
250 // googletestframework@googlegroups.com (patches for fixing them are
251 // even more welcome!).
252 //
253 // It is possible that none of the GTEST_OS_* macros are defined.
254 
255 // Feature-indicating macros
256 // -------------------------
257 //
258 // Macros indicating which Google Test features are available (a macro
259 // is defined to 1 if the corresponding feature is supported;
260 // otherwise UNDEFINED -- it's never defined to 0.).  Google Test
261 // defines these macros automatically.  Code outside Google Test MUST
262 // NOT define them.
263 //
264 // These macros are public so that portable tests can be written.
265 // Such tests typically surround code using a feature with an #if
266 // which controls that code.  For example:
267 //
268 // #if GTEST_HAS_DEATH_TEST
269 //   EXPECT_DEATH(DoSomethingDeadly());
270 // #endif
271 //
272 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
273 //                            tests)
274 //   GTEST_HAS_DEATH_TEST   - death tests
275 //   GTEST_HAS_TYPED_TEST   - typed tests
276 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
277 //   GTEST_IS_THREADSAFE    - Google Test is thread-safe.
278 //   GOOGLETEST_CM0007 DO NOT DELETE
279 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
280 //                            GTEST_HAS_POSIX_RE (see above) which users can
281 //                            define themselves.
282 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
283 //                            the above RE\b(s) are mutually exclusive.
284 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
285 
286 // Misc public macros
287 // ------------------
288 //
289 //   GTEST_FLAG(flag_name)  - references the variable corresponding to
290 //                            the given Google Test flag.
291 
292 // Internal utilities
293 // ------------------
294 //
295 // The following macros and utilities are for Google Test's INTERNAL
296 // use only.  Code outside Google Test MUST NOT USE THEM DIRECTLY.
297 //
298 // Macros for basic C++ coding:
299 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
300 //   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
301 //                              variable don't have to be used.
302 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
303 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
304 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
305 //   GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
306 //                                        suppressed (constant conditional).
307 //   GTEST_INTENTIONAL_CONST_COND_POP_  - finish code section where MSVC C4127
308 //                                        is suppressed.
309 //
310 // C++11 feature wrappers:
311 //
312 //   testing::internal::forward - portability wrapper for std::forward.
313 //   testing::internal::move  - portability wrapper for std::move.
314 //
315 // Synchronization:
316 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
317 //                            - synchronization primitives.
318 //
319 // Template meta programming:
320 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
321 //   IteratorTraits - partial implementation of std::iterator_traits, which
322 //                    is not available in libCstd when compiled with Sun C++.
323 //
324 // Smart pointers:
325 //   scoped_ptr     - as in TR2.
326 //
327 // Regular expressions:
328 //   RE             - a simple regular expression class using the POSIX
329 //                    Extended Regular Expression syntax on UNIX-like platforms
330 //                    GOOGLETEST_CM0008 DO NOT DELETE
331 //                    or a reduced regular exception syntax on other
332 //                    platforms, including Windows.
333 // Logging:
334 //   GTEST_LOG_()   - logs messages at the specified severity level.
335 //   LogToStderr()  - directs all log messages to stderr.
336 //   FlushInfoLog() - flushes informational log messages.
337 //
338 // Stdout and stderr capturing:
339 //   CaptureStdout()     - starts capturing stdout.
340 //   GetCapturedStdout() - stops capturing stdout and returns the captured
341 //                         string.
342 //   CaptureStderr()     - starts capturing stderr.
343 //   GetCapturedStderr() - stops capturing stderr and returns the captured
344 //                         string.
345 //
346 // Integer types:
347 //   TypeWithSize   - maps an integer to a int type.
348 //   Int32, UInt32, Int64, UInt64, TimeInMillis
349 //                  - integers of known sizes.
350 //   BiggestInt     - the biggest signed integer type.
351 //
352 // Command-line utilities:
353 //   GTEST_DECLARE_*()  - declares a flag.
354 //   GTEST_DEFINE_*()   - defines a flag.
355 //   GetInjectableArgvs() - returns the command line as a vector of strings.
356 //
357 // Environment variable utilities:
358 //   GetEnv()             - gets the value of an environment variable.
359 //   BoolFromGTestEnv()   - parses a bool environment variable.
360 //   Int32FromGTestEnv()  - parses an Int32 environment variable.
361 //   StringFromGTestEnv() - parses a string environment variable.
362 
363 #include <ctype.h>   // for isspace, etc
364 #include <stddef.h>  // for ptrdiff_t
365 #include <stdlib.h>
366 #include <stdio.h>
367 #include <string.h>
368 #ifndef _WIN32_WCE
369 # include <sys/types.h>
370 # include <sys/stat.h>
371 #endif  // !_WIN32_WCE
372 
373 #if defined __APPLE__
374 # include <AvailabilityMacros.h>
375 # include <TargetConditionals.h>
376 #endif
377 
378 // Brings in the definition of HAS_GLOBAL_STRING.  This must be done
379 // BEFORE we test HAS_GLOBAL_STRING.
380 #include <string>  // NOLINT
381 #include <algorithm>  // NOLINT
382 #include <iostream>  // NOLINT
383 #include <sstream>  // NOLINT
384 #include <utility>
385 #include <vector>  // NOLINT
386 
387 // Copyright 2015, Google Inc.
388 // All rights reserved.
389 //
390 // Redistribution and use in source and binary forms, with or without
391 // modification, are permitted provided that the following conditions are
392 // met:
393 //
394 //     * Redistributions of source code must retain the above copyright
395 // notice, this list of conditions and the following disclaimer.
396 //     * Redistributions in binary form must reproduce the above
397 // copyright notice, this list of conditions and the following disclaimer
398 // in the documentation and/or other materials provided with the
399 // distribution.
400 //     * Neither the name of Google Inc. nor the names of its
401 // contributors may be used to endorse or promote products derived from
402 // this software without specific prior written permission.
403 //
404 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
405 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
406 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
407 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
408 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
409 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
410 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
411 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
412 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
413 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
414 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
415 //
416 // The Google C++ Testing and Mocking Framework (Google Test)
417 //
418 // This header file defines the GTEST_OS_* macro.
419 // It is separate from gtest-port.h so that custom/gtest-port.h can include it.
420 
421 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
422 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
423 
424 // Determines the platform on which Google Test is compiled.
425 #ifdef __CYGWIN__
426 # define GTEST_OS_CYGWIN 1
427 #elif defined __SYMBIAN32__
428 # define GTEST_OS_SYMBIAN 1
429 #elif defined _WIN32
430 # define GTEST_OS_WINDOWS 1
431 # ifdef _WIN32_WCE
432 #  define GTEST_OS_WINDOWS_MOBILE 1
433 # elif defined(__MINGW__) || defined(__MINGW32__)
434 #  define GTEST_OS_WINDOWS_MINGW 1
435 # elif defined(WINAPI_FAMILY)
436 #  include <winapifamily.h>
437 #  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
438 #   define GTEST_OS_WINDOWS_DESKTOP 1
439 #  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
440 #   define GTEST_OS_WINDOWS_PHONE 1
441 #  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
442 #   define GTEST_OS_WINDOWS_RT 1
443 #  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)
444 #   define GTEST_OS_WINDOWS_PHONE 1
445 #   define GTEST_OS_WINDOWS_TV_TITLE 1
446 #  else
447     // WINAPI_FAMILY defined but no known partition matched.
448     // Default to desktop.
449 #   define GTEST_OS_WINDOWS_DESKTOP 1
450 #  endif
451 # else
452 #  define GTEST_OS_WINDOWS_DESKTOP 1
453 # endif  // _WIN32_WCE
454 #elif defined __APPLE__
455 # define GTEST_OS_MAC 1
456 # if TARGET_OS_IPHONE
457 #  define GTEST_OS_IOS 1
458 # endif
459 #elif defined __FreeBSD__
460 # define GTEST_OS_FREEBSD 1
461 #elif defined __Fuchsia__
462 # define GTEST_OS_FUCHSIA 1
463 #elif defined __linux__
464 # define GTEST_OS_LINUX 1
465 # if defined __ANDROID__
466 #  define GTEST_OS_LINUX_ANDROID 1
467 # endif
468 #elif defined __MVS__
469 # define GTEST_OS_ZOS 1
470 #elif defined(__sun) && defined(__SVR4)
471 # define GTEST_OS_SOLARIS 1
472 #elif defined(_AIX)
473 # define GTEST_OS_AIX 1
474 #elif defined(__hpux)
475 # define GTEST_OS_HPUX 1
476 #elif defined __native_client__
477 # define GTEST_OS_NACL 1
478 #elif defined __NetBSD__
479 # define GTEST_OS_NETBSD 1
480 #elif defined __OpenBSD__
481 # define GTEST_OS_OPENBSD 1
482 #elif defined __QNX__
483 # define GTEST_OS_QNX 1
484 #endif  // __CYGWIN__
485 
486 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
487 // Copyright 2015, Google Inc.
488 // All rights reserved.
489 //
490 // Redistribution and use in source and binary forms, with or without
491 // modification, are permitted provided that the following conditions are
492 // met:
493 //
494 //     * Redistributions of source code must retain the above copyright
495 // notice, this list of conditions and the following disclaimer.
496 //     * Redistributions in binary form must reproduce the above
497 // copyright notice, this list of conditions and the following disclaimer
498 // in the documentation and/or other materials provided with the
499 // distribution.
500 //     * Neither the name of Google Inc. nor the names of its
501 // contributors may be used to endorse or promote products derived from
502 // this software without specific prior written permission.
503 //
504 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
505 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
506 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
507 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
508 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
509 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
510 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
511 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
512 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
513 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
514 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
515 //
516 // Injection point for custom user configurations. See README for details
517 //
518 // ** Custom implementation starts here **
519 
520 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
521 #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
522 
523 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
524 
525 #if !defined(GTEST_DEV_EMAIL_)
526 # define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
527 # define GTEST_FLAG_PREFIX_ "gtest_"
528 # define GTEST_FLAG_PREFIX_DASH_ "gtest-"
529 # define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
530 # define GTEST_NAME_ "Google Test"
531 # define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
532 #endif  // !defined(GTEST_DEV_EMAIL_)
533 
534 #if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
535 # define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
536 #endif  // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
537 
538 // Determines the version of gcc that is used to compile this.
539 #ifdef __GNUC__
540 // 40302 means version 4.3.2.
541 # define GTEST_GCC_VER_ \
542     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
543 #endif  // __GNUC__
544 
545 // Macros for disabling Microsoft Visual C++ warnings.
546 //
547 //   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
548 //   /* code that triggers warnings C4800 and C4385 */
549 //   GTEST_DISABLE_MSC_WARNINGS_POP_()
550 #if _MSC_VER >= 1400
551 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
552     __pragma(warning(push))                        \
553     __pragma(warning(disable: warnings))
554 # define GTEST_DISABLE_MSC_WARNINGS_POP_()          \
555     __pragma(warning(pop))
556 #else
557 // Older versions of MSVC don't have __pragma.
558 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
559 # define GTEST_DISABLE_MSC_WARNINGS_POP_()
560 #endif
561 
562 // Clang on Windows does not understand MSVC's pragma warning.
563 // We need clang-specific way to disable function deprecation warning.
564 #ifdef __clang__
565 # define GTEST_DISABLE_MSC_DEPRECATED_PUSH_()                         \
566     _Pragma("clang diagnostic push")                                  \
567     _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
568     _Pragma("clang diagnostic ignored \"-Wdeprecated-implementations\"")
569 #define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
570     _Pragma("clang diagnostic pop")
571 #else
572 # define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
573     GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
574 # define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
575     GTEST_DISABLE_MSC_WARNINGS_POP_()
576 #endif
577 
578 #ifndef GTEST_LANG_CXX11
579 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
580 // -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
581 // value for __cplusplus, and recent versions of clang, gcc, and
582 // probably other compilers set that too in C++11 mode.
583 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L || _MSC_VER >= 1900
584 // Compiling in at least C++11 mode.
585 #  define GTEST_LANG_CXX11 1
586 # else
587 #  define GTEST_LANG_CXX11 0
588 # endif
589 #endif
590 
591 // Distinct from C++11 language support, some environments don't provide
592 // proper C++11 library support. Notably, it's possible to build in
593 // C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
594 // with no C++11 support.
595 //
596 // libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
597 // 20110325, but maintenance releases in the 4.4 and 4.5 series followed
598 // this date, so check for those versions by their date stamps.
599 // https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
600 #if GTEST_LANG_CXX11 && \
601     (!defined(__GLIBCXX__) || ( \
602         __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \
603         /* Blacklist of patch releases of older branches: */ \
604         __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \
605         __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \
606         __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \
607         __GLIBCXX__ != 20120702ul))   /* GCC 4.5.4 */
608 # define GTEST_STDLIB_CXX11 1
609 #endif
610 
611 // Only use C++11 library features if the library provides them.
612 #if GTEST_STDLIB_CXX11
613 # define GTEST_HAS_STD_BEGIN_AND_END_ 1
614 # define GTEST_HAS_STD_FORWARD_LIST_ 1
615 # if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824)
616 // works only with VS2015U2 and better
617 #   define GTEST_HAS_STD_FUNCTION_ 1
618 # endif
619 # define GTEST_HAS_STD_INITIALIZER_LIST_ 1
620 # define GTEST_HAS_STD_MOVE_ 1
621 # define GTEST_HAS_STD_UNIQUE_PTR_ 1
622 # define GTEST_HAS_STD_SHARED_PTR_ 1
623 # define GTEST_HAS_UNORDERED_MAP_ 1
624 # define GTEST_HAS_UNORDERED_SET_ 1
625 #endif
626 
627 // C++11 specifies that <tuple> provides std::tuple.
628 // Some platforms still might not have it, however.
629 #if GTEST_LANG_CXX11
630 # define GTEST_HAS_STD_TUPLE_ 1
631 # if defined(__clang__)
632 // Inspired by
633 // https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros
634 #  if defined(__has_include) && !__has_include(<tuple>)
635 #   undef GTEST_HAS_STD_TUPLE_
636 #  endif
637 # elif defined(_MSC_VER)
638 // Inspired by boost/config/stdlib/dinkumware.hpp
639 #  if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
640 #   undef GTEST_HAS_STD_TUPLE_
641 #  endif
642 # elif defined(__GLIBCXX__)
643 // Inspired by boost/config/stdlib/libstdcpp3.hpp,
644 // http://gcc.gnu.org/gcc-4.2/changes.html and
645 // https://web.archive.org/web/20140227044429/gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
646 #  if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
647 #   undef GTEST_HAS_STD_TUPLE_
648 #  endif
649 # endif
650 #endif
651 
652 // Brings in definitions for functions used in the testing::internal::posix
653 // namespace (read, write, close, chdir, isatty, stat). We do not currently
654 // use them on Windows Mobile.
655 #if GTEST_OS_WINDOWS
656 # if !GTEST_OS_WINDOWS_MOBILE
657 #  include <direct.h>
658 #  include <io.h>
659 # endif
660 // In order to avoid having to include <windows.h>, use forward declaration
661 #if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
662 // MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
663 // separate (equivalent) structs, instead of using typedef
664 typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
665 #else
666 // Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
667 // This assumption is verified by
668 // WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
669 typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
670 #endif
671 #else
672 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
673 // is not the case, we need to include headers that provide the functions
674 // mentioned above.
675 # include <unistd.h>
676 # include <strings.h>
677 #endif  // GTEST_OS_WINDOWS
678 
679 #if GTEST_OS_LINUX_ANDROID
680 // Used to define __ANDROID_API__ matching the target NDK API level.
681 #  include <android/api-level.h>  // NOLINT
682 #endif
683 
684 // Defines this to true iff Google Test can use POSIX regular expressions.
685 #ifndef GTEST_HAS_POSIX_RE
686 # if GTEST_OS_LINUX_ANDROID
687 // On Android, <regex.h> is only available starting with Gingerbread.
688 #  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
689 # else
690 #  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
691 # endif
692 #endif
693 
694 #if GTEST_USES_PCRE
695 // The appropriate headers have already been included.
696 
697 #elif GTEST_HAS_POSIX_RE
698 
699 // On some platforms, <regex.h> needs someone to define size_t, and
700 // won't compile otherwise.  We can #include it here as we already
701 // included <stdlib.h>, which is guaranteed to define size_t through
702 // <stddef.h>.
703 # include <regex.h>  // NOLINT
704 
705 # define GTEST_USES_POSIX_RE 1
706 
707 #elif GTEST_OS_WINDOWS
708 
709 // <regex.h> is not available on Windows.  Use our own simple regex
710 // implementation instead.
711 # define GTEST_USES_SIMPLE_RE 1
712 
713 #else
714 
715 // <regex.h> may not be available on this platform.  Use our own
716 // simple regex implementation instead.
717 # define GTEST_USES_SIMPLE_RE 1
718 
719 #endif  // GTEST_USES_PCRE
720 
721 #ifndef GTEST_HAS_EXCEPTIONS
722 // The user didn't tell us whether exceptions are enabled, so we need
723 // to figure it out.
724 # if defined(_MSC_VER) && defined(_CPPUNWIND)
725 // MSVC defines _CPPUNWIND to 1 iff exceptions are enabled.
726 #  define GTEST_HAS_EXCEPTIONS 1
727 # elif defined(__BORLANDC__)
728 // C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS
729 // macro to enable exceptions, so we'll do the same.
730 // Assumes that exceptions are enabled by default.
731 #  ifndef _HAS_EXCEPTIONS
732 #   define _HAS_EXCEPTIONS 1
733 #  endif  // _HAS_EXCEPTIONS
734 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
735 # elif defined(__clang__)
736 // clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
737 // but iff cleanups are enabled after that. In Obj-C++ files, there can be
738 // cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
739 // are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
740 // exceptions starting at clang r206352, but which checked for cleanups prior to
741 // that. To reliably check for C++ exception availability with clang, check for
742 // __EXCEPTIONS && __has_feature(cxx_exceptions).
743 #  define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
744 # elif defined(__GNUC__) && __EXCEPTIONS
745 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
746 #  define GTEST_HAS_EXCEPTIONS 1
747 # elif defined(__SUNPRO_CC)
748 // Sun Pro CC supports exceptions.  However, there is no compile-time way of
749 // detecting whether they are enabled or not.  Therefore, we assume that
750 // they are enabled unless the user tells us otherwise.
751 #  define GTEST_HAS_EXCEPTIONS 1
752 # elif defined(__IBMCPP__) && __EXCEPTIONS
753 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
754 #  define GTEST_HAS_EXCEPTIONS 1
755 # elif defined(__HP_aCC)
756 // Exception handling is in effect by default in HP aCC compiler. It has to
757 // be turned of by +noeh compiler option if desired.
758 #  define GTEST_HAS_EXCEPTIONS 1
759 # else
760 // For other compilers, we assume exceptions are disabled to be
761 // conservative.
762 #  define GTEST_HAS_EXCEPTIONS 0
763 # endif  // defined(_MSC_VER) || defined(__BORLANDC__)
764 #endif  // GTEST_HAS_EXCEPTIONS
765 
766 #if !defined(GTEST_HAS_STD_STRING)
767 // Even though we don't use this macro any longer, we keep it in case
768 // some clients still depend on it.
769 # define GTEST_HAS_STD_STRING 1
770 #elif !GTEST_HAS_STD_STRING
771 // The user told us that ::std::string isn't available.
772 # error "::std::string isn't available."
773 #endif  // !defined(GTEST_HAS_STD_STRING)
774 
775 #ifndef GTEST_HAS_GLOBAL_STRING
776 # define GTEST_HAS_GLOBAL_STRING 0
777 #endif  // GTEST_HAS_GLOBAL_STRING
778 
779 #ifndef GTEST_HAS_STD_WSTRING
780 // The user didn't tell us whether ::std::wstring is available, so we need
781 // to figure it out.
782 // FIXME: uses autoconf to detect whether ::std::wstring
783 //   is available.
784 
785 // Cygwin 1.7 and below doesn't support ::std::wstring.
786 // Solaris' libc++ doesn't support it either.  Android has
787 // no support for it at least as recent as Froyo (2.2).
788 # define GTEST_HAS_STD_WSTRING \
789     (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
790 
791 #endif  // GTEST_HAS_STD_WSTRING
792 
793 #ifndef GTEST_HAS_GLOBAL_WSTRING
794 // The user didn't tell us whether ::wstring is available, so we need
795 // to figure it out.
796 # define GTEST_HAS_GLOBAL_WSTRING \
797     (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
798 #endif  // GTEST_HAS_GLOBAL_WSTRING
799 
800 // Determines whether RTTI is available.
801 #ifndef GTEST_HAS_RTTI
802 // The user didn't tell us whether RTTI is enabled, so we need to
803 // figure it out.
804 
805 # ifdef _MSC_VER
806 
807 #  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
808 #   define GTEST_HAS_RTTI 1
809 #  else
810 #   define GTEST_HAS_RTTI 0
811 #  endif
812 
813 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
814 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
815 
816 #  ifdef __GXX_RTTI
817 // When building against STLport with the Android NDK and with
818 // -frtti -fno-exceptions, the build fails at link time with undefined
819 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
820 // so disable RTTI when detected.
821 #   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
822        !defined(__EXCEPTIONS)
823 #    define GTEST_HAS_RTTI 0
824 #   else
825 #    define GTEST_HAS_RTTI 1
826 #   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
827 #  else
828 #   define GTEST_HAS_RTTI 0
829 #  endif  // __GXX_RTTI
830 
831 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
832 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
833 // first version with C++ support.
834 # elif defined(__clang__)
835 
836 #  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
837 
838 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
839 // both the typeid and dynamic_cast features are present.
840 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
841 
842 #  ifdef __RTTI_ALL__
843 #   define GTEST_HAS_RTTI 1
844 #  else
845 #   define GTEST_HAS_RTTI 0
846 #  endif
847 
848 # else
849 
850 // For all other compilers, we assume RTTI is enabled.
851 #  define GTEST_HAS_RTTI 1
852 
853 # endif  // _MSC_VER
854 
855 #endif  // GTEST_HAS_RTTI
856 
857 // It's this header's responsibility to #include <typeinfo> when RTTI
858 // is enabled.
859 #if GTEST_HAS_RTTI
860 # include <typeinfo>
861 #endif
862 
863 // Determines whether Google Test can use the pthreads library.
864 #ifndef GTEST_HAS_PTHREAD
865 // The user didn't tell us explicitly, so we make reasonable assumptions about
866 // which platforms have pthreads support.
867 //
868 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
869 // to your compiler flags.
870 #define GTEST_HAS_PTHREAD                                             \
871   (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
872    GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
873 #endif  // GTEST_HAS_PTHREAD
874 
875 #if GTEST_HAS_PTHREAD
876 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
877 // true.
878 # include <pthread.h>  // NOLINT
879 
880 // For timespec and nanosleep, used below.
881 # include <time.h>  // NOLINT
882 #endif
883 
884 // Determines if hash_map/hash_set are available.
885 // Only used for testing against those containers.
886 #if !defined(GTEST_HAS_HASH_MAP_)
887 # if defined(_MSC_VER) && (_MSC_VER < 1900)
888 #  define GTEST_HAS_HASH_MAP_ 1  // Indicates that hash_map is available.
889 #  define GTEST_HAS_HASH_SET_ 1  // Indicates that hash_set is available.
890 # endif  // _MSC_VER
891 #endif  // !defined(GTEST_HAS_HASH_MAP_)
892 
893 // Determines whether Google Test can use tr1/tuple.  You can define
894 // this macro to 0 to prevent Google Test from using tuple (any
895 // feature depending on tuple with be disabled in this mode).
896 #ifndef GTEST_HAS_TR1_TUPLE
897 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
898 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
899 #  define GTEST_HAS_TR1_TUPLE 0
900 # elif defined(_MSC_VER) && (_MSC_VER >= 1910)
901 // Prevent `warning C4996: 'std::tr1': warning STL4002:
902 // The non-Standard std::tr1 namespace and TR1-only machinery
903 // are deprecated and will be REMOVED.`
904 #  define GTEST_HAS_TR1_TUPLE 0
905 # elif GTEST_LANG_CXX11 && defined(_LIBCPP_VERSION)
906 // libc++ doesn't support TR1.
907 #  define GTEST_HAS_TR1_TUPLE 0
908 # else
909 // The user didn't tell us not to do it, so we assume it's OK.
910 #  define GTEST_HAS_TR1_TUPLE 1
911 # endif
912 #endif  // GTEST_HAS_TR1_TUPLE
913 
914 // Determines whether Google Test's own tr1 tuple implementation
915 // should be used.
916 #ifndef GTEST_USE_OWN_TR1_TUPLE
917 // We use our own tuple implementation on Symbian.
918 # if GTEST_OS_SYMBIAN
919 #  define GTEST_USE_OWN_TR1_TUPLE 1
920 # else
921 // The user didn't tell us, so we need to figure it out.
922 
923 // We use our own TR1 tuple if we aren't sure the user has an
924 // implementation of it already.  At this time, libstdc++ 4.0.0+ and
925 // MSVC 2010 are the only mainstream standard libraries that come
926 // with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
927 // pretends to be GCC by defining __GNUC__ and friends, but cannot
928 // compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
929 // tuple in a 323 MB Feature Pack download, which we cannot assume the
930 // user has.  QNX's QCC compiler is a modified GCC but it doesn't
931 // support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
932 // and it can be used with some compilers that define __GNUC__.
933 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
934       && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) \
935       || (_MSC_VER >= 1600 && _MSC_VER < 1900)
936 #  define GTEST_ENV_HAS_TR1_TUPLE_ 1
937 # endif
938 
939 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
940 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
941 // can build with clang but need to use gcc4.2's libstdc++).
942 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
943 #  define GTEST_ENV_HAS_STD_TUPLE_ 1
944 # endif
945 
946 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
947 #  define GTEST_USE_OWN_TR1_TUPLE 0
948 # else
949 #  define GTEST_USE_OWN_TR1_TUPLE 1
950 # endif
951 # endif  // GTEST_OS_SYMBIAN
952 #endif  // GTEST_USE_OWN_TR1_TUPLE
953 
954 // To avoid conditional compilation we make it gtest-port.h's responsibility
955 // to #include the header implementing tuple.
956 #if GTEST_HAS_STD_TUPLE_
957 # include <tuple>  // IWYU pragma: export
958 # define GTEST_TUPLE_NAMESPACE_ ::std
959 #endif  // GTEST_HAS_STD_TUPLE_
960 
961 // We include tr1::tuple even if std::tuple is available to define printers for
962 // them.
963 #if GTEST_HAS_TR1_TUPLE
964 # ifndef GTEST_TUPLE_NAMESPACE_
965 #  define GTEST_TUPLE_NAMESPACE_ ::std::tr1
966 # endif  // GTEST_TUPLE_NAMESPACE_
967 
968 # if GTEST_USE_OWN_TR1_TUPLE
969 // This file was GENERATED by command:
970 //     pump.py gtest-tuple.h.pump
971 // DO NOT EDIT BY HAND!!!
972 
973 // Copyright 2009 Google Inc.
974 // All Rights Reserved.
975 //
976 // Redistribution and use in source and binary forms, with or without
977 // modification, are permitted provided that the following conditions are
978 // met:
979 //
980 //     * Redistributions of source code must retain the above copyright
981 // notice, this list of conditions and the following disclaimer.
982 //     * Redistributions in binary form must reproduce the above
983 // copyright notice, this list of conditions and the following disclaimer
984 // in the documentation and/or other materials provided with the
985 // distribution.
986 //     * Neither the name of Google Inc. nor the names of its
987 // contributors may be used to endorse or promote products derived from
988 // this software without specific prior written permission.
989 //
990 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
991 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
992 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
993 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
994 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
995 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
996 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
997 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
998 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
999 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1000 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1001 
1002 
1003 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
1004 
1005 // GOOGLETEST_CM0001 DO NOT DELETE
1006 
1007 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1008 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1009 
1010 #include <utility>  // For ::std::pair.
1011 
1012 // The compiler used in Symbian has a bug that prevents us from declaring the
1013 // tuple template as a friend (it complains that tuple is redefined).  This
1014 // bypasses the bug by declaring the members that should otherwise be
1015 // private as public.
1016 // Sun Studio versions < 12 also have the above bug.
1017 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
1018 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
1019 #else
1020 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
1021     template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
1022    private:
1023 #endif
1024 
1025 // Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
1026 // with our own definitions. Therefore using our own tuple does not work on
1027 // those compilers.
1028 #if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */
1029 # error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
1030 GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
1031 #endif
1032 
1033 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
1034 #define GTEST_0_TUPLE_(T) tuple<>
1035 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
1036     void, void, void>
1037 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
1038     void, void, void>
1039 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
1040     void, void, void>
1041 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
1042     void, void, void>
1043 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
1044     void, void, void>
1045 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
1046     void, void, void>
1047 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1048     void, void, void>
1049 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1050     T##7, void, void>
1051 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1052     T##7, T##8, void>
1053 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1054     T##7, T##8, T##9>
1055 
1056 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
1057 #define GTEST_0_TYPENAMES_(T)
1058 #define GTEST_1_TYPENAMES_(T) typename T##0
1059 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
1060 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
1061 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1062     typename T##3
1063 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1064     typename T##3, typename T##4
1065 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1066     typename T##3, typename T##4, typename T##5
1067 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1068     typename T##3, typename T##4, typename T##5, typename T##6
1069 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1070     typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
1071 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1072     typename T##3, typename T##4, typename T##5, typename T##6, \
1073     typename T##7, typename T##8
1074 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1075     typename T##3, typename T##4, typename T##5, typename T##6, \
1076     typename T##7, typename T##8, typename T##9
1077 
1078 // In theory, defining stuff in the ::std namespace is undefined
1079 // behavior.  We can do this as we are playing the role of a standard
1080 // library vendor.
1081 namespace std {
1082 namespace tr1 {
1083 
1084 template <typename T0 = void, typename T1 = void, typename T2 = void,
1085     typename T3 = void, typename T4 = void, typename T5 = void,
1086     typename T6 = void, typename T7 = void, typename T8 = void,
1087     typename T9 = void>
1088 class tuple;
1089 
1090 // Anything in namespace gtest_internal is Google Test's INTERNAL
1091 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
1092 namespace gtest_internal {
1093 
1094 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
1095 template <typename T>
1096 struct ByRef { typedef const T& type; };  // NOLINT
1097 template <typename T>
1098 struct ByRef<T&> { typedef T& type; };  // NOLINT
1099 
1100 // A handy wrapper for ByRef.
1101 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
1102 
1103 // AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
1104 // is the same as tr1::add_reference<T>::type.
1105 template <typename T>
1106 struct AddRef { typedef T& type; };  // NOLINT
1107 template <typename T>
1108 struct AddRef<T&> { typedef T& type; };  // NOLINT
1109 
1110 // A handy wrapper for AddRef.
1111 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
1112 
1113 // A helper for implementing get<k>().
1114 template <int k> class Get;
1115 
1116 // A helper for implementing tuple_element<k, T>.  kIndexValid is true
1117 // iff k < the number of fields in tuple type T.
1118 template <bool kIndexValid, int kIndex, class Tuple>
1119 struct TupleElement;
1120 
1121 template <GTEST_10_TYPENAMES_(T)>
1122 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
1123   typedef T0 type;
1124 };
1125 
1126 template <GTEST_10_TYPENAMES_(T)>
1127 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
1128   typedef T1 type;
1129 };
1130 
1131 template <GTEST_10_TYPENAMES_(T)>
1132 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
1133   typedef T2 type;
1134 };
1135 
1136 template <GTEST_10_TYPENAMES_(T)>
1137 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
1138   typedef T3 type;
1139 };
1140 
1141 template <GTEST_10_TYPENAMES_(T)>
1142 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
1143   typedef T4 type;
1144 };
1145 
1146 template <GTEST_10_TYPENAMES_(T)>
1147 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
1148   typedef T5 type;
1149 };
1150 
1151 template <GTEST_10_TYPENAMES_(T)>
1152 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
1153   typedef T6 type;
1154 };
1155 
1156 template <GTEST_10_TYPENAMES_(T)>
1157 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
1158   typedef T7 type;
1159 };
1160 
1161 template <GTEST_10_TYPENAMES_(T)>
1162 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
1163   typedef T8 type;
1164 };
1165 
1166 template <GTEST_10_TYPENAMES_(T)>
1167 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
1168   typedef T9 type;
1169 };
1170 
1171 }  // namespace gtest_internal
1172 
1173 template <>
1174 class tuple<> {
1175  public:
1176   tuple() {}
1177   tuple(const tuple& /* t */)  {}
1178   tuple& operator=(const tuple& /* t */) { return *this; }
1179 };
1180 
1181 template <GTEST_1_TYPENAMES_(T)>
1182 class GTEST_1_TUPLE_(T) {
1183  public:
1184   template <int k> friend class gtest_internal::Get;
1185 
1186   tuple() : f0_() {}
1187 
1188   explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
1189 
1190   tuple(const tuple& t) : f0_(t.f0_) {}
1191 
1192   template <GTEST_1_TYPENAMES_(U)>
1193   tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
1194 
1195   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1196 
1197   template <GTEST_1_TYPENAMES_(U)>
1198   tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
1199     return CopyFrom(t);
1200   }
1201 
1202   GTEST_DECLARE_TUPLE_AS_FRIEND_
1203 
1204   template <GTEST_1_TYPENAMES_(U)>
1205   tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
1206     f0_ = t.f0_;
1207     return *this;
1208   }
1209 
1210   T0 f0_;
1211 };
1212 
1213 template <GTEST_2_TYPENAMES_(T)>
1214 class GTEST_2_TUPLE_(T) {
1215  public:
1216   template <int k> friend class gtest_internal::Get;
1217 
1218   tuple() : f0_(), f1_() {}
1219 
1220   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
1221       f1_(f1) {}
1222 
1223   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
1224 
1225   template <GTEST_2_TYPENAMES_(U)>
1226   tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
1227   template <typename U0, typename U1>
1228   tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
1229 
1230   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1231 
1232   template <GTEST_2_TYPENAMES_(U)>
1233   tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
1234     return CopyFrom(t);
1235   }
1236   template <typename U0, typename U1>
1237   tuple& operator=(const ::std::pair<U0, U1>& p) {
1238     f0_ = p.first;
1239     f1_ = p.second;
1240     return *this;
1241   }
1242 
1243   GTEST_DECLARE_TUPLE_AS_FRIEND_
1244 
1245   template <GTEST_2_TYPENAMES_(U)>
1246   tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
1247     f0_ = t.f0_;
1248     f1_ = t.f1_;
1249     return *this;
1250   }
1251 
1252   T0 f0_;
1253   T1 f1_;
1254 };
1255 
1256 template <GTEST_3_TYPENAMES_(T)>
1257 class GTEST_3_TUPLE_(T) {
1258  public:
1259   template <int k> friend class gtest_internal::Get;
1260 
1261   tuple() : f0_(), f1_(), f2_() {}
1262 
1263   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1264       GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
1265 
1266   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
1267 
1268   template <GTEST_3_TYPENAMES_(U)>
1269   tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
1270 
1271   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1272 
1273   template <GTEST_3_TYPENAMES_(U)>
1274   tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
1275     return CopyFrom(t);
1276   }
1277 
1278   GTEST_DECLARE_TUPLE_AS_FRIEND_
1279 
1280   template <GTEST_3_TYPENAMES_(U)>
1281   tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
1282     f0_ = t.f0_;
1283     f1_ = t.f1_;
1284     f2_ = t.f2_;
1285     return *this;
1286   }
1287 
1288   T0 f0_;
1289   T1 f1_;
1290   T2 f2_;
1291 };
1292 
1293 template <GTEST_4_TYPENAMES_(T)>
1294 class GTEST_4_TUPLE_(T) {
1295  public:
1296   template <int k> friend class gtest_internal::Get;
1297 
1298   tuple() : f0_(), f1_(), f2_(), f3_() {}
1299 
1300   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1301       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
1302       f3_(f3) {}
1303 
1304   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
1305 
1306   template <GTEST_4_TYPENAMES_(U)>
1307   tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1308       f3_(t.f3_) {}
1309 
1310   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1311 
1312   template <GTEST_4_TYPENAMES_(U)>
1313   tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
1314     return CopyFrom(t);
1315   }
1316 
1317   GTEST_DECLARE_TUPLE_AS_FRIEND_
1318 
1319   template <GTEST_4_TYPENAMES_(U)>
1320   tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
1321     f0_ = t.f0_;
1322     f1_ = t.f1_;
1323     f2_ = t.f2_;
1324     f3_ = t.f3_;
1325     return *this;
1326   }
1327 
1328   T0 f0_;
1329   T1 f1_;
1330   T2 f2_;
1331   T3 f3_;
1332 };
1333 
1334 template <GTEST_5_TYPENAMES_(T)>
1335 class GTEST_5_TUPLE_(T) {
1336  public:
1337   template <int k> friend class gtest_internal::Get;
1338 
1339   tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1340 
1341   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1342       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1343       GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1344 
1345   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1346       f4_(t.f4_) {}
1347 
1348   template <GTEST_5_TYPENAMES_(U)>
1349   tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1350       f3_(t.f3_), f4_(t.f4_) {}
1351 
1352   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1353 
1354   template <GTEST_5_TYPENAMES_(U)>
1355   tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1356     return CopyFrom(t);
1357   }
1358 
1359   GTEST_DECLARE_TUPLE_AS_FRIEND_
1360 
1361   template <GTEST_5_TYPENAMES_(U)>
1362   tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1363     f0_ = t.f0_;
1364     f1_ = t.f1_;
1365     f2_ = t.f2_;
1366     f3_ = t.f3_;
1367     f4_ = t.f4_;
1368     return *this;
1369   }
1370 
1371   T0 f0_;
1372   T1 f1_;
1373   T2 f2_;
1374   T3 f3_;
1375   T4 f4_;
1376 };
1377 
1378 template <GTEST_6_TYPENAMES_(T)>
1379 class GTEST_6_TUPLE_(T) {
1380  public:
1381   template <int k> friend class gtest_internal::Get;
1382 
1383   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1384 
1385   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1386       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1387       GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1388       f5_(f5) {}
1389 
1390   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1391       f4_(t.f4_), f5_(t.f5_) {}
1392 
1393   template <GTEST_6_TYPENAMES_(U)>
1394   tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1395       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1396 
1397   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1398 
1399   template <GTEST_6_TYPENAMES_(U)>
1400   tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1401     return CopyFrom(t);
1402   }
1403 
1404   GTEST_DECLARE_TUPLE_AS_FRIEND_
1405 
1406   template <GTEST_6_TYPENAMES_(U)>
1407   tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1408     f0_ = t.f0_;
1409     f1_ = t.f1_;
1410     f2_ = t.f2_;
1411     f3_ = t.f3_;
1412     f4_ = t.f4_;
1413     f5_ = t.f5_;
1414     return *this;
1415   }
1416 
1417   T0 f0_;
1418   T1 f1_;
1419   T2 f2_;
1420   T3 f3_;
1421   T4 f4_;
1422   T5 f5_;
1423 };
1424 
1425 template <GTEST_7_TYPENAMES_(T)>
1426 class GTEST_7_TUPLE_(T) {
1427  public:
1428   template <int k> friend class gtest_internal::Get;
1429 
1430   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1431 
1432   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1433       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1434       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1435       f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1436 
1437   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1438       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1439 
1440   template <GTEST_7_TYPENAMES_(U)>
1441   tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1442       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1443 
1444   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1445 
1446   template <GTEST_7_TYPENAMES_(U)>
1447   tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1448     return CopyFrom(t);
1449   }
1450 
1451   GTEST_DECLARE_TUPLE_AS_FRIEND_
1452 
1453   template <GTEST_7_TYPENAMES_(U)>
1454   tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1455     f0_ = t.f0_;
1456     f1_ = t.f1_;
1457     f2_ = t.f2_;
1458     f3_ = t.f3_;
1459     f4_ = t.f4_;
1460     f5_ = t.f5_;
1461     f6_ = t.f6_;
1462     return *this;
1463   }
1464 
1465   T0 f0_;
1466   T1 f1_;
1467   T2 f2_;
1468   T3 f3_;
1469   T4 f4_;
1470   T5 f5_;
1471   T6 f6_;
1472 };
1473 
1474 template <GTEST_8_TYPENAMES_(T)>
1475 class GTEST_8_TUPLE_(T) {
1476  public:
1477   template <int k> friend class gtest_internal::Get;
1478 
1479   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1480 
1481   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1482       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1483       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1484       GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1485       f5_(f5), f6_(f6), f7_(f7) {}
1486 
1487   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1488       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1489 
1490   template <GTEST_8_TYPENAMES_(U)>
1491   tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1492       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1493 
1494   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1495 
1496   template <GTEST_8_TYPENAMES_(U)>
1497   tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1498     return CopyFrom(t);
1499   }
1500 
1501   GTEST_DECLARE_TUPLE_AS_FRIEND_
1502 
1503   template <GTEST_8_TYPENAMES_(U)>
1504   tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1505     f0_ = t.f0_;
1506     f1_ = t.f1_;
1507     f2_ = t.f2_;
1508     f3_ = t.f3_;
1509     f4_ = t.f4_;
1510     f5_ = t.f5_;
1511     f6_ = t.f6_;
1512     f7_ = t.f7_;
1513     return *this;
1514   }
1515 
1516   T0 f0_;
1517   T1 f1_;
1518   T2 f2_;
1519   T3 f3_;
1520   T4 f4_;
1521   T5 f5_;
1522   T6 f6_;
1523   T7 f7_;
1524 };
1525 
1526 template <GTEST_9_TYPENAMES_(T)>
1527 class GTEST_9_TUPLE_(T) {
1528  public:
1529   template <int k> friend class gtest_internal::Get;
1530 
1531   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1532 
1533   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1534       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1535       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1536       GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1537       f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1538 
1539   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1540       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1541 
1542   template <GTEST_9_TYPENAMES_(U)>
1543   tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1544       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1545 
1546   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1547 
1548   template <GTEST_9_TYPENAMES_(U)>
1549   tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1550     return CopyFrom(t);
1551   }
1552 
1553   GTEST_DECLARE_TUPLE_AS_FRIEND_
1554 
1555   template <GTEST_9_TYPENAMES_(U)>
1556   tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1557     f0_ = t.f0_;
1558     f1_ = t.f1_;
1559     f2_ = t.f2_;
1560     f3_ = t.f3_;
1561     f4_ = t.f4_;
1562     f5_ = t.f5_;
1563     f6_ = t.f6_;
1564     f7_ = t.f7_;
1565     f8_ = t.f8_;
1566     return *this;
1567   }
1568 
1569   T0 f0_;
1570   T1 f1_;
1571   T2 f2_;
1572   T3 f3_;
1573   T4 f4_;
1574   T5 f5_;
1575   T6 f6_;
1576   T7 f7_;
1577   T8 f8_;
1578 };
1579 
1580 template <GTEST_10_TYPENAMES_(T)>
1581 class tuple {
1582  public:
1583   template <int k> friend class gtest_internal::Get;
1584 
1585   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1586       f9_() {}
1587 
1588   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1589       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1590       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1591       GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1592       f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1593 
1594   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1595       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1596 
1597   template <GTEST_10_TYPENAMES_(U)>
1598   tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1599       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1600       f9_(t.f9_) {}
1601 
1602   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1603 
1604   template <GTEST_10_TYPENAMES_(U)>
1605   tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1606     return CopyFrom(t);
1607   }
1608 
1609   GTEST_DECLARE_TUPLE_AS_FRIEND_
1610 
1611   template <GTEST_10_TYPENAMES_(U)>
1612   tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1613     f0_ = t.f0_;
1614     f1_ = t.f1_;
1615     f2_ = t.f2_;
1616     f3_ = t.f3_;
1617     f4_ = t.f4_;
1618     f5_ = t.f5_;
1619     f6_ = t.f6_;
1620     f7_ = t.f7_;
1621     f8_ = t.f8_;
1622     f9_ = t.f9_;
1623     return *this;
1624   }
1625 
1626   T0 f0_;
1627   T1 f1_;
1628   T2 f2_;
1629   T3 f3_;
1630   T4 f4_;
1631   T5 f5_;
1632   T6 f6_;
1633   T7 f7_;
1634   T8 f8_;
1635   T9 f9_;
1636 };
1637 
1638 // 6.1.3.2 Tuple creation functions.
1639 
1640 // Known limitations: we don't support passing an
1641 // std::tr1::reference_wrapper<T> to make_tuple().  And we don't
1642 // implement tie().
1643 
1644 inline tuple<> make_tuple() { return tuple<>(); }
1645 
1646 template <GTEST_1_TYPENAMES_(T)>
1647 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1648   return GTEST_1_TUPLE_(T)(f0);
1649 }
1650 
1651 template <GTEST_2_TYPENAMES_(T)>
1652 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1653   return GTEST_2_TUPLE_(T)(f0, f1);
1654 }
1655 
1656 template <GTEST_3_TYPENAMES_(T)>
1657 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1658   return GTEST_3_TUPLE_(T)(f0, f1, f2);
1659 }
1660 
1661 template <GTEST_4_TYPENAMES_(T)>
1662 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1663     const T3& f3) {
1664   return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1665 }
1666 
1667 template <GTEST_5_TYPENAMES_(T)>
1668 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1669     const T3& f3, const T4& f4) {
1670   return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1671 }
1672 
1673 template <GTEST_6_TYPENAMES_(T)>
1674 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1675     const T3& f3, const T4& f4, const T5& f5) {
1676   return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1677 }
1678 
1679 template <GTEST_7_TYPENAMES_(T)>
1680 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1681     const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1682   return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1683 }
1684 
1685 template <GTEST_8_TYPENAMES_(T)>
1686 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1687     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1688   return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1689 }
1690 
1691 template <GTEST_9_TYPENAMES_(T)>
1692 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1693     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1694     const T8& f8) {
1695   return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1696 }
1697 
1698 template <GTEST_10_TYPENAMES_(T)>
1699 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1700     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1701     const T8& f8, const T9& f9) {
1702   return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1703 }
1704 
1705 // 6.1.3.3 Tuple helper classes.
1706 
1707 template <typename Tuple> struct tuple_size;
1708 
1709 template <GTEST_0_TYPENAMES_(T)>
1710 struct tuple_size<GTEST_0_TUPLE_(T) > {
1711   static const int value = 0;
1712 };
1713 
1714 template <GTEST_1_TYPENAMES_(T)>
1715 struct tuple_size<GTEST_1_TUPLE_(T) > {
1716   static const int value = 1;
1717 };
1718 
1719 template <GTEST_2_TYPENAMES_(T)>
1720 struct tuple_size<GTEST_2_TUPLE_(T) > {
1721   static const int value = 2;
1722 };
1723 
1724 template <GTEST_3_TYPENAMES_(T)>
1725 struct tuple_size<GTEST_3_TUPLE_(T) > {
1726   static const int value = 3;
1727 };
1728 
1729 template <GTEST_4_TYPENAMES_(T)>
1730 struct tuple_size<GTEST_4_TUPLE_(T) > {
1731   static const int value = 4;
1732 };
1733 
1734 template <GTEST_5_TYPENAMES_(T)>
1735 struct tuple_size<GTEST_5_TUPLE_(T) > {
1736   static const int value = 5;
1737 };
1738 
1739 template <GTEST_6_TYPENAMES_(T)>
1740 struct tuple_size<GTEST_6_TUPLE_(T) > {
1741   static const int value = 6;
1742 };
1743 
1744 template <GTEST_7_TYPENAMES_(T)>
1745 struct tuple_size<GTEST_7_TUPLE_(T) > {
1746   static const int value = 7;
1747 };
1748 
1749 template <GTEST_8_TYPENAMES_(T)>
1750 struct tuple_size<GTEST_8_TUPLE_(T) > {
1751   static const int value = 8;
1752 };
1753 
1754 template <GTEST_9_TYPENAMES_(T)>
1755 struct tuple_size<GTEST_9_TUPLE_(T) > {
1756   static const int value = 9;
1757 };
1758 
1759 template <GTEST_10_TYPENAMES_(T)>
1760 struct tuple_size<GTEST_10_TUPLE_(T) > {
1761   static const int value = 10;
1762 };
1763 
1764 template <int k, class Tuple>
1765 struct tuple_element {
1766   typedef typename gtest_internal::TupleElement<
1767       k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1768 };
1769 
1770 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1771 
1772 // 6.1.3.4 Element access.
1773 
1774 namespace gtest_internal {
1775 
1776 template <>
1777 class Get<0> {
1778  public:
1779   template <class Tuple>
1780   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1781   Field(Tuple& t) { return t.f0_; }  // NOLINT
1782 
1783   template <class Tuple>
1784   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1785   ConstField(const Tuple& t) { return t.f0_; }
1786 };
1787 
1788 template <>
1789 class Get<1> {
1790  public:
1791   template <class Tuple>
1792   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1793   Field(Tuple& t) { return t.f1_; }  // NOLINT
1794 
1795   template <class Tuple>
1796   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1797   ConstField(const Tuple& t) { return t.f1_; }
1798 };
1799 
1800 template <>
1801 class Get<2> {
1802  public:
1803   template <class Tuple>
1804   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1805   Field(Tuple& t) { return t.f2_; }  // NOLINT
1806 
1807   template <class Tuple>
1808   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1809   ConstField(const Tuple& t) { return t.f2_; }
1810 };
1811 
1812 template <>
1813 class Get<3> {
1814  public:
1815   template <class Tuple>
1816   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1817   Field(Tuple& t) { return t.f3_; }  // NOLINT
1818 
1819   template <class Tuple>
1820   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1821   ConstField(const Tuple& t) { return t.f3_; }
1822 };
1823 
1824 template <>
1825 class Get<4> {
1826  public:
1827   template <class Tuple>
1828   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1829   Field(Tuple& t) { return t.f4_; }  // NOLINT
1830 
1831   template <class Tuple>
1832   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1833   ConstField(const Tuple& t) { return t.f4_; }
1834 };
1835 
1836 template <>
1837 class Get<5> {
1838  public:
1839   template <class Tuple>
1840   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1841   Field(Tuple& t) { return t.f5_; }  // NOLINT
1842 
1843   template <class Tuple>
1844   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1845   ConstField(const Tuple& t) { return t.f5_; }
1846 };
1847 
1848 template <>
1849 class Get<6> {
1850  public:
1851   template <class Tuple>
1852   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1853   Field(Tuple& t) { return t.f6_; }  // NOLINT
1854 
1855   template <class Tuple>
1856   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1857   ConstField(const Tuple& t) { return t.f6_; }
1858 };
1859 
1860 template <>
1861 class Get<7> {
1862  public:
1863   template <class Tuple>
1864   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1865   Field(Tuple& t) { return t.f7_; }  // NOLINT
1866 
1867   template <class Tuple>
1868   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1869   ConstField(const Tuple& t) { return t.f7_; }
1870 };
1871 
1872 template <>
1873 class Get<8> {
1874  public:
1875   template <class Tuple>
1876   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1877   Field(Tuple& t) { return t.f8_; }  // NOLINT
1878 
1879   template <class Tuple>
1880   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1881   ConstField(const Tuple& t) { return t.f8_; }
1882 };
1883 
1884 template <>
1885 class Get<9> {
1886  public:
1887   template <class Tuple>
1888   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1889   Field(Tuple& t) { return t.f9_; }  // NOLINT
1890 
1891   template <class Tuple>
1892   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1893   ConstField(const Tuple& t) { return t.f9_; }
1894 };
1895 
1896 }  // namespace gtest_internal
1897 
1898 template <int k, GTEST_10_TYPENAMES_(T)>
1899 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1900 get(GTEST_10_TUPLE_(T)& t) {
1901   return gtest_internal::Get<k>::Field(t);
1902 }
1903 
1904 template <int k, GTEST_10_TYPENAMES_(T)>
1905 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
1906 get(const GTEST_10_TUPLE_(T)& t) {
1907   return gtest_internal::Get<k>::ConstField(t);
1908 }
1909 
1910 // 6.1.3.5 Relational operators
1911 
1912 // We only implement == and !=, as we don't have a need for the rest yet.
1913 
1914 namespace gtest_internal {
1915 
1916 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1917 // first k fields of t1 equals the first k fields of t2.
1918 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1919 // k1 != k2.
1920 template <int kSize1, int kSize2>
1921 struct SameSizeTuplePrefixComparator;
1922 
1923 template <>
1924 struct SameSizeTuplePrefixComparator<0, 0> {
1925   template <class Tuple1, class Tuple2>
1926   static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1927     return true;
1928   }
1929 };
1930 
1931 template <int k>
1932 struct SameSizeTuplePrefixComparator<k, k> {
1933   template <class Tuple1, class Tuple2>
1934   static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1935     return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1936         ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1937   }
1938 };
1939 
1940 }  // namespace gtest_internal
1941 
1942 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1943 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1944                        const GTEST_10_TUPLE_(U)& u) {
1945   return gtest_internal::SameSizeTuplePrefixComparator<
1946       tuple_size<GTEST_10_TUPLE_(T) >::value,
1947       tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
1948 }
1949 
1950 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1951 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1952                        const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1953 
1954 // 6.1.4 Pairs.
1955 // Unimplemented.
1956 
1957 }  // namespace tr1
1958 }  // namespace std
1959 
1960 #undef GTEST_0_TUPLE_
1961 #undef GTEST_1_TUPLE_
1962 #undef GTEST_2_TUPLE_
1963 #undef GTEST_3_TUPLE_
1964 #undef GTEST_4_TUPLE_
1965 #undef GTEST_5_TUPLE_
1966 #undef GTEST_6_TUPLE_
1967 #undef GTEST_7_TUPLE_
1968 #undef GTEST_8_TUPLE_
1969 #undef GTEST_9_TUPLE_
1970 #undef GTEST_10_TUPLE_
1971 
1972 #undef GTEST_0_TYPENAMES_
1973 #undef GTEST_1_TYPENAMES_
1974 #undef GTEST_2_TYPENAMES_
1975 #undef GTEST_3_TYPENAMES_
1976 #undef GTEST_4_TYPENAMES_
1977 #undef GTEST_5_TYPENAMES_
1978 #undef GTEST_6_TYPENAMES_
1979 #undef GTEST_7_TYPENAMES_
1980 #undef GTEST_8_TYPENAMES_
1981 #undef GTEST_9_TYPENAMES_
1982 #undef GTEST_10_TYPENAMES_
1983 
1984 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1985 #undef GTEST_BY_REF_
1986 #undef GTEST_ADD_REF_
1987 #undef GTEST_TUPLE_ELEMENT_
1988 
1989 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1990 # elif GTEST_OS_SYMBIAN
1991 
1992 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1993 // use STLport's tuple implementation, which unfortunately doesn't
1994 // work as the copy of STLport distributed with Symbian is incomplete.
1995 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1996 // use its own tuple implementation.
1997 #  ifdef BOOST_HAS_TR1_TUPLE
1998 #   undef BOOST_HAS_TR1_TUPLE
1999 #  endif  // BOOST_HAS_TR1_TUPLE
2000 
2001 // This prevents <boost/tr1/detail/config.hpp>, which defines
2002 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
2003 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
2004 #  include <tuple>  // IWYU pragma: export  // NOLINT
2005 
2006 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
2007 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
2008 // not conform to the TR1 spec, which requires the header to be <tuple>.
2009 
2010 #  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
2011 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
2012 // which is #included by <tr1/tuple>, to not compile when RTTI is
2013 // disabled.  _TR1_FUNCTIONAL is the header guard for
2014 // <tr1/functional>.  Hence the following #define is used to prevent
2015 // <tr1/functional> from being included.
2016 #   define _TR1_FUNCTIONAL 1
2017 #   include <tr1/tuple>
2018 #   undef _TR1_FUNCTIONAL  // Allows the user to #include
2019                         // <tr1/functional> if they choose to.
2020 #  else
2021 #   include <tr1/tuple>  // NOLINT
2022 #  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
2023 
2024 // VS 2010 now has tr1 support.
2025 # elif _MSC_VER >= 1600
2026 #  include <tuple>  // IWYU pragma: export  // NOLINT
2027 
2028 # else  // GTEST_USE_OWN_TR1_TUPLE
2029 #  include <tr1/tuple>  // IWYU pragma: export  // NOLINT
2030 # endif  // GTEST_USE_OWN_TR1_TUPLE
2031 
2032 #endif  // GTEST_HAS_TR1_TUPLE
2033 
2034 // Determines whether clone(2) is supported.
2035 // Usually it will only be available on Linux, excluding
2036 // Linux on the Itanium architecture.
2037 // Also see http://linux.die.net/man/2/clone.
2038 #ifndef GTEST_HAS_CLONE
2039 // The user didn't tell us, so we need to figure it out.
2040 
2041 # if GTEST_OS_LINUX && !defined(__ia64__)
2042 #  if GTEST_OS_LINUX_ANDROID
2043 // On Android, clone() became available at different API levels for each 32-bit
2044 // architecture.
2045 #    if defined(__LP64__) || \
2046         (defined(__arm__) && __ANDROID_API__ >= 9) || \
2047         (defined(__mips__) && __ANDROID_API__ >= 12) || \
2048         (defined(__i386__) && __ANDROID_API__ >= 17)
2049 #     define GTEST_HAS_CLONE 1
2050 #    else
2051 #     define GTEST_HAS_CLONE 0
2052 #    endif
2053 #  else
2054 #   define GTEST_HAS_CLONE 1
2055 #  endif
2056 # else
2057 #  define GTEST_HAS_CLONE 0
2058 # endif  // GTEST_OS_LINUX && !defined(__ia64__)
2059 
2060 #endif  // GTEST_HAS_CLONE
2061 
2062 // Determines whether to support stream redirection. This is used to test
2063 // output correctness and to implement death tests.
2064 #ifndef GTEST_HAS_STREAM_REDIRECTION
2065 // By default, we assume that stream redirection is supported on all
2066 // platforms except known mobile ones.
2067 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
2068     GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
2069 #  define GTEST_HAS_STREAM_REDIRECTION 0
2070 # else
2071 #  define GTEST_HAS_STREAM_REDIRECTION 1
2072 # endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
2073 #endif  // GTEST_HAS_STREAM_REDIRECTION
2074 
2075 // Determines whether to support death tests.
2076 // Google Test does not support death tests for VC 7.1 and earlier as
2077 // abort() in a VC 7.1 application compiled as GUI in debug config
2078 // pops up a dialog window that cannot be suppressed programmatically.
2079 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS ||   \
2080      (GTEST_OS_MAC && !GTEST_OS_IOS) ||                         \
2081      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) ||          \
2082      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
2083      GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || \
2084      GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)
2085 # define GTEST_HAS_DEATH_TEST 1
2086 #endif
2087 
2088 // Determines whether to support type-driven tests.
2089 
2090 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
2091 // Sun Pro CC, IBM Visual Age, and HP aCC support.
2092 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
2093     defined(__IBMCPP__) || defined(__HP_aCC)
2094 # define GTEST_HAS_TYPED_TEST 1
2095 # define GTEST_HAS_TYPED_TEST_P 1
2096 #endif
2097 
2098 // Determines whether to support Combine(). This only makes sense when
2099 // value-parameterized tests are enabled.  The implementation doesn't
2100 // work on Sun Studio since it doesn't understand templated conversion
2101 // operators.
2102 #if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)
2103 # define GTEST_HAS_COMBINE 1
2104 #endif
2105 
2106 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
2107 #define GTEST_WIDE_STRING_USES_UTF16_ \
2108     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
2109 
2110 // Determines whether test results can be streamed to a socket.
2111 #if GTEST_OS_LINUX
2112 # define GTEST_CAN_STREAM_RESULTS_ 1
2113 #endif
2114 
2115 // Defines some utility macros.
2116 
2117 // The GNU compiler emits a warning if nested "if" statements are followed by
2118 // an "else" statement and braces are not used to explicitly disambiguate the
2119 // "else" binding.  This leads to problems with code like:
2120 //
2121 //   if (gate)
2122 //     ASSERT_*(condition) << "Some message";
2123 //
2124 // The "switch (0) case 0:" idiom is used to suppress this.
2125 #ifdef __INTEL_COMPILER
2126 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
2127 #else
2128 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
2129 #endif
2130 
2131 // Use this annotation at the end of a struct/class definition to
2132 // prevent the compiler from optimizing away instances that are never
2133 // used.  This is useful when all interesting logic happens inside the
2134 // c'tor and / or d'tor.  Example:
2135 //
2136 //   struct Foo {
2137 //     Foo() { ... }
2138 //   } GTEST_ATTRIBUTE_UNUSED_;
2139 //
2140 // Also use it after a variable or parameter declaration to tell the
2141 // compiler the variable/parameter does not have to be used.
2142 #if defined(__GNUC__) && !defined(COMPILER_ICC)
2143 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
2144 #elif defined(__clang__)
2145 # if __has_attribute(unused)
2146 #  define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
2147 # endif
2148 #endif
2149 #ifndef GTEST_ATTRIBUTE_UNUSED_
2150 # define GTEST_ATTRIBUTE_UNUSED_
2151 #endif
2152 
2153 #if GTEST_LANG_CXX11
2154 # define GTEST_CXX11_EQUALS_DELETE_ = delete
2155 #else  // GTEST_LANG_CXX11
2156 # define GTEST_CXX11_EQUALS_DELETE_
2157 #endif  // GTEST_LANG_CXX11
2158 
2159 // Use this annotation before a function that takes a printf format string.
2160 #if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
2161 # if defined(__MINGW_PRINTF_FORMAT)
2162 // MinGW has two different printf implementations. Ensure the format macro
2163 // matches the selected implementation. See
2164 // https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/.
2165 #  define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
2166        __attribute__((__format__(__MINGW_PRINTF_FORMAT, string_index, \
2167                                  first_to_check)))
2168 # else
2169 #  define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
2170        __attribute__((__format__(__printf__, string_index, first_to_check)))
2171 # endif
2172 #else
2173 # define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)
2174 #endif
2175 
2176 
2177 // A macro to disallow operator=
2178 // This should be used in the private: declarations for a class.
2179 #define GTEST_DISALLOW_ASSIGN_(type) \
2180   void operator=(type const &) GTEST_CXX11_EQUALS_DELETE_
2181 
2182 // A macro to disallow copy constructor and operator=
2183 // This should be used in the private: declarations for a class.
2184 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
2185   type(type const &) GTEST_CXX11_EQUALS_DELETE_; \
2186   GTEST_DISALLOW_ASSIGN_(type)
2187 
2188 // Tell the compiler to warn about unused return values for functions declared
2189 // with this macro.  The macro should be used on function declarations
2190 // following the argument list:
2191 //
2192 //   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
2193 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
2194 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
2195 #else
2196 # define GTEST_MUST_USE_RESULT_
2197 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
2198 
2199 // MS C++ compiler emits warning when a conditional expression is compile time
2200 // constant. In some contexts this warning is false positive and needs to be
2201 // suppressed. Use the following two macros in such cases:
2202 //
2203 // GTEST_INTENTIONAL_CONST_COND_PUSH_()
2204 // while (true) {
2205 // GTEST_INTENTIONAL_CONST_COND_POP_()
2206 // }
2207 # define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
2208     GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
2209 # define GTEST_INTENTIONAL_CONST_COND_POP_() \
2210     GTEST_DISABLE_MSC_WARNINGS_POP_()
2211 
2212 // Determine whether the compiler supports Microsoft's Structured Exception
2213 // Handling.  This is supported by several Windows compilers but generally
2214 // does not exist on any other system.
2215 #ifndef GTEST_HAS_SEH
2216 // The user didn't tell us, so we need to figure it out.
2217 
2218 # if defined(_MSC_VER) || defined(__BORLANDC__)
2219 // These two compilers are known to support SEH.
2220 #  define GTEST_HAS_SEH 1
2221 # else
2222 // Assume no SEH.
2223 #  define GTEST_HAS_SEH 0
2224 # endif
2225 
2226 #define GTEST_IS_THREADSAFE \
2227     (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
2228      || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
2229      || GTEST_HAS_PTHREAD)
2230 
2231 #endif  // GTEST_HAS_SEH
2232 
2233 // GTEST_API_ qualifies all symbols that must be exported. The definitions below
2234 // are guarded by #ifndef to give embedders a chance to define GTEST_API_ in
2235 // gtest/internal/custom/gtest-port.h
2236 #ifndef GTEST_API_
2237 
2238 #ifdef _MSC_VER
2239 # if GTEST_LINKED_AS_SHARED_LIBRARY
2240 #  define GTEST_API_ __declspec(dllimport)
2241 # elif GTEST_CREATE_SHARED_LIBRARY
2242 #  define GTEST_API_ __declspec(dllexport)
2243 # endif
2244 #elif __GNUC__ >= 4 || defined(__clang__)
2245 # define GTEST_API_ __attribute__((visibility ("default")))
2246 #endif  // _MSC_VER
2247 
2248 #endif  // GTEST_API_
2249 
2250 #ifndef GTEST_API_
2251 # define GTEST_API_
2252 #endif  // GTEST_API_
2253 
2254 #ifndef GTEST_DEFAULT_DEATH_TEST_STYLE
2255 # define GTEST_DEFAULT_DEATH_TEST_STYLE  "fast"
2256 #endif  // GTEST_DEFAULT_DEATH_TEST_STYLE
2257 
2258 #ifdef __GNUC__
2259 // Ask the compiler to never inline a given function.
2260 # define GTEST_NO_INLINE_ __attribute__((noinline))
2261 #else
2262 # define GTEST_NO_INLINE_
2263 #endif
2264 
2265 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
2266 #if !defined(GTEST_HAS_CXXABI_H_)
2267 # if defined(__GLIBCXX__) || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))
2268 #  define GTEST_HAS_CXXABI_H_ 1
2269 # else
2270 #  define GTEST_HAS_CXXABI_H_ 0
2271 # endif
2272 #endif
2273 
2274 // A function level attribute to disable checking for use of uninitialized
2275 // memory when built with MemorySanitizer.
2276 #if defined(__clang__)
2277 # if __has_feature(memory_sanitizer)
2278 #  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
2279        __attribute__((no_sanitize_memory))
2280 # else
2281 #  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
2282 # endif  // __has_feature(memory_sanitizer)
2283 #else
2284 # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
2285 #endif  // __clang__
2286 
2287 // A function level attribute to disable AddressSanitizer instrumentation.
2288 #if defined(__clang__)
2289 # if __has_feature(address_sanitizer)
2290 #  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
2291        __attribute__((no_sanitize_address))
2292 # else
2293 #  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
2294 # endif  // __has_feature(address_sanitizer)
2295 #else
2296 # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
2297 #endif  // __clang__
2298 
2299 // A function level attribute to disable ThreadSanitizer instrumentation.
2300 #if defined(__clang__)
2301 # if __has_feature(thread_sanitizer)
2302 #  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
2303        __attribute__((no_sanitize_thread))
2304 # else
2305 #  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
2306 # endif  // __has_feature(thread_sanitizer)
2307 #else
2308 # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
2309 #endif  // __clang__
2310 
2311 namespace testing {
2312 
2313 class Message;
2314 
2315 #if defined(GTEST_TUPLE_NAMESPACE_)
2316 // Import tuple and friends into the ::testing namespace.
2317 // It is part of our interface, having them in ::testing allows us to change
2318 // their types as needed.
2319 using GTEST_TUPLE_NAMESPACE_::get;
2320 using GTEST_TUPLE_NAMESPACE_::make_tuple;
2321 using GTEST_TUPLE_NAMESPACE_::tuple;
2322 using GTEST_TUPLE_NAMESPACE_::tuple_size;
2323 using GTEST_TUPLE_NAMESPACE_::tuple_element;
2324 #endif  // defined(GTEST_TUPLE_NAMESPACE_)
2325 
2326 namespace internal {
2327 
2328 // A secret type that Google Test users don't know about.  It has no
2329 // definition on purpose.  Therefore it's impossible to create a
2330 // Secret object, which is what we want.
2331 class Secret;
2332 
2333 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
2334 // expression is true. For example, you could use it to verify the
2335 // size of a static array:
2336 //
2337 //   GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
2338 //                         names_incorrect_size);
2339 //
2340 // or to make sure a struct is smaller than a certain size:
2341 //
2342 //   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
2343 //
2344 // The second argument to the macro is the name of the variable. If
2345 // the expression is false, most compilers will issue a warning/error
2346 // containing the name of the variable.
2347 
2348 #if GTEST_LANG_CXX11
2349 # define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
2350 #else  // !GTEST_LANG_CXX11
2351 template <bool>
2352   struct CompileAssert {
2353 };
2354 
2355 # define GTEST_COMPILE_ASSERT_(expr, msg) \
2356   typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
2357       msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
2358 #endif  // !GTEST_LANG_CXX11
2359 
2360 // Implementation details of GTEST_COMPILE_ASSERT_:
2361 //
2362 // (In C++11, we simply use static_assert instead of the following)
2363 //
2364 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
2365 //   elements (and thus is invalid) when the expression is false.
2366 //
2367 // - The simpler definition
2368 //
2369 //    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
2370 //
2371 //   does not work, as gcc supports variable-length arrays whose sizes
2372 //   are determined at run-time (this is gcc's extension and not part
2373 //   of the C++ standard).  As a result, gcc fails to reject the
2374 //   following code with the simple definition:
2375 //
2376 //     int foo;
2377 //     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
2378 //                                      // not a compile-time constant.
2379 //
2380 // - By using the type CompileAssert<(bool(expr))>, we ensures that
2381 //   expr is a compile-time constant.  (Template arguments must be
2382 //   determined at compile-time.)
2383 //
2384 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
2385 //   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
2386 //
2387 //     CompileAssert<bool(expr)>
2388 //
2389 //   instead, these compilers will refuse to compile
2390 //
2391 //     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
2392 //
2393 //   (They seem to think the ">" in "5 > 0" marks the end of the
2394 //   template argument list.)
2395 //
2396 // - The array size is (bool(expr) ? 1 : -1), instead of simply
2397 //
2398 //     ((expr) ? 1 : -1).
2399 //
2400 //   This is to avoid running into a bug in MS VC 7.1, which
2401 //   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
2402 
2403 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
2404 //
2405 // This template is declared, but intentionally undefined.
2406 template <typename T1, typename T2>
2407 struct StaticAssertTypeEqHelper;
2408 
2409 template <typename T>
2410 struct StaticAssertTypeEqHelper<T, T> {
2411   enum { value = true };
2412 };
2413 
2414 // Same as std::is_same<>.
2415 template <typename T, typename U>
2416 struct IsSame {
2417   enum { value = false };
2418 };
2419 template <typename T>
2420 struct IsSame<T, T> {
2421   enum { value = true };
2422 };
2423 
2424 // Evaluates to the number of elements in 'array'.
2425 #define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
2426 
2427 #if GTEST_HAS_GLOBAL_STRING
2428 typedef ::string string;
2429 #else
2430 typedef ::std::string string;
2431 #endif  // GTEST_HAS_GLOBAL_STRING
2432 
2433 #if GTEST_HAS_GLOBAL_WSTRING
2434 typedef ::wstring wstring;
2435 #elif GTEST_HAS_STD_WSTRING
2436 typedef ::std::wstring wstring;
2437 #endif  // GTEST_HAS_GLOBAL_WSTRING
2438 
2439 // A helper for suppressing warnings on constant condition.  It just
2440 // returns 'condition'.
2441 GTEST_API_ bool IsTrue(bool condition);
2442 
2443 // Defines scoped_ptr.
2444 
2445 // This implementation of scoped_ptr is PARTIAL - it only contains
2446 // enough stuff to satisfy Google Test's need.
2447 template <typename T>
2448 class scoped_ptr {
2449  public:
2450   typedef T element_type;
2451 
2452   explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2453   ~scoped_ptr() { reset(); }
2454 
2455   T& operator*() const { return *ptr_; }
2456   T* operator->() const { return ptr_; }
2457   T* get() const { return ptr_; }
2458 
2459   T* release() {
2460     T* const ptr = ptr_;
2461     ptr_ = NULL;
2462     return ptr;
2463   }
2464 
2465   void reset(T* p = NULL) {
2466     if (p != ptr_) {
2467       if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
2468         delete ptr_;
2469       }
2470       ptr_ = p;
2471     }
2472   }
2473 
2474   friend void swap(scoped_ptr& a, scoped_ptr& b) {
2475     using std::swap;
2476     swap(a.ptr_, b.ptr_);
2477   }
2478 
2479  private:
2480   T* ptr_;
2481 
2482   GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2483 };
2484 
2485 // Defines RE.
2486 
2487 #if GTEST_USES_PCRE
2488 // if used, PCRE is injected by custom/gtest-port.h
2489 #elif GTEST_USES_POSIX_RE || GTEST_USES_SIMPLE_RE
2490 
2491 // A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
2492 // Regular Expression syntax.
2493 class GTEST_API_ RE {
2494  public:
2495   // A copy constructor is required by the Standard to initialize object
2496   // references from r-values.
2497   RE(const RE& other) { Init(other.pattern()); }
2498 
2499   // Constructs an RE from a string.
2500   RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
2501 
2502 # if GTEST_HAS_GLOBAL_STRING
2503 
2504   RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
2505 
2506 # endif  // GTEST_HAS_GLOBAL_STRING
2507 
2508   RE(const char* regex) { Init(regex); }  // NOLINT
2509   ~RE();
2510 
2511   // Returns the string representation of the regex.
2512   const char* pattern() const { return pattern_; }
2513 
2514   // FullMatch(str, re) returns true iff regular expression re matches
2515   // the entire str.
2516   // PartialMatch(str, re) returns true iff regular expression re
2517   // matches a substring of str (including str itself).
2518   //
2519   // FIXME: make FullMatch() and PartialMatch() work
2520   // when str contains NUL characters.
2521   static bool FullMatch(const ::std::string& str, const RE& re) {
2522     return FullMatch(str.c_str(), re);
2523   }
2524   static bool PartialMatch(const ::std::string& str, const RE& re) {
2525     return PartialMatch(str.c_str(), re);
2526   }
2527 
2528 # if GTEST_HAS_GLOBAL_STRING
2529 
2530   static bool FullMatch(const ::string& str, const RE& re) {
2531     return FullMatch(str.c_str(), re);
2532   }
2533   static bool PartialMatch(const ::string& str, const RE& re) {
2534     return PartialMatch(str.c_str(), re);
2535   }
2536 
2537 # endif  // GTEST_HAS_GLOBAL_STRING
2538 
2539   static bool FullMatch(const char* str, const RE& re);
2540   static bool PartialMatch(const char* str, const RE& re);
2541 
2542  private:
2543   void Init(const char* regex);
2544 
2545   // We use a const char* instead of an std::string, as Google Test used to be
2546   // used where std::string is not available.  FIXME: change to
2547   // std::string.
2548   const char* pattern_;
2549   bool is_valid_;
2550 
2551 # if GTEST_USES_POSIX_RE
2552 
2553   regex_t full_regex_;     // For FullMatch().
2554   regex_t partial_regex_;  // For PartialMatch().
2555 
2556 # else  // GTEST_USES_SIMPLE_RE
2557 
2558   const char* full_pattern_;  // For FullMatch();
2559 
2560 # endif
2561 
2562   GTEST_DISALLOW_ASSIGN_(RE);
2563 };
2564 
2565 #endif  // GTEST_USES_PCRE
2566 
2567 // Formats a source file path and a line number as they would appear
2568 // in an error message from the compiler used to compile this code.
2569 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2570 
2571 // Formats a file location for compiler-independent XML output.
2572 // Although this function is not platform dependent, we put it next to
2573 // FormatFileLocation in order to contrast the two functions.
2574 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2575                                                                int line);
2576 
2577 // Defines logging utilities:
2578 //   GTEST_LOG_(severity) - logs messages at the specified severity level. The
2579 //                          message itself is streamed into the macro.
2580 //   LogToStderr()  - directs all log messages to stderr.
2581 //   FlushInfoLog() - flushes informational log messages.
2582 
2583 enum GTestLogSeverity {
2584   GTEST_INFO,
2585   GTEST_WARNING,
2586   GTEST_ERROR,
2587   GTEST_FATAL
2588 };
2589 
2590 // Formats log entry severity, provides a stream object for streaming the
2591 // log message, and terminates the message with a newline when going out of
2592 // scope.
2593 class GTEST_API_ GTestLog {
2594  public:
2595   GTestLog(GTestLogSeverity severity, const char* file, int line);
2596 
2597   // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2598   ~GTestLog();
2599 
2600   ::std::ostream& GetStream() { return ::std::cerr; }
2601 
2602  private:
2603   const GTestLogSeverity severity_;
2604 
2605   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2606 };
2607 
2608 #if !defined(GTEST_LOG_)
2609 
2610 # define GTEST_LOG_(severity) \
2611     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2612                                   __FILE__, __LINE__).GetStream()
2613 
2614 inline void LogToStderr() {}
2615 inline void FlushInfoLog() { fflush(NULL); }
2616 
2617 #endif  // !defined(GTEST_LOG_)
2618 
2619 #if !defined(GTEST_CHECK_)
2620 // INTERNAL IMPLEMENTATION - DO NOT USE.
2621 //
2622 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2623 // is not satisfied.
2624 //  Synopsys:
2625 //    GTEST_CHECK_(boolean_condition);
2626 //     or
2627 //    GTEST_CHECK_(boolean_condition) << "Additional message";
2628 //
2629 //    This checks the condition and if the condition is not satisfied
2630 //    it prints message about the condition violation, including the
2631 //    condition itself, plus additional message streamed into it, if any,
2632 //    and then it aborts the program. It aborts the program irrespective of
2633 //    whether it is built in the debug mode or not.
2634 # define GTEST_CHECK_(condition) \
2635     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2636     if (::testing::internal::IsTrue(condition)) \
2637       ; \
2638     else \
2639       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2640 #endif  // !defined(GTEST_CHECK_)
2641 
2642 // An all-mode assert to verify that the given POSIX-style function
2643 // call returns 0 (indicating success).  Known limitation: this
2644 // doesn't expand to a balanced 'if' statement, so enclose the macro
2645 // in {} if you need to use it as the only statement in an 'if'
2646 // branch.
2647 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2648   if (const int gtest_error = (posix_call)) \
2649     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2650                       << gtest_error
2651 
2652 // Adds reference to a type if it is not a reference type,
2653 // otherwise leaves it unchanged.  This is the same as
2654 // tr1::add_reference, which is not widely available yet.
2655 template <typename T>
2656 struct AddReference { typedef T& type; };  // NOLINT
2657 template <typename T>
2658 struct AddReference<T&> { typedef T& type; };  // NOLINT
2659 
2660 // A handy wrapper around AddReference that works when the argument T
2661 // depends on template parameters.
2662 #define GTEST_ADD_REFERENCE_(T) \
2663     typename ::testing::internal::AddReference<T>::type
2664 
2665 // Transforms "T" into "const T&" according to standard reference collapsing
2666 // rules (this is only needed as a backport for C++98 compilers that do not
2667 // support reference collapsing). Specifically, it transforms:
2668 //
2669 //   char         ==> const char&
2670 //   const char   ==> const char&
2671 //   char&        ==> char&
2672 //   const char&  ==> const char&
2673 //
2674 // Note that the non-const reference will not have "const" added. This is
2675 // standard, and necessary so that "T" can always bind to "const T&".
2676 template <typename T>
2677 struct ConstRef { typedef const T& type; };
2678 template <typename T>
2679 struct ConstRef<T&> { typedef T& type; };
2680 
2681 // The argument T must depend on some template parameters.
2682 #define GTEST_REFERENCE_TO_CONST_(T) \
2683   typename ::testing::internal::ConstRef<T>::type
2684 
2685 #if GTEST_HAS_STD_MOVE_
2686 using std::forward;
2687 using std::move;
2688 
2689 template <typename T>
2690 struct RvalueRef {
2691   typedef T&& type;
2692 };
2693 #else  // GTEST_HAS_STD_MOVE_
2694 template <typename T>
2695 const T& move(const T& t) {
2696   return t;
2697 }
2698 template <typename T>
2699 GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }
2700 
2701 template <typename T>
2702 struct RvalueRef {
2703   typedef const T& type;
2704 };
2705 #endif  // GTEST_HAS_STD_MOVE_
2706 
2707 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2708 //
2709 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
2710 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2711 // const Foo*).  When you use ImplicitCast_, the compiler checks that
2712 // the cast is safe.  Such explicit ImplicitCast_s are necessary in
2713 // surprisingly many situations where C++ demands an exact type match
2714 // instead of an argument type convertable to a target type.
2715 //
2716 // The syntax for using ImplicitCast_ is the same as for static_cast:
2717 //
2718 //   ImplicitCast_<ToType>(expr)
2719 //
2720 // ImplicitCast_ would have been part of the C++ standard library,
2721 // but the proposal was submitted too late.  It will probably make
2722 // its way into the language in the future.
2723 //
2724 // This relatively ugly name is intentional. It prevents clashes with
2725 // similar functions users may have (e.g., implicit_cast). The internal
2726 // namespace alone is not enough because the function can be found by ADL.
2727 template<typename To>
2728 inline To ImplicitCast_(To x) { return x; }
2729 
2730 // When you upcast (that is, cast a pointer from type Foo to type
2731 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2732 // always succeed.  When you downcast (that is, cast a pointer from
2733 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2734 // how do you know the pointer is really of type SubclassOfFoo?  It
2735 // could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
2736 // when you downcast, you should use this macro.  In debug mode, we
2737 // use dynamic_cast<> to double-check the downcast is legal (we die
2738 // if it's not).  In normal mode, we do the efficient static_cast<>
2739 // instead.  Thus, it's important to test in debug mode to make sure
2740 // the cast is legal!
2741 //    This is the only place in the code we should use dynamic_cast<>.
2742 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
2743 // do RTTI (eg code like this:
2744 //    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2745 //    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2746 // You should design the code some other way not to need this.
2747 //
2748 // This relatively ugly name is intentional. It prevents clashes with
2749 // similar functions users may have (e.g., down_cast). The internal
2750 // namespace alone is not enough because the function can be found by ADL.
2751 template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
2752 inline To DownCast_(From* f) {  // so we only accept pointers
2753   // Ensures that To is a sub-type of From *.  This test is here only
2754   // for compile-time type checking, and has no overhead in an
2755   // optimized build at run-time, as it will be optimized away
2756   // completely.
2757   GTEST_INTENTIONAL_CONST_COND_PUSH_()
2758   if (false) {
2759   GTEST_INTENTIONAL_CONST_COND_POP_()
2760     const To to = NULL;
2761     ::testing::internal::ImplicitCast_<From*>(to);
2762   }
2763 
2764 #if GTEST_HAS_RTTI
2765   // RTTI: debug mode only!
2766   GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2767 #endif
2768   return static_cast<To>(f);
2769 }
2770 
2771 // Downcasts the pointer of type Base to Derived.
2772 // Derived must be a subclass of Base. The parameter MUST
2773 // point to a class of type Derived, not any subclass of it.
2774 // When RTTI is available, the function performs a runtime
2775 // check to enforce this.
2776 template <class Derived, class Base>
2777 Derived* CheckedDowncastToActualType(Base* base) {
2778 #if GTEST_HAS_RTTI
2779   GTEST_CHECK_(typeid(*base) == typeid(Derived));
2780 #endif
2781 
2782 #if GTEST_HAS_DOWNCAST_
2783   return ::down_cast<Derived*>(base);
2784 #elif GTEST_HAS_RTTI
2785   return dynamic_cast<Derived*>(base);  // NOLINT
2786 #else
2787   return static_cast<Derived*>(base);  // Poor man's downcast.
2788 #endif
2789 }
2790 
2791 #if GTEST_HAS_STREAM_REDIRECTION
2792 
2793 // Defines the stderr capturer:
2794 //   CaptureStdout     - starts capturing stdout.
2795 //   GetCapturedStdout - stops capturing stdout and returns the captured string.
2796 //   CaptureStderr     - starts capturing stderr.
2797 //   GetCapturedStderr - stops capturing stderr and returns the captured string.
2798 //
2799 GTEST_API_ void CaptureStdout();
2800 GTEST_API_ std::string GetCapturedStdout();
2801 GTEST_API_ void CaptureStderr();
2802 GTEST_API_ std::string GetCapturedStderr();
2803 
2804 #endif  // GTEST_HAS_STREAM_REDIRECTION
2805 // Returns the size (in bytes) of a file.
2806 GTEST_API_ size_t GetFileSize(FILE* file);
2807 
2808 // Reads the entire content of a file as a string.
2809 GTEST_API_ std::string ReadEntireFile(FILE* file);
2810 
2811 // All command line arguments.
2812 GTEST_API_ std::vector<std::string> GetArgvs();
2813 
2814 #if GTEST_HAS_DEATH_TEST
2815 
2816 std::vector<std::string> GetInjectableArgvs();
2817 // Deprecated: pass the args vector by value instead.
2818 void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
2819 void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
2820 #if GTEST_HAS_GLOBAL_STRING
2821 void SetInjectableArgvs(const std::vector< ::string>& new_argvs);
2822 #endif  // GTEST_HAS_GLOBAL_STRING
2823 void ClearInjectableArgvs();
2824 
2825 #endif  // GTEST_HAS_DEATH_TEST
2826 
2827 // Defines synchronization primitives.
2828 #if GTEST_IS_THREADSAFE
2829 # if GTEST_HAS_PTHREAD
2830 // Sleeps for (roughly) n milliseconds.  This function is only for testing
2831 // Google Test's own constructs.  Don't use it in user tests, either
2832 // directly or indirectly.
2833 inline void SleepMilliseconds(int n) {
2834   const timespec time = {
2835     0,                  // 0 seconds.
2836     n * 1000L * 1000L,  // And n ms.
2837   };
2838   nanosleep(&time, NULL);
2839 }
2840 # endif  // GTEST_HAS_PTHREAD
2841 
2842 # if GTEST_HAS_NOTIFICATION_
2843 // Notification has already been imported into the namespace.
2844 // Nothing to do here.
2845 
2846 # elif GTEST_HAS_PTHREAD
2847 // Allows a controller thread to pause execution of newly created
2848 // threads until notified.  Instances of this class must be created
2849 // and destroyed in the controller thread.
2850 //
2851 // This class is only for testing Google Test's own constructs. Do not
2852 // use it in user tests, either directly or indirectly.
2853 class Notification {
2854  public:
2855   Notification() : notified_(false) {
2856     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2857   }
2858   ~Notification() {
2859     pthread_mutex_destroy(&mutex_);
2860   }
2861 
2862   // Notifies all threads created with this notification to start. Must
2863   // be called from the controller thread.
2864   void Notify() {
2865     pthread_mutex_lock(&mutex_);
2866     notified_ = true;
2867     pthread_mutex_unlock(&mutex_);
2868   }
2869 
2870   // Blocks until the controller thread notifies. Must be called from a test
2871   // thread.
2872   void WaitForNotification() {
2873     for (;;) {
2874       pthread_mutex_lock(&mutex_);
2875       const bool notified = notified_;
2876       pthread_mutex_unlock(&mutex_);
2877       if (notified)
2878         break;
2879       SleepMilliseconds(10);
2880     }
2881   }
2882 
2883  private:
2884   pthread_mutex_t mutex_;
2885   bool notified_;
2886 
2887   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2888 };
2889 
2890 # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
2891 
2892 GTEST_API_ void SleepMilliseconds(int n);
2893 
2894 // Provides leak-safe Windows kernel handle ownership.
2895 // Used in death tests and in threading support.
2896 class GTEST_API_ AutoHandle {
2897  public:
2898   // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
2899   // avoid including <windows.h> in this header file. Including <windows.h> is
2900   // undesirable because it defines a lot of symbols and macros that tend to
2901   // conflict with client code. This assumption is verified by
2902   // WindowsTypesTest.HANDLEIsVoidStar.
2903   typedef void* Handle;
2904   AutoHandle();
2905   explicit AutoHandle(Handle handle);
2906 
2907   ~AutoHandle();
2908 
2909   Handle Get() const;
2910   void Reset();
2911   void Reset(Handle handle);
2912 
2913  private:
2914   // Returns true iff the handle is a valid handle object that can be closed.
2915   bool IsCloseable() const;
2916 
2917   Handle handle_;
2918 
2919   GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
2920 };
2921 
2922 // Allows a controller thread to pause execution of newly created
2923 // threads until notified.  Instances of this class must be created
2924 // and destroyed in the controller thread.
2925 //
2926 // This class is only for testing Google Test's own constructs. Do not
2927 // use it in user tests, either directly or indirectly.
2928 class GTEST_API_ Notification {
2929  public:
2930   Notification();
2931   void Notify();
2932   void WaitForNotification();
2933 
2934  private:
2935   AutoHandle event_;
2936 
2937   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2938 };
2939 # endif  // GTEST_HAS_NOTIFICATION_
2940 
2941 // On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
2942 // defined, but we don't want to use MinGW's pthreads implementation, which
2943 // has conformance problems with some versions of the POSIX standard.
2944 # if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
2945 
2946 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2947 // Consequently, it cannot select a correct instantiation of ThreadWithParam
2948 // in order to call its Run(). Introducing ThreadWithParamBase as a
2949 // non-templated base class for ThreadWithParam allows us to bypass this
2950 // problem.
2951 class ThreadWithParamBase {
2952  public:
2953   virtual ~ThreadWithParamBase() {}
2954   virtual void Run() = 0;
2955 };
2956 
2957 // pthread_create() accepts a pointer to a function type with the C linkage.
2958 // According to the Standard (7.5/1), function types with different linkages
2959 // are different even if they are otherwise identical.  Some compilers (for
2960 // example, SunStudio) treat them as different types.  Since class methods
2961 // cannot be defined with C-linkage we need to define a free C-function to
2962 // pass into pthread_create().
2963 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2964   static_cast<ThreadWithParamBase*>(thread)->Run();
2965   return NULL;
2966 }
2967 
2968 // Helper class for testing Google Test's multi-threading constructs.
2969 // To use it, write:
2970 //
2971 //   void ThreadFunc(int param) { /* Do things with param */ }
2972 //   Notification thread_can_start;
2973 //   ...
2974 //   // The thread_can_start parameter is optional; you can supply NULL.
2975 //   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2976 //   thread_can_start.Notify();
2977 //
2978 // These classes are only for testing Google Test's own constructs. Do
2979 // not use them in user tests, either directly or indirectly.
2980 template <typename T>
2981 class ThreadWithParam : public ThreadWithParamBase {
2982  public:
2983   typedef void UserThreadFunc(T);
2984 
2985   ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
2986       : func_(func),
2987         param_(param),
2988         thread_can_start_(thread_can_start),
2989         finished_(false) {
2990     ThreadWithParamBase* const base = this;
2991     // The thread can be created only after all fields except thread_
2992     // have been initialized.
2993     GTEST_CHECK_POSIX_SUCCESS_(
2994         pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2995   }
2996   ~ThreadWithParam() { Join(); }
2997 
2998   void Join() {
2999     if (!finished_) {
3000       GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
3001       finished_ = true;
3002     }
3003   }
3004 
3005   virtual void Run() {
3006     if (thread_can_start_ != NULL)
3007       thread_can_start_->WaitForNotification();
3008     func_(param_);
3009   }
3010 
3011  private:
3012   UserThreadFunc* const func_;  // User-supplied thread function.
3013   const T param_;  // User-supplied parameter to the thread function.
3014   // When non-NULL, used to block execution until the controller thread
3015   // notifies.
3016   Notification* const thread_can_start_;
3017   bool finished_;  // true iff we know that the thread function has finished.
3018   pthread_t thread_;  // The native thread object.
3019 
3020   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
3021 };
3022 # endif  // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
3023          // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
3024 
3025 # if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
3026 // Mutex and ThreadLocal have already been imported into the namespace.
3027 // Nothing to do here.
3028 
3029 # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
3030 
3031 // Mutex implements mutex on Windows platforms.  It is used in conjunction
3032 // with class MutexLock:
3033 //
3034 //   Mutex mutex;
3035 //   ...
3036 //   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the
3037 //                            // end of the current scope.
3038 //
3039 // A static Mutex *must* be defined or declared using one of the following
3040 // macros:
3041 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
3042 //   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
3043 //
3044 // (A non-static Mutex is defined/declared in the usual way).
3045 class GTEST_API_ Mutex {
3046  public:
3047   enum MutexType { kStatic = 0, kDynamic = 1 };
3048   // We rely on kStaticMutex being 0 as it is to what the linker initializes
3049   // type_ in static mutexes.  critical_section_ will be initialized lazily
3050   // in ThreadSafeLazyInit().
3051   enum StaticConstructorSelector { kStaticMutex = 0 };
3052 
3053   // This constructor intentionally does nothing.  It relies on type_ being
3054   // statically initialized to 0 (effectively setting it to kStatic) and on
3055   // ThreadSafeLazyInit() to lazily initialize the rest of the members.
3056   explicit Mutex(StaticConstructorSelector /*dummy*/) {}
3057 
3058   Mutex();
3059   ~Mutex();
3060 
3061   void Lock();
3062 
3063   void Unlock();
3064 
3065   // Does nothing if the current thread holds the mutex. Otherwise, crashes
3066   // with high probability.
3067   void AssertHeld();
3068 
3069  private:
3070   // Initializes owner_thread_id_ and critical_section_ in static mutexes.
3071   void ThreadSafeLazyInit();
3072 
3073   // Per https://blogs.msdn.microsoft.com/oldnewthing/20040223-00/?p=40503,
3074   // we assume that 0 is an invalid value for thread IDs.
3075   unsigned int owner_thread_id_;
3076 
3077   // For static mutexes, we rely on these members being initialized to zeros
3078   // by the linker.
3079   MutexType type_;
3080   long critical_section_init_phase_;  // NOLINT
3081   GTEST_CRITICAL_SECTION* critical_section_;
3082 
3083   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
3084 };
3085 
3086 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3087     extern ::testing::internal::Mutex mutex
3088 
3089 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
3090     ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
3091 
3092 // We cannot name this class MutexLock because the ctor declaration would
3093 // conflict with a macro named MutexLock, which is defined on some
3094 // platforms. That macro is used as a defensive measure to prevent against
3095 // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3096 // "MutexLock l(&mu)".  Hence the typedef trick below.
3097 class GTestMutexLock {
3098  public:
3099   explicit GTestMutexLock(Mutex* mutex)
3100       : mutex_(mutex) { mutex_->Lock(); }
3101 
3102   ~GTestMutexLock() { mutex_->Unlock(); }
3103 
3104  private:
3105   Mutex* const mutex_;
3106 
3107   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
3108 };
3109 
3110 typedef GTestMutexLock MutexLock;
3111 
3112 // Base class for ValueHolder<T>.  Allows a caller to hold and delete a value
3113 // without knowing its type.
3114 class ThreadLocalValueHolderBase {
3115  public:
3116   virtual ~ThreadLocalValueHolderBase() {}
3117 };
3118 
3119 // Provides a way for a thread to send notifications to a ThreadLocal
3120 // regardless of its parameter type.
3121 class ThreadLocalBase {
3122  public:
3123   // Creates a new ValueHolder<T> object holding a default value passed to
3124   // this ThreadLocal<T>'s constructor and returns it.  It is the caller's
3125   // responsibility not to call this when the ThreadLocal<T> instance already
3126   // has a value on the current thread.
3127   virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
3128 
3129  protected:
3130   ThreadLocalBase() {}
3131   virtual ~ThreadLocalBase() {}
3132 
3133  private:
3134   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
3135 };
3136 
3137 // Maps a thread to a set of ThreadLocals that have values instantiated on that
3138 // thread and notifies them when the thread exits.  A ThreadLocal instance is
3139 // expected to persist until all threads it has values on have terminated.
3140 class GTEST_API_ ThreadLocalRegistry {
3141  public:
3142   // Registers thread_local_instance as having value on the current thread.
3143   // Returns a value that can be used to identify the thread from other threads.
3144   static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
3145       const ThreadLocalBase* thread_local_instance);
3146 
3147   // Invoked when a ThreadLocal instance is destroyed.
3148   static void OnThreadLocalDestroyed(
3149       const ThreadLocalBase* thread_local_instance);
3150 };
3151 
3152 class GTEST_API_ ThreadWithParamBase {
3153  public:
3154   void Join();
3155 
3156  protected:
3157   class Runnable {
3158    public:
3159     virtual ~Runnable() {}
3160     virtual void Run() = 0;
3161   };
3162 
3163   ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
3164   virtual ~ThreadWithParamBase();
3165 
3166  private:
3167   AutoHandle thread_;
3168 };
3169 
3170 // Helper class for testing Google Test's multi-threading constructs.
3171 template <typename T>
3172 class ThreadWithParam : public ThreadWithParamBase {
3173  public:
3174   typedef void UserThreadFunc(T);
3175 
3176   ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
3177       : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
3178   }
3179   virtual ~ThreadWithParam() {}
3180 
3181  private:
3182   class RunnableImpl : public Runnable {
3183    public:
3184     RunnableImpl(UserThreadFunc* func, T param)
3185         : func_(func),
3186           param_(param) {
3187     }
3188     virtual ~RunnableImpl() {}
3189     virtual void Run() {
3190       func_(param_);
3191     }
3192 
3193    private:
3194     UserThreadFunc* const func_;
3195     const T param_;
3196 
3197     GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
3198   };
3199 
3200   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
3201 };
3202 
3203 // Implements thread-local storage on Windows systems.
3204 //
3205 //   // Thread 1
3206 //   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
3207 //
3208 //   // Thread 2
3209 //   tl.set(150);  // Changes the value for thread 2 only.
3210 //   EXPECT_EQ(150, tl.get());
3211 //
3212 //   // Thread 1
3213 //   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
3214 //   tl.set(200);
3215 //   EXPECT_EQ(200, tl.get());
3216 //
3217 // The template type argument T must have a public copy constructor.
3218 // In addition, the default ThreadLocal constructor requires T to have
3219 // a public default constructor.
3220 //
3221 // The users of a TheadLocal instance have to make sure that all but one
3222 // threads (including the main one) using that instance have exited before
3223 // destroying it. Otherwise, the per-thread objects managed for them by the
3224 // ThreadLocal instance are not guaranteed to be destroyed on all platforms.
3225 //
3226 // Google Test only uses global ThreadLocal objects.  That means they
3227 // will die after main() has returned.  Therefore, no per-thread
3228 // object managed by Google Test will be leaked as long as all threads
3229 // using Google Test have exited when main() returns.
3230 template <typename T>
3231 class ThreadLocal : public ThreadLocalBase {
3232  public:
3233   ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
3234   explicit ThreadLocal(const T& value)
3235       : default_factory_(new InstanceValueHolderFactory(value)) {}
3236 
3237   ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
3238 
3239   T* pointer() { return GetOrCreateValue(); }
3240   const T* pointer() const { return GetOrCreateValue(); }
3241   const T& get() const { return *pointer(); }
3242   void set(const T& value) { *pointer() = value; }
3243 
3244  private:
3245   // Holds a value of T.  Can be deleted via its base class without the caller
3246   // knowing the type of T.
3247   class ValueHolder : public ThreadLocalValueHolderBase {
3248    public:
3249     ValueHolder() : value_() {}
3250     explicit ValueHolder(const T& value) : value_(value) {}
3251 
3252     T* pointer() { return &value_; }
3253 
3254    private:
3255     T value_;
3256     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
3257   };
3258 
3259 
3260   T* GetOrCreateValue() const {
3261     return static_cast<ValueHolder*>(
3262         ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
3263   }
3264 
3265   virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
3266     return default_factory_->MakeNewHolder();
3267   }
3268 
3269   class ValueHolderFactory {
3270    public:
3271     ValueHolderFactory() {}
3272     virtual ~ValueHolderFactory() {}
3273     virtual ValueHolder* MakeNewHolder() const = 0;
3274 
3275    private:
3276     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
3277   };
3278 
3279   class DefaultValueHolderFactory : public ValueHolderFactory {
3280    public:
3281     DefaultValueHolderFactory() {}
3282     virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
3283 
3284    private:
3285     GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
3286   };
3287 
3288   class InstanceValueHolderFactory : public ValueHolderFactory {
3289    public:
3290     explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
3291     virtual ValueHolder* MakeNewHolder() const {
3292       return new ValueHolder(value_);
3293     }
3294 
3295    private:
3296     const T value_;  // The value for each thread.
3297 
3298     GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
3299   };
3300 
3301   scoped_ptr<ValueHolderFactory> default_factory_;
3302 
3303   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
3304 };
3305 
3306 # elif GTEST_HAS_PTHREAD
3307 
3308 // MutexBase and Mutex implement mutex on pthreads-based platforms.
3309 class MutexBase {
3310  public:
3311   // Acquires this mutex.
3312   void Lock() {
3313     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
3314     owner_ = pthread_self();
3315     has_owner_ = true;
3316   }
3317 
3318   // Releases this mutex.
3319   void Unlock() {
3320     // Since the lock is being released the owner_ field should no longer be
3321     // considered valid. We don't protect writing to has_owner_ here, as it's
3322     // the caller's responsibility to ensure that the current thread holds the
3323     // mutex when this is called.
3324     has_owner_ = false;
3325     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
3326   }
3327 
3328   // Does nothing if the current thread holds the mutex. Otherwise, crashes
3329   // with high probability.
3330   void AssertHeld() const {
3331     GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
3332         << "The current thread is not holding the mutex @" << this;
3333   }
3334 
3335   // A static mutex may be used before main() is entered.  It may even
3336   // be used before the dynamic initialization stage.  Therefore we
3337   // must be able to initialize a static mutex object at link time.
3338   // This means MutexBase has to be a POD and its member variables
3339   // have to be public.
3340  public:
3341   pthread_mutex_t mutex_;  // The underlying pthread mutex.
3342   // has_owner_ indicates whether the owner_ field below contains a valid thread
3343   // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
3344   // accesses to the owner_ field should be protected by a check of this field.
3345   // An alternative might be to memset() owner_ to all zeros, but there's no
3346   // guarantee that a zero'd pthread_t is necessarily invalid or even different
3347   // from pthread_self().
3348   bool has_owner_;
3349   pthread_t owner_;  // The thread holding the mutex.
3350 };
3351 
3352 // Forward-declares a static mutex.
3353 #  define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3354      extern ::testing::internal::MutexBase mutex
3355 
3356 // Defines and statically (i.e. at link time) initializes a static mutex.
3357 // The initialization list here does not explicitly initialize each field,
3358 // instead relying on default initialization for the unspecified fields. In
3359 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
3360 // This allows initialization to work whether pthread_t is a scalar or struct.
3361 // The flag -Wmissing-field-initializers must not be specified for this to work.
3362 #define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
3363   ::testing::internal::MutexBase mutex = {PTHREAD_MUTEX_INITIALIZER, false, 0}
3364 
3365 // The Mutex class can only be used for mutexes created at runtime. It
3366 // shares its API with MutexBase otherwise.
3367 class Mutex : public MutexBase {
3368  public:
3369   Mutex() {
3370     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
3371     has_owner_ = false;
3372   }
3373   ~Mutex() {
3374     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
3375   }
3376 
3377  private:
3378   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
3379 };
3380 
3381 // We cannot name this class MutexLock because the ctor declaration would
3382 // conflict with a macro named MutexLock, which is defined on some
3383 // platforms. That macro is used as a defensive measure to prevent against
3384 // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3385 // "MutexLock l(&mu)".  Hence the typedef trick below.
3386 class GTestMutexLock {
3387  public:
3388   explicit GTestMutexLock(MutexBase* mutex)
3389       : mutex_(mutex) { mutex_->Lock(); }
3390 
3391   ~GTestMutexLock() { mutex_->Unlock(); }
3392 
3393  private:
3394   MutexBase* const mutex_;
3395 
3396   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
3397 };
3398 
3399 typedef GTestMutexLock MutexLock;
3400 
3401 // Helpers for ThreadLocal.
3402 
3403 // pthread_key_create() requires DeleteThreadLocalValue() to have
3404 // C-linkage.  Therefore it cannot be templatized to access
3405 // ThreadLocal<T>.  Hence the need for class
3406 // ThreadLocalValueHolderBase.
3407 class ThreadLocalValueHolderBase {
3408  public:
3409   virtual ~ThreadLocalValueHolderBase() {}
3410 };
3411 
3412 // Called by pthread to delete thread-local data stored by
3413 // pthread_setspecific().
3414 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
3415   delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
3416 }
3417 
3418 // Implements thread-local storage on pthreads-based systems.
3419 template <typename T>
3420 class GTEST_API_ ThreadLocal {
3421  public:
3422   ThreadLocal()
3423       : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
3424   explicit ThreadLocal(const T& value)
3425       : key_(CreateKey()),
3426         default_factory_(new InstanceValueHolderFactory(value)) {}
3427 
3428   ~ThreadLocal() {
3429     // Destroys the managed object for the current thread, if any.
3430     DeleteThreadLocalValue(pthread_getspecific(key_));
3431 
3432     // Releases resources associated with the key.  This will *not*
3433     // delete managed objects for other threads.
3434     GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
3435   }
3436 
3437   T* pointer() { return GetOrCreateValue(); }
3438   const T* pointer() const { return GetOrCreateValue(); }
3439   const T& get() const { return *pointer(); }
3440   void set(const T& value) { *pointer() = value; }
3441 
3442  private:
3443   // Holds a value of type T.
3444   class ValueHolder : public ThreadLocalValueHolderBase {
3445    public:
3446     ValueHolder() : value_() {}
3447     explicit ValueHolder(const T& value) : value_(value) {}
3448 
3449     T* pointer() { return &value_; }
3450 
3451    private:
3452     T value_;
3453     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
3454   };
3455 
3456   static pthread_key_t CreateKey() {
3457     pthread_key_t key;
3458     // When a thread exits, DeleteThreadLocalValue() will be called on
3459     // the object managed for that thread.
3460     GTEST_CHECK_POSIX_SUCCESS_(
3461         pthread_key_create(&key, &DeleteThreadLocalValue));
3462     return key;
3463   }
3464 
3465   T* GetOrCreateValue() const {
3466     ThreadLocalValueHolderBase* const holder =
3467         static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
3468     if (holder != NULL) {
3469       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
3470     }
3471 
3472     ValueHolder* const new_holder = default_factory_->MakeNewHolder();
3473     ThreadLocalValueHolderBase* const holder_base = new_holder;
3474     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
3475     return new_holder->pointer();
3476   }
3477 
3478   class ValueHolderFactory {
3479    public:
3480     ValueHolderFactory() {}
3481     virtual ~ValueHolderFactory() {}
3482     virtual ValueHolder* MakeNewHolder() const = 0;
3483 
3484    private:
3485     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
3486   };
3487 
3488   class DefaultValueHolderFactory : public ValueHolderFactory {
3489    public:
3490     DefaultValueHolderFactory() {}
3491     virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
3492 
3493    private:
3494     GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
3495   };
3496 
3497   class InstanceValueHolderFactory : public ValueHolderFactory {
3498    public:
3499     explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
3500     virtual ValueHolder* MakeNewHolder() const {
3501       return new ValueHolder(value_);
3502     }
3503 
3504    private:
3505     const T value_;  // The value for each thread.
3506 
3507     GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
3508   };
3509 
3510   // A key pthreads uses for looking up per-thread values.
3511   const pthread_key_t key_;
3512   scoped_ptr<ValueHolderFactory> default_factory_;
3513 
3514   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
3515 };
3516 
3517 # endif  // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
3518 
3519 #else  // GTEST_IS_THREADSAFE
3520 
3521 // A dummy implementation of synchronization primitives (mutex, lock,
3522 // and thread-local variable).  Necessary for compiling Google Test where
3523 // mutex is not supported - using Google Test in multiple threads is not
3524 // supported on such platforms.
3525 
3526 class Mutex {
3527  public:
3528   Mutex() {}
3529   void Lock() {}
3530   void Unlock() {}
3531   void AssertHeld() const {}
3532 };
3533 
3534 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3535   extern ::testing::internal::Mutex mutex
3536 
3537 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
3538 
3539 // We cannot name this class MutexLock because the ctor declaration would
3540 // conflict with a macro named MutexLock, which is defined on some
3541 // platforms. That macro is used as a defensive measure to prevent against
3542 // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3543 // "MutexLock l(&mu)".  Hence the typedef trick below.
3544 class GTestMutexLock {
3545  public:
3546   explicit GTestMutexLock(Mutex*) {}  // NOLINT
3547 };
3548 
3549 typedef GTestMutexLock MutexLock;
3550 
3551 template <typename T>
3552 class GTEST_API_ ThreadLocal {
3553  public:
3554   ThreadLocal() : value_() {}
3555   explicit ThreadLocal(const T& value) : value_(value) {}
3556   T* pointer() { return &value_; }
3557   const T* pointer() const { return &value_; }
3558   const T& get() const { return value_; }
3559   void set(const T& value) { value_ = value; }
3560  private:
3561   T value_;
3562 };
3563 
3564 #endif  // GTEST_IS_THREADSAFE
3565 
3566 // Returns the number of threads running in the process, or 0 to indicate that
3567 // we cannot detect it.
3568 GTEST_API_ size_t GetThreadCount();
3569 
3570 // Passing non-POD classes through ellipsis (...) crashes the ARM
3571 // compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian
3572 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
3573 // for objects passed through ellipsis (...), failing for uncopyable
3574 // objects.  We define this to ensure that only POD is passed through
3575 // ellipsis on these systems.
3576 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \
3577      (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)
3578 // We lose support for NULL detection where the compiler doesn't like
3579 // passing non-POD classes through ellipsis (...).
3580 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
3581 #else
3582 # define GTEST_CAN_COMPARE_NULL 1
3583 #endif
3584 
3585 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
3586 // const T& and const T* in a function template.  These compilers
3587 // _can_ decide between class template specializations for T and T*,
3588 // so a tr1::type_traits-like is_pointer works.
3589 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
3590 # define GTEST_NEEDS_IS_POINTER_ 1
3591 #endif
3592 
3593 template <bool bool_value>
3594 struct bool_constant {
3595   typedef bool_constant<bool_value> type;
3596   static const bool value = bool_value;
3597 };
3598 template <bool bool_value> const bool bool_constant<bool_value>::value;
3599 
3600 typedef bool_constant<false> false_type;
3601 typedef bool_constant<true> true_type;
3602 
3603 template <typename T, typename U>
3604 struct is_same : public false_type {};
3605 
3606 template <typename T>
3607 struct is_same<T, T> : public true_type {};
3608 
3609 
3610 template <typename T>
3611 struct is_pointer : public false_type {};
3612 
3613 template <typename T>
3614 struct is_pointer<T*> : public true_type {};
3615 
3616 template <typename Iterator>
3617 struct IteratorTraits {
3618   typedef typename Iterator::value_type value_type;
3619 };
3620 
3621 
3622 template <typename T>
3623 struct IteratorTraits<T*> {
3624   typedef T value_type;
3625 };
3626 
3627 template <typename T>
3628 struct IteratorTraits<const T*> {
3629   typedef T value_type;
3630 };
3631 
3632 #if GTEST_OS_WINDOWS
3633 # define GTEST_PATH_SEP_ "\\"
3634 # define GTEST_HAS_ALT_PATH_SEP_ 1
3635 // The biggest signed integer type the compiler supports.
3636 typedef __int64 BiggestInt;
3637 #else
3638 # define GTEST_PATH_SEP_ "/"
3639 # define GTEST_HAS_ALT_PATH_SEP_ 0
3640 typedef long long BiggestInt;  // NOLINT
3641 #endif  // GTEST_OS_WINDOWS
3642 
3643 // Utilities for char.
3644 
3645 // isspace(int ch) and friends accept an unsigned char or EOF.  char
3646 // may be signed, depending on the compiler (or compiler flags).
3647 // Therefore we need to cast a char to unsigned char before calling
3648 // isspace(), etc.
3649 
3650 inline bool IsAlpha(char ch) {
3651   return isalpha(static_cast<unsigned char>(ch)) != 0;
3652 }
3653 inline bool IsAlNum(char ch) {
3654   return isalnum(static_cast<unsigned char>(ch)) != 0;
3655 }
3656 inline bool IsDigit(char ch) {
3657   return isdigit(static_cast<unsigned char>(ch)) != 0;
3658 }
3659 inline bool IsLower(char ch) {
3660   return islower(static_cast<unsigned char>(ch)) != 0;
3661 }
3662 inline bool IsSpace(char ch) {
3663   return isspace(static_cast<unsigned char>(ch)) != 0;
3664 }
3665 inline bool IsUpper(char ch) {
3666   return isupper(static_cast<unsigned char>(ch)) != 0;
3667 }
3668 inline bool IsXDigit(char ch) {
3669   return isxdigit(static_cast<unsigned char>(ch)) != 0;
3670 }
3671 inline bool IsXDigit(wchar_t ch) {
3672   const unsigned char low_byte = static_cast<unsigned char>(ch);
3673   return ch == low_byte && isxdigit(low_byte) != 0;
3674 }
3675 
3676 inline char ToLower(char ch) {
3677   return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
3678 }
3679 inline char ToUpper(char ch) {
3680   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
3681 }
3682 
3683 inline std::string StripTrailingSpaces(std::string str) {
3684   std::string::iterator it = str.end();
3685   while (it != str.begin() && IsSpace(*--it))
3686     it = str.erase(it);
3687   return str;
3688 }
3689 
3690 // The testing::internal::posix namespace holds wrappers for common
3691 // POSIX functions.  These wrappers hide the differences between
3692 // Windows/MSVC and POSIX systems.  Since some compilers define these
3693 // standard functions as macros, the wrapper cannot have the same name
3694 // as the wrapped function.
3695 
3696 namespace posix {
3697 
3698 // Functions with a different name on Windows.
3699 
3700 #if GTEST_OS_WINDOWS
3701 
3702 typedef struct _stat StatStruct;
3703 
3704 # ifdef __BORLANDC__
3705 inline int IsATTY(int fd) { return isatty(fd); }
3706 inline int StrCaseCmp(const char* s1, const char* s2) {
3707   return stricmp(s1, s2);
3708 }
3709 inline char* StrDup(const char* src) { return strdup(src); }
3710 # else  // !__BORLANDC__
3711 #  if GTEST_OS_WINDOWS_MOBILE
3712 inline int IsATTY(int /* fd */) { return 0; }
3713 #  else
3714 inline int IsATTY(int fd) { return _isatty(fd); }
3715 #  endif  // GTEST_OS_WINDOWS_MOBILE
3716 inline int StrCaseCmp(const char* s1, const char* s2) {
3717   return _stricmp(s1, s2);
3718 }
3719 inline char* StrDup(const char* src) { return _strdup(src); }
3720 # endif  // __BORLANDC__
3721 
3722 # if GTEST_OS_WINDOWS_MOBILE
3723 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
3724 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
3725 // time and thus not defined there.
3726 # else
3727 inline int FileNo(FILE* file) { return _fileno(file); }
3728 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
3729 inline int RmDir(const char* dir) { return _rmdir(dir); }
3730 inline bool IsDir(const StatStruct& st) {
3731   return (_S_IFDIR & st.st_mode) != 0;
3732 }
3733 # endif  // GTEST_OS_WINDOWS_MOBILE
3734 
3735 #else
3736 
3737 typedef struct stat StatStruct;
3738 
3739 inline int FileNo(FILE* file) { return fileno(file); }
3740 inline int IsATTY(int fd) { return isatty(fd); }
3741 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
3742 inline int StrCaseCmp(const char* s1, const char* s2) {
3743   return strcasecmp(s1, s2);
3744 }
3745 inline char* StrDup(const char* src) { return strdup(src); }
3746 inline int RmDir(const char* dir) { return rmdir(dir); }
3747 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
3748 
3749 #endif  // GTEST_OS_WINDOWS
3750 
3751 // Functions deprecated by MSVC 8.0.
3752 
3753 GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
3754 
3755 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
3756   return strncpy(dest, src, n);
3757 }
3758 
3759 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
3760 // StrError() aren't needed on Windows CE at this time and thus not
3761 // defined there.
3762 
3763 #if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
3764 inline int ChDir(const char* dir) { return chdir(dir); }
3765 #endif
3766 inline FILE* FOpen(const char* path, const char* mode) {
3767   return fopen(path, mode);
3768 }
3769 #if !GTEST_OS_WINDOWS_MOBILE
3770 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
3771   return freopen(path, mode, stream);
3772 }
3773 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
3774 #endif
3775 inline int FClose(FILE* fp) { return fclose(fp); }
3776 #if !GTEST_OS_WINDOWS_MOBILE
3777 inline int Read(int fd, void* buf, unsigned int count) {
3778   return static_cast<int>(read(fd, buf, count));
3779 }
3780 inline int Write(int fd, const void* buf, unsigned int count) {
3781   return static_cast<int>(write(fd, buf, count));
3782 }
3783 inline int Close(int fd) { return close(fd); }
3784 inline const char* StrError(int errnum) { return strerror(errnum); }
3785 #endif
3786 inline const char* GetEnv(const char* name) {
3787 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
3788   // We are on Windows CE, which has no environment variables.
3789   static_cast<void>(name);  // To prevent 'unused argument' warning.
3790   return NULL;
3791 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
3792   // Environment variables which we programmatically clear will be set to the
3793   // empty string rather than unset (NULL).  Handle that case.
3794   const char* const env = getenv(name);
3795   return (env != NULL && env[0] != '\0') ? env : NULL;
3796 #else
3797   return getenv(name);
3798 #endif
3799 }
3800 
3801 GTEST_DISABLE_MSC_DEPRECATED_POP_()
3802 
3803 #if GTEST_OS_WINDOWS_MOBILE
3804 // Windows CE has no C library. The abort() function is used in
3805 // several places in Google Test. This implementation provides a reasonable
3806 // imitation of standard behaviour.
3807 void Abort();
3808 #else
3809 inline void Abort() { abort(); }
3810 #endif  // GTEST_OS_WINDOWS_MOBILE
3811 
3812 }  // namespace posix
3813 
3814 // MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
3815 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
3816 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
3817 // function in order to achieve that.  We use macro definition here because
3818 // snprintf is a variadic function.
3819 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
3820 // MSVC 2005 and above support variadic macros.
3821 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
3822      _snprintf_s(buffer, size, size, format, __VA_ARGS__)
3823 #elif defined(_MSC_VER)
3824 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
3825 // complain about _snprintf.
3826 # define GTEST_SNPRINTF_ _snprintf
3827 #else
3828 # define GTEST_SNPRINTF_ snprintf
3829 #endif
3830 
3831 // The maximum number a BiggestInt can represent.  This definition
3832 // works no matter BiggestInt is represented in one's complement or
3833 // two's complement.
3834 //
3835 // We cannot rely on numeric_limits in STL, as __int64 and long long
3836 // are not part of standard C++ and numeric_limits doesn't need to be
3837 // defined for them.
3838 const BiggestInt kMaxBiggestInt =
3839     ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
3840 
3841 // This template class serves as a compile-time function from size to
3842 // type.  It maps a size in bytes to a primitive type with that
3843 // size. e.g.
3844 //
3845 //   TypeWithSize<4>::UInt
3846 //
3847 // is typedef-ed to be unsigned int (unsigned integer made up of 4
3848 // bytes).
3849 //
3850 // Such functionality should belong to STL, but I cannot find it
3851 // there.
3852 //
3853 // Google Test uses this class in the implementation of floating-point
3854 // comparison.
3855 //
3856 // For now it only handles UInt (unsigned int) as that's all Google Test
3857 // needs.  Other types can be easily added in the future if need
3858 // arises.
3859 template <size_t size>
3860 class TypeWithSize {
3861  public:
3862   // This prevents the user from using TypeWithSize<N> with incorrect
3863   // values of N.
3864   typedef void UInt;
3865 };
3866 
3867 // The specialization for size 4.
3868 template <>
3869 class TypeWithSize<4> {
3870  public:
3871   // unsigned int has size 4 in both gcc and MSVC.
3872   //
3873   // As base/basictypes.h doesn't compile on Windows, we cannot use
3874   // uint32, uint64, and etc here.
3875   typedef int Int;
3876   typedef unsigned int UInt;
3877 };
3878 
3879 // The specialization for size 8.
3880 template <>
3881 class TypeWithSize<8> {
3882  public:
3883 #if GTEST_OS_WINDOWS
3884   typedef __int64 Int;
3885   typedef unsigned __int64 UInt;
3886 #else
3887   typedef long long Int;  // NOLINT
3888   typedef unsigned long long UInt;  // NOLINT
3889 #endif  // GTEST_OS_WINDOWS
3890 };
3891 
3892 // Integer types of known sizes.
3893 typedef TypeWithSize<4>::Int Int32;
3894 typedef TypeWithSize<4>::UInt UInt32;
3895 typedef TypeWithSize<8>::Int Int64;
3896 typedef TypeWithSize<8>::UInt UInt64;
3897 typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
3898 
3899 // Utilities for command line flags and environment variables.
3900 
3901 // Macro for referencing flags.
3902 #if !defined(GTEST_FLAG)
3903 # define GTEST_FLAG(name) FLAGS_gtest_##name
3904 #endif  // !defined(GTEST_FLAG)
3905 
3906 #if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
3907 # define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
3908 #endif  // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
3909 
3910 #if !defined(GTEST_DECLARE_bool_)
3911 # define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
3912 
3913 // Macros for declaring flags.
3914 # define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3915 # define GTEST_DECLARE_int32_(name) \
3916     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3917 # define GTEST_DECLARE_string_(name) \
3918     GTEST_API_ extern ::std::string GTEST_FLAG(name)
3919 
3920 // Macros for defining flags.
3921 # define GTEST_DEFINE_bool_(name, default_val, doc) \
3922     GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3923 # define GTEST_DEFINE_int32_(name, default_val, doc) \
3924     GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3925 # define GTEST_DEFINE_string_(name, default_val, doc) \
3926     GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3927 
3928 #endif  // !defined(GTEST_DECLARE_bool_)
3929 
3930 // Thread annotations
3931 #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
3932 # define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3933 # define GTEST_LOCK_EXCLUDED_(locks)
3934 #endif  // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
3935 
3936 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
3937 // to *value and returns true; otherwise leaves *value unchanged and returns
3938 // false.
3939 // FIXME: Find a better way to refactor flag and environment parsing
3940 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3941 // function.
3942 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3943 
3944 // Parses a bool/Int32/string from the environment variable
3945 // corresponding to the given Google Test flag.
3946 bool BoolFromGTestEnv(const char* flag, bool default_val);
3947 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3948 std::string OutputFlagAlsoCheckEnvVar();
3949 const char* StringFromGTestEnv(const char* flag, const char* default_val);
3950 
3951 }  // namespace internal
3952 }  // namespace testing
3953 
3954 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3955 
3956 #if GTEST_OS_LINUX
3957 # include <stdlib.h>
3958 # include <sys/types.h>
3959 # include <sys/wait.h>
3960 # include <unistd.h>
3961 #endif  // GTEST_OS_LINUX
3962 
3963 #if GTEST_HAS_EXCEPTIONS
3964 # include <stdexcept>
3965 #endif
3966 
3967 #include <ctype.h>
3968 #include <float.h>
3969 #include <string.h>
3970 #include <iomanip>
3971 #include <limits>
3972 #include <map>
3973 #include <set>
3974 #include <string>
3975 #include <vector>
3976 
3977 // Copyright 2005, Google Inc.
3978 // All rights reserved.
3979 //
3980 // Redistribution and use in source and binary forms, with or without
3981 // modification, are permitted provided that the following conditions are
3982 // met:
3983 //
3984 //     * Redistributions of source code must retain the above copyright
3985 // notice, this list of conditions and the following disclaimer.
3986 //     * Redistributions in binary form must reproduce the above
3987 // copyright notice, this list of conditions and the following disclaimer
3988 // in the documentation and/or other materials provided with the
3989 // distribution.
3990 //     * Neither the name of Google Inc. nor the names of its
3991 // contributors may be used to endorse or promote products derived from
3992 // this software without specific prior written permission.
3993 //
3994 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3995 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3996 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3997 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3998 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3999 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4000 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4001 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4002 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4003 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4004 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4005 
4006 //
4007 // The Google C++ Testing and Mocking Framework (Google Test)
4008 //
4009 // This header file defines the Message class.
4010 //
4011 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
4012 // leave some internal implementation details in this header file.
4013 // They are clearly marked by comments like this:
4014 //
4015 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
4016 //
4017 // Such code is NOT meant to be used by a user directly, and is subject
4018 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
4019 // program!
4020 
4021 // GOOGLETEST_CM0001 DO NOT DELETE
4022 
4023 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4024 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4025 
4026 #include <limits>
4027 
4028 
4029 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
4030 /* class A needs to have dll-interface to be used by clients of class B */)
4031 
4032 // Ensures that there is at least one operator<< in the global namespace.
4033 // See Message& operator<<(...) below for why.
4034 void operator<<(const testing::internal::Secret&, int);
4035 
4036 namespace testing {
4037 
4038 // The Message class works like an ostream repeater.
4039 //
4040 // Typical usage:
4041 //
4042 //   1. You stream a bunch of values to a Message object.
4043 //      It will remember the text in a stringstream.
4044 //   2. Then you stream the Message object to an ostream.
4045 //      This causes the text in the Message to be streamed
4046 //      to the ostream.
4047 //
4048 // For example;
4049 //
4050 //   testing::Message foo;
4051 //   foo << 1 << " != " << 2;
4052 //   std::cout << foo;
4053 //
4054 // will print "1 != 2".
4055 //
4056 // Message is not intended to be inherited from.  In particular, its
4057 // destructor is not virtual.
4058 //
4059 // Note that stringstream behaves differently in gcc and in MSVC.  You
4060 // can stream a NULL char pointer to it in the former, but not in the
4061 // latter (it causes an access violation if you do).  The Message
4062 // class hides this difference by treating a NULL char pointer as
4063 // "(null)".
4064 class GTEST_API_ Message {
4065  private:
4066   // The type of basic IO manipulators (endl, ends, and flush) for
4067   // narrow streams.
4068   typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
4069 
4070  public:
4071   // Constructs an empty Message.
4072   Message();
4073 
4074   // Copy constructor.
4075   Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
4076     *ss_ << msg.GetString();
4077   }
4078 
4079   // Constructs a Message from a C-string.
4080   explicit Message(const char* str) : ss_(new ::std::stringstream) {
4081     *ss_ << str;
4082   }
4083 
4084 #if GTEST_OS_SYMBIAN
4085   // Streams a value (either a pointer or not) to this object.
4086   template <typename T>
4087   inline Message& operator <<(const T& value) {
4088     StreamHelper(typename internal::is_pointer<T>::type(), value);
4089     return *this;
4090   }
4091 #else
4092   // Streams a non-pointer value to this object.
4093   template <typename T>
4094   inline Message& operator <<(const T& val) {
4095     // Some libraries overload << for STL containers.  These
4096     // overloads are defined in the global namespace instead of ::std.
4097     //
4098     // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
4099     // overloads are visible in either the std namespace or the global
4100     // namespace, but not other namespaces, including the testing
4101     // namespace which Google Test's Message class is in.
4102     //
4103     // To allow STL containers (and other types that has a << operator
4104     // defined in the global namespace) to be used in Google Test
4105     // assertions, testing::Message must access the custom << operator
4106     // from the global namespace.  With this using declaration,
4107     // overloads of << defined in the global namespace and those
4108     // visible via Koenig lookup are both exposed in this function.
4109     using ::operator <<;
4110     *ss_ << val;
4111     return *this;
4112   }
4113 
4114   // Streams a pointer value to this object.
4115   //
4116   // This function is an overload of the previous one.  When you
4117   // stream a pointer to a Message, this definition will be used as it
4118   // is more specialized.  (The C++ Standard, section
4119   // [temp.func.order].)  If you stream a non-pointer, then the
4120   // previous definition will be used.
4121   //
4122   // The reason for this overload is that streaming a NULL pointer to
4123   // ostream is undefined behavior.  Depending on the compiler, you
4124   // may get "0", "(nil)", "(null)", or an access violation.  To
4125   // ensure consistent result across compilers, we always treat NULL
4126   // as "(null)".
4127   template <typename T>
4128   inline Message& operator <<(T* const& pointer) {  // NOLINT
4129     if (pointer == NULL) {
4130       *ss_ << "(null)";
4131     } else {
4132       *ss_ << pointer;
4133     }
4134     return *this;
4135   }
4136 #endif  // GTEST_OS_SYMBIAN
4137 
4138   // Since the basic IO manipulators are overloaded for both narrow
4139   // and wide streams, we have to provide this specialized definition
4140   // of operator <<, even though its body is the same as the
4141   // templatized version above.  Without this definition, streaming
4142   // endl or other basic IO manipulators to Message will confuse the
4143   // compiler.
4144   Message& operator <<(BasicNarrowIoManip val) {
4145     *ss_ << val;
4146     return *this;
4147   }
4148 
4149   // Instead of 1/0, we want to see true/false for bool values.
4150   Message& operator <<(bool b) {
4151     return *this << (b ? "true" : "false");
4152   }
4153 
4154   // These two overloads allow streaming a wide C string to a Message
4155   // using the UTF-8 encoding.
4156   Message& operator <<(const wchar_t* wide_c_str);
4157   Message& operator <<(wchar_t* wide_c_str);
4158 
4159 #if GTEST_HAS_STD_WSTRING
4160   // Converts the given wide string to a narrow string using the UTF-8
4161   // encoding, and streams the result to this Message object.
4162   Message& operator <<(const ::std::wstring& wstr);
4163 #endif  // GTEST_HAS_STD_WSTRING
4164 
4165 #if GTEST_HAS_GLOBAL_WSTRING
4166   // Converts the given wide string to a narrow string using the UTF-8
4167   // encoding, and streams the result to this Message object.
4168   Message& operator <<(const ::wstring& wstr);
4169 #endif  // GTEST_HAS_GLOBAL_WSTRING
4170 
4171   // Gets the text streamed to this object so far as an std::string.
4172   // Each '\0' character in the buffer is replaced with "\\0".
4173   //
4174   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
4175   std::string GetString() const;
4176 
4177  private:
4178 #if GTEST_OS_SYMBIAN
4179   // These are needed as the Nokia Symbian Compiler cannot decide between
4180   // const T& and const T* in a function template. The Nokia compiler _can_
4181   // decide between class template specializations for T and T*, so a
4182   // tr1::type_traits-like is_pointer works, and we can overload on that.
4183   template <typename T>
4184   inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
4185     if (pointer == NULL) {
4186       *ss_ << "(null)";
4187     } else {
4188       *ss_ << pointer;
4189     }
4190   }
4191   template <typename T>
4192   inline void StreamHelper(internal::false_type /*is_pointer*/,
4193                            const T& value) {
4194     // See the comments in Message& operator <<(const T&) above for why
4195     // we need this using statement.
4196     using ::operator <<;
4197     *ss_ << value;
4198   }
4199 #endif  // GTEST_OS_SYMBIAN
4200 
4201   // We'll hold the text streamed to this object here.
4202   const internal::scoped_ptr< ::std::stringstream> ss_;
4203 
4204   // We declare (but don't implement) this to prevent the compiler
4205   // from implementing the assignment operator.
4206   void operator=(const Message&);
4207 };
4208 
4209 // Streams a Message to an ostream.
4210 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
4211   return os << sb.GetString();
4212 }
4213 
4214 namespace internal {
4215 
4216 // Converts a streamable value to an std::string.  A NULL pointer is
4217 // converted to "(null)".  When the input value is a ::string,
4218 // ::std::string, ::wstring, or ::std::wstring object, each NUL
4219 // character in it is replaced with "\\0".
4220 template <typename T>
4221 std::string StreamableToString(const T& streamable) {
4222   return (Message() << streamable).GetString();
4223 }
4224 
4225 }  // namespace internal
4226 }  // namespace testing
4227 
4228 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251
4229 
4230 #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4231 // Copyright 2008, Google Inc.
4232 // All rights reserved.
4233 //
4234 // Redistribution and use in source and binary forms, with or without
4235 // modification, are permitted provided that the following conditions are
4236 // met:
4237 //
4238 //     * Redistributions of source code must retain the above copyright
4239 // notice, this list of conditions and the following disclaimer.
4240 //     * Redistributions in binary form must reproduce the above
4241 // copyright notice, this list of conditions and the following disclaimer
4242 // in the documentation and/or other materials provided with the
4243 // distribution.
4244 //     * Neither the name of Google Inc. nor the names of its
4245 // contributors may be used to endorse or promote products derived from
4246 // this software without specific prior written permission.
4247 //
4248 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4249 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4250 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4251 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4252 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4253 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4254 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4255 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4256 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4257 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4258 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4259 //
4260 // Google Test filepath utilities
4261 //
4262 // This header file declares classes and functions used internally by
4263 // Google Test.  They are subject to change without notice.
4264 //
4265 // This file is #included in gtest/internal/gtest-internal.h.
4266 // Do not include this header file separately!
4267 
4268 // GOOGLETEST_CM0001 DO NOT DELETE
4269 
4270 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4271 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4272 
4273 // Copyright 2005, Google Inc.
4274 // All rights reserved.
4275 //
4276 // Redistribution and use in source and binary forms, with or without
4277 // modification, are permitted provided that the following conditions are
4278 // met:
4279 //
4280 //     * Redistributions of source code must retain the above copyright
4281 // notice, this list of conditions and the following disclaimer.
4282 //     * Redistributions in binary form must reproduce the above
4283 // copyright notice, this list of conditions and the following disclaimer
4284 // in the documentation and/or other materials provided with the
4285 // distribution.
4286 //     * Neither the name of Google Inc. nor the names of its
4287 // contributors may be used to endorse or promote products derived from
4288 // this software without specific prior written permission.
4289 //
4290 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4291 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4292 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4293 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4294 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4295 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4296 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4297 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4298 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4299 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4300 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4301 //
4302 // The Google C++ Testing and Mocking Framework (Google Test)
4303 //
4304 // This header file declares the String class and functions used internally by
4305 // Google Test.  They are subject to change without notice. They should not used
4306 // by code external to Google Test.
4307 //
4308 // This header file is #included by gtest-internal.h.
4309 // It should not be #included by other files.
4310 
4311 // GOOGLETEST_CM0001 DO NOT DELETE
4312 
4313 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4314 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4315 
4316 #ifdef __BORLANDC__
4317 // string.h is not guaranteed to provide strcpy on C++ Builder.
4318 # include <mem.h>
4319 #endif
4320 
4321 #include <string.h>
4322 #include <string>
4323 
4324 
4325 namespace testing {
4326 namespace internal {
4327 
4328 // String - an abstract class holding static string utilities.
4329 class GTEST_API_ String {
4330  public:
4331   // Static utility methods
4332 
4333   // Clones a 0-terminated C string, allocating memory using new.  The
4334   // caller is responsible for deleting the return value using
4335   // delete[].  Returns the cloned string, or NULL if the input is
4336   // NULL.
4337   //
4338   // This is different from strdup() in string.h, which allocates
4339   // memory using malloc().
4340   static const char* CloneCString(const char* c_str);
4341 
4342 #if GTEST_OS_WINDOWS_MOBILE
4343   // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
4344   // able to pass strings to Win32 APIs on CE we need to convert them
4345   // to 'Unicode', UTF-16.
4346 
4347   // Creates a UTF-16 wide string from the given ANSI string, allocating
4348   // memory using new. The caller is responsible for deleting the return
4349   // value using delete[]. Returns the wide string, or NULL if the
4350   // input is NULL.
4351   //
4352   // The wide string is created using the ANSI codepage (CP_ACP) to
4353   // match the behaviour of the ANSI versions of Win32 calls and the
4354   // C runtime.
4355   static LPCWSTR AnsiToUtf16(const char* c_str);
4356 
4357   // Creates an ANSI string from the given wide string, allocating
4358   // memory using new. The caller is responsible for deleting the return
4359   // value using delete[]. Returns the ANSI string, or NULL if the
4360   // input is NULL.
4361   //
4362   // The returned string is created using the ANSI codepage (CP_ACP) to
4363   // match the behaviour of the ANSI versions of Win32 calls and the
4364   // C runtime.
4365   static const char* Utf16ToAnsi(LPCWSTR utf16_str);
4366 #endif
4367 
4368   // Compares two C strings.  Returns true iff they have the same content.
4369   //
4370   // Unlike strcmp(), this function can handle NULL argument(s).  A
4371   // NULL C string is considered different to any non-NULL C string,
4372   // including the empty string.
4373   static bool CStringEquals(const char* lhs, const char* rhs);
4374 
4375   // Converts a wide C string to a String using the UTF-8 encoding.
4376   // NULL will be converted to "(null)".  If an error occurred during
4377   // the conversion, "(failed to convert from wide string)" is
4378   // returned.
4379   static std::string ShowWideCString(const wchar_t* wide_c_str);
4380 
4381   // Compares two wide C strings.  Returns true iff they have the same
4382   // content.
4383   //
4384   // Unlike wcscmp(), this function can handle NULL argument(s).  A
4385   // NULL C string is considered different to any non-NULL C string,
4386   // including the empty string.
4387   static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
4388 
4389   // Compares two C strings, ignoring case.  Returns true iff they
4390   // have the same content.
4391   //
4392   // Unlike strcasecmp(), this function can handle NULL argument(s).
4393   // A NULL C string is considered different to any non-NULL C string,
4394   // including the empty string.
4395   static bool CaseInsensitiveCStringEquals(const char* lhs,
4396                                            const char* rhs);
4397 
4398   // Compares two wide C strings, ignoring case.  Returns true iff they
4399   // have the same content.
4400   //
4401   // Unlike wcscasecmp(), this function can handle NULL argument(s).
4402   // A NULL C string is considered different to any non-NULL wide C string,
4403   // including the empty string.
4404   // NB: The implementations on different platforms slightly differ.
4405   // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
4406   // environment variable. On GNU platform this method uses wcscasecmp
4407   // which compares according to LC_CTYPE category of the current locale.
4408   // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
4409   // current locale.
4410   static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
4411                                                const wchar_t* rhs);
4412 
4413   // Returns true iff the given string ends with the given suffix, ignoring
4414   // case. Any string is considered to end with an empty suffix.
4415   static bool EndsWithCaseInsensitive(
4416       const std::string& str, const std::string& suffix);
4417 
4418   // Formats an int value as "%02d".
4419   static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
4420 
4421   // Formats an int value as "%X".
4422   static std::string FormatHexInt(int value);
4423 
4424   // Formats a byte as "%02X".
4425   static std::string FormatByte(unsigned char value);
4426 
4427  private:
4428   String();  // Not meant to be instantiated.
4429 };  // class String
4430 
4431 // Gets the content of the stringstream's buffer as an std::string.  Each '\0'
4432 // character in the buffer is replaced with "\\0".
4433 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
4434 
4435 }  // namespace internal
4436 }  // namespace testing
4437 
4438 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4439 
4440 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
4441 /* class A needs to have dll-interface to be used by clients of class B */)
4442 
4443 namespace testing {
4444 namespace internal {
4445 
4446 // FilePath - a class for file and directory pathname manipulation which
4447 // handles platform-specific conventions (like the pathname separator).
4448 // Used for helper functions for naming files in a directory for xml output.
4449 // Except for Set methods, all methods are const or static, which provides an
4450 // "immutable value object" -- useful for peace of mind.
4451 // A FilePath with a value ending in a path separator ("like/this/") represents
4452 // a directory, otherwise it is assumed to represent a file. In either case,
4453 // it may or may not represent an actual file or directory in the file system.
4454 // Names are NOT checked for syntax correctness -- no checking for illegal
4455 // characters, malformed paths, etc.
4456 
4457 class GTEST_API_ FilePath {
4458  public:
4459   FilePath() : pathname_("") { }
4460   FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
4461 
4462   explicit FilePath(const std::string& pathname) : pathname_(pathname) {
4463     Normalize();
4464   }
4465 
4466   FilePath& operator=(const FilePath& rhs) {
4467     Set(rhs);
4468     return *this;
4469   }
4470 
4471   void Set(const FilePath& rhs) {
4472     pathname_ = rhs.pathname_;
4473   }
4474 
4475   const std::string& string() const { return pathname_; }
4476   const char* c_str() const { return pathname_.c_str(); }
4477 
4478   // Returns the current working directory, or "" if unsuccessful.
4479   static FilePath GetCurrentDir();
4480 
4481   // Given directory = "dir", base_name = "test", number = 0,
4482   // extension = "xml", returns "dir/test.xml". If number is greater
4483   // than zero (e.g., 12), returns "dir/test_12.xml".
4484   // On Windows platform, uses \ as the separator rather than /.
4485   static FilePath MakeFileName(const FilePath& directory,
4486                                const FilePath& base_name,
4487                                int number,
4488                                const char* extension);
4489 
4490   // Given directory = "dir", relative_path = "test.xml",
4491   // returns "dir/test.xml".
4492   // On Windows, uses \ as the separator rather than /.
4493   static FilePath ConcatPaths(const FilePath& directory,
4494                               const FilePath& relative_path);
4495 
4496   // Returns a pathname for a file that does not currently exist. The pathname
4497   // will be directory/base_name.extension or
4498   // directory/base_name_<number>.extension if directory/base_name.extension
4499   // already exists. The number will be incremented until a pathname is found
4500   // that does not already exist.
4501   // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
4502   // There could be a race condition if two or more processes are calling this
4503   // function at the same time -- they could both pick the same filename.
4504   static FilePath GenerateUniqueFileName(const FilePath& directory,
4505                                          const FilePath& base_name,
4506                                          const char* extension);
4507 
4508   // Returns true iff the path is "".
4509   bool IsEmpty() const { return pathname_.empty(); }
4510 
4511   // If input name has a trailing separator character, removes it and returns
4512   // the name, otherwise return the name string unmodified.
4513   // On Windows platform, uses \ as the separator, other platforms use /.
4514   FilePath RemoveTrailingPathSeparator() const;
4515 
4516   // Returns a copy of the FilePath with the directory part removed.
4517   // Example: FilePath("path/to/file").RemoveDirectoryName() returns
4518   // FilePath("file"). If there is no directory part ("just_a_file"), it returns
4519   // the FilePath unmodified. If there is no file part ("just_a_dir/") it
4520   // returns an empty FilePath ("").
4521   // On Windows platform, '\' is the path separator, otherwise it is '/'.
4522   FilePath RemoveDirectoryName() const;
4523 
4524   // RemoveFileName returns the directory path with the filename removed.
4525   // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
4526   // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
4527   // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
4528   // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
4529   // On Windows platform, '\' is the path separator, otherwise it is '/'.
4530   FilePath RemoveFileName() const;
4531 
4532   // Returns a copy of the FilePath with the case-insensitive extension removed.
4533   // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
4534   // FilePath("dir/file"). If a case-insensitive extension is not
4535   // found, returns a copy of the original FilePath.
4536   FilePath RemoveExtension(const char* extension) const;
4537 
4538   // Creates directories so that path exists. Returns true if successful or if
4539   // the directories already exist; returns false if unable to create
4540   // directories for any reason. Will also return false if the FilePath does
4541   // not represent a directory (that is, it doesn't end with a path separator).
4542   bool CreateDirectoriesRecursively() const;
4543 
4544   // Create the directory so that path exists. Returns true if successful or
4545   // if the directory already exists; returns false if unable to create the
4546   // directory for any reason, including if the parent directory does not
4547   // exist. Not named "CreateDirectory" because that's a macro on Windows.
4548   bool CreateFolder() const;
4549 
4550   // Returns true if FilePath describes something in the file-system,
4551   // either a file, directory, or whatever, and that something exists.
4552   bool FileOrDirectoryExists() const;
4553 
4554   // Returns true if pathname describes a directory in the file-system
4555   // that exists.
4556   bool DirectoryExists() const;
4557 
4558   // Returns true if FilePath ends with a path separator, which indicates that
4559   // it is intended to represent a directory. Returns false otherwise.
4560   // This does NOT check that a directory (or file) actually exists.
4561   bool IsDirectory() const;
4562 
4563   // Returns true if pathname describes a root directory. (Windows has one
4564   // root directory per disk drive.)
4565   bool IsRootDirectory() const;
4566 
4567   // Returns true if pathname describes an absolute path.
4568   bool IsAbsolutePath() const;
4569 
4570  private:
4571   // Replaces multiple consecutive separators with a single separator.
4572   // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
4573   // redundancies that might be in a pathname involving "." or "..".
4574   //
4575   // A pathname with multiple consecutive separators may occur either through
4576   // user error or as a result of some scripts or APIs that generate a pathname
4577   // with a trailing separator. On other platforms the same API or script
4578   // may NOT generate a pathname with a trailing "/". Then elsewhere that
4579   // pathname may have another "/" and pathname components added to it,
4580   // without checking for the separator already being there.
4581   // The script language and operating system may allow paths like "foo//bar"
4582   // but some of the functions in FilePath will not handle that correctly. In
4583   // particular, RemoveTrailingPathSeparator() only removes one separator, and
4584   // it is called in CreateDirectoriesRecursively() assuming that it will change
4585   // a pathname from directory syntax (trailing separator) to filename syntax.
4586   //
4587   // On Windows this method also replaces the alternate path separator '/' with
4588   // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
4589   // "bar\\foo".
4590 
4591   void Normalize();
4592 
4593   // Returns a pointer to the last occurence of a valid path separator in
4594   // the FilePath. On Windows, for example, both '/' and '\' are valid path
4595   // separators. Returns NULL if no path separator was found.
4596   const char* FindLastPathSeparator() const;
4597 
4598   std::string pathname_;
4599 };  // class FilePath
4600 
4601 }  // namespace internal
4602 }  // namespace testing
4603 
4604 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251
4605 
4606 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4607 // This file was GENERATED by command:
4608 //     pump.py gtest-type-util.h.pump
4609 // DO NOT EDIT BY HAND!!!
4610 
4611 // Copyright 2008 Google Inc.
4612 // All Rights Reserved.
4613 //
4614 // Redistribution and use in source and binary forms, with or without
4615 // modification, are permitted provided that the following conditions are
4616 // met:
4617 //
4618 //     * Redistributions of source code must retain the above copyright
4619 // notice, this list of conditions and the following disclaimer.
4620 //     * Redistributions in binary form must reproduce the above
4621 // copyright notice, this list of conditions and the following disclaimer
4622 // in the documentation and/or other materials provided with the
4623 // distribution.
4624 //     * Neither the name of Google Inc. nor the names of its
4625 // contributors may be used to endorse or promote products derived from
4626 // this software without specific prior written permission.
4627 //
4628 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4629 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4630 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4631 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4632 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4633 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4634 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4635 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4636 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4637 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4638 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4639 
4640 
4641 // Type utilities needed for implementing typed and type-parameterized
4642 // tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
4643 //
4644 // Currently we support at most 50 types in a list, and at most 50
4645 // type-parameterized tests in one type-parameterized test case.
4646 // Please contact googletestframework@googlegroups.com if you need
4647 // more.
4648 
4649 // GOOGLETEST_CM0001 DO NOT DELETE
4650 
4651 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
4652 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
4653 
4654 
4655 // #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
4656 // libstdc++ (which is where cxxabi.h comes from).
4657 # if GTEST_HAS_CXXABI_H_
4658 #  include <cxxabi.h>
4659 # elif defined(__HP_aCC)
4660 #  include <acxx_demangle.h>
4661 # endif  // GTEST_HASH_CXXABI_H_
4662 
4663 namespace testing {
4664 namespace internal {
4665 
4666 // Canonicalizes a given name with respect to the Standard C++ Library.
4667 // This handles removing the inline namespace within `std` that is
4668 // used by various standard libraries (e.g., `std::__1`).  Names outside
4669 // of namespace std are returned unmodified.
4670 inline std::string CanonicalizeForStdLibVersioning(std::string s) {
4671   static const char prefix[] = "std::__";
4672   if (s.compare(0, strlen(prefix), prefix) == 0) {
4673     std::string::size_type end = s.find("::", strlen(prefix));
4674     if (end != s.npos) {
4675       // Erase everything between the initial `std` and the second `::`.
4676       s.erase(strlen("std"), end - strlen("std"));
4677     }
4678   }
4679   return s;
4680 }
4681 
4682 // GetTypeName<T>() returns a human-readable name of type T.
4683 // NB: This function is also used in Google Mock, so don't move it inside of
4684 // the typed-test-only section below.
4685 template <typename T>
4686 std::string GetTypeName() {
4687 # if GTEST_HAS_RTTI
4688 
4689   const char* const name = typeid(T).name();
4690 #  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
4691   int status = 0;
4692   // gcc's implementation of typeid(T).name() mangles the type name,
4693   // so we have to demangle it.
4694 #   if GTEST_HAS_CXXABI_H_
4695   using abi::__cxa_demangle;
4696 #   endif  // GTEST_HAS_CXXABI_H_
4697   char* const readable_name = __cxa_demangle(name, 0, 0, &status);
4698   const std::string name_str(status == 0 ? readable_name : name);
4699   free(readable_name);
4700   return CanonicalizeForStdLibVersioning(name_str);
4701 #  else
4702   return name;
4703 #  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
4704 
4705 # else
4706 
4707   return "<type>";
4708 
4709 # endif  // GTEST_HAS_RTTI
4710 }
4711 
4712 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
4713 
4714 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
4715 // type.  This can be used as a compile-time assertion to ensure that
4716 // two types are equal.
4717 
4718 template <typename T1, typename T2>
4719 struct AssertTypeEq;
4720 
4721 template <typename T>
4722 struct AssertTypeEq<T, T> {
4723   typedef bool type;
4724 };
4725 
4726 // A unique type used as the default value for the arguments of class
4727 // template Types.  This allows us to simulate variadic templates
4728 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
4729 // support directly.
4730 struct None {};
4731 
4732 // The following family of struct and struct templates are used to
4733 // represent type lists.  In particular, TypesN<T1, T2, ..., TN>
4734 // represents a type list with N types (T1, T2, ..., and TN) in it.
4735 // Except for Types0, every struct in the family has two member types:
4736 // Head for the first type in the list, and Tail for the rest of the
4737 // list.
4738 
4739 // The empty type list.
4740 struct Types0 {};
4741 
4742 // Type lists of length 1, 2, 3, and so on.
4743 
4744 template <typename T1>
4745 struct Types1 {
4746   typedef T1 Head;
4747   typedef Types0 Tail;
4748 };
4749 template <typename T1, typename T2>
4750 struct Types2 {
4751   typedef T1 Head;
4752   typedef Types1<T2> Tail;
4753 };
4754 
4755 template <typename T1, typename T2, typename T3>
4756 struct Types3 {
4757   typedef T1 Head;
4758   typedef Types2<T2, T3> Tail;
4759 };
4760 
4761 template <typename T1, typename T2, typename T3, typename T4>
4762 struct Types4 {
4763   typedef T1 Head;
4764   typedef Types3<T2, T3, T4> Tail;
4765 };
4766 
4767 template <typename T1, typename T2, typename T3, typename T4, typename T5>
4768 struct Types5 {
4769   typedef T1 Head;
4770   typedef Types4<T2, T3, T4, T5> Tail;
4771 };
4772 
4773 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4774     typename T6>
4775 struct Types6 {
4776   typedef T1 Head;
4777   typedef Types5<T2, T3, T4, T5, T6> Tail;
4778 };
4779 
4780 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4781     typename T6, typename T7>
4782 struct Types7 {
4783   typedef T1 Head;
4784   typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
4785 };
4786 
4787 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4788     typename T6, typename T7, typename T8>
4789 struct Types8 {
4790   typedef T1 Head;
4791   typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
4792 };
4793 
4794 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4795     typename T6, typename T7, typename T8, typename T9>
4796 struct Types9 {
4797   typedef T1 Head;
4798   typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
4799 };
4800 
4801 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4802     typename T6, typename T7, typename T8, typename T9, typename T10>
4803 struct Types10 {
4804   typedef T1 Head;
4805   typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
4806 };
4807 
4808 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4809     typename T6, typename T7, typename T8, typename T9, typename T10,
4810     typename T11>
4811 struct Types11 {
4812   typedef T1 Head;
4813   typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
4814 };
4815 
4816 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4817     typename T6, typename T7, typename T8, typename T9, typename T10,
4818     typename T11, typename T12>
4819 struct Types12 {
4820   typedef T1 Head;
4821   typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
4822 };
4823 
4824 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4825     typename T6, typename T7, typename T8, typename T9, typename T10,
4826     typename T11, typename T12, typename T13>
4827 struct Types13 {
4828   typedef T1 Head;
4829   typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
4830 };
4831 
4832 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4833     typename T6, typename T7, typename T8, typename T9, typename T10,
4834     typename T11, typename T12, typename T13, typename T14>
4835 struct Types14 {
4836   typedef T1 Head;
4837   typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
4838 };
4839 
4840 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4841     typename T6, typename T7, typename T8, typename T9, typename T10,
4842     typename T11, typename T12, typename T13, typename T14, typename T15>
4843 struct Types15 {
4844   typedef T1 Head;
4845   typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4846       T15> Tail;
4847 };
4848 
4849 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4850     typename T6, typename T7, typename T8, typename T9, typename T10,
4851     typename T11, typename T12, typename T13, typename T14, typename T15,
4852     typename T16>
4853 struct Types16 {
4854   typedef T1 Head;
4855   typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4856       T16> Tail;
4857 };
4858 
4859 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4860     typename T6, typename T7, typename T8, typename T9, typename T10,
4861     typename T11, typename T12, typename T13, typename T14, typename T15,
4862     typename T16, typename T17>
4863 struct Types17 {
4864   typedef T1 Head;
4865   typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4866       T16, T17> Tail;
4867 };
4868 
4869 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4870     typename T6, typename T7, typename T8, typename T9, typename T10,
4871     typename T11, typename T12, typename T13, typename T14, typename T15,
4872     typename T16, typename T17, typename T18>
4873 struct Types18 {
4874   typedef T1 Head;
4875   typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4876       T16, T17, T18> Tail;
4877 };
4878 
4879 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4880     typename T6, typename T7, typename T8, typename T9, typename T10,
4881     typename T11, typename T12, typename T13, typename T14, typename T15,
4882     typename T16, typename T17, typename T18, typename T19>
4883 struct Types19 {
4884   typedef T1 Head;
4885   typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4886       T16, T17, T18, T19> Tail;
4887 };
4888 
4889 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4890     typename T6, typename T7, typename T8, typename T9, typename T10,
4891     typename T11, typename T12, typename T13, typename T14, typename T15,
4892     typename T16, typename T17, typename T18, typename T19, typename T20>
4893 struct Types20 {
4894   typedef T1 Head;
4895   typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4896       T16, T17, T18, T19, T20> Tail;
4897 };
4898 
4899 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4900     typename T6, typename T7, typename T8, typename T9, typename T10,
4901     typename T11, typename T12, typename T13, typename T14, typename T15,
4902     typename T16, typename T17, typename T18, typename T19, typename T20,
4903     typename T21>
4904 struct Types21 {
4905   typedef T1 Head;
4906   typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4907       T16, T17, T18, T19, T20, T21> Tail;
4908 };
4909 
4910 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4911     typename T6, typename T7, typename T8, typename T9, typename T10,
4912     typename T11, typename T12, typename T13, typename T14, typename T15,
4913     typename T16, typename T17, typename T18, typename T19, typename T20,
4914     typename T21, typename T22>
4915 struct Types22 {
4916   typedef T1 Head;
4917   typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4918       T16, T17, T18, T19, T20, T21, T22> Tail;
4919 };
4920 
4921 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4922     typename T6, typename T7, typename T8, typename T9, typename T10,
4923     typename T11, typename T12, typename T13, typename T14, typename T15,
4924     typename T16, typename T17, typename T18, typename T19, typename T20,
4925     typename T21, typename T22, typename T23>
4926 struct Types23 {
4927   typedef T1 Head;
4928   typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4929       T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4930 };
4931 
4932 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4933     typename T6, typename T7, typename T8, typename T9, typename T10,
4934     typename T11, typename T12, typename T13, typename T14, typename T15,
4935     typename T16, typename T17, typename T18, typename T19, typename T20,
4936     typename T21, typename T22, typename T23, typename T24>
4937 struct Types24 {
4938   typedef T1 Head;
4939   typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4940       T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4941 };
4942 
4943 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4944     typename T6, typename T7, typename T8, typename T9, typename T10,
4945     typename T11, typename T12, typename T13, typename T14, typename T15,
4946     typename T16, typename T17, typename T18, typename T19, typename T20,
4947     typename T21, typename T22, typename T23, typename T24, typename T25>
4948 struct Types25 {
4949   typedef T1 Head;
4950   typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4951       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4952 };
4953 
4954 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4955     typename T6, typename T7, typename T8, typename T9, typename T10,
4956     typename T11, typename T12, typename T13, typename T14, typename T15,
4957     typename T16, typename T17, typename T18, typename T19, typename T20,
4958     typename T21, typename T22, typename T23, typename T24, typename T25,
4959     typename T26>
4960 struct Types26 {
4961   typedef T1 Head;
4962   typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4963       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4964 };
4965 
4966 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4967     typename T6, typename T7, typename T8, typename T9, typename T10,
4968     typename T11, typename T12, typename T13, typename T14, typename T15,
4969     typename T16, typename T17, typename T18, typename T19, typename T20,
4970     typename T21, typename T22, typename T23, typename T24, typename T25,
4971     typename T26, typename T27>
4972 struct Types27 {
4973   typedef T1 Head;
4974   typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4975       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4976 };
4977 
4978 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4979     typename T6, typename T7, typename T8, typename T9, typename T10,
4980     typename T11, typename T12, typename T13, typename T14, typename T15,
4981     typename T16, typename T17, typename T18, typename T19, typename T20,
4982     typename T21, typename T22, typename T23, typename T24, typename T25,
4983     typename T26, typename T27, typename T28>
4984 struct Types28 {
4985   typedef T1 Head;
4986   typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4987       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4988 };
4989 
4990 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4991     typename T6, typename T7, typename T8, typename T9, typename T10,
4992     typename T11, typename T12, typename T13, typename T14, typename T15,
4993     typename T16, typename T17, typename T18, typename T19, typename T20,
4994     typename T21, typename T22, typename T23, typename T24, typename T25,
4995     typename T26, typename T27, typename T28, typename T29>
4996 struct Types29 {
4997   typedef T1 Head;
4998   typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4999       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5000       T29> Tail;
5001 };
5002 
5003 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5004     typename T6, typename T7, typename T8, typename T9, typename T10,
5005     typename T11, typename T12, typename T13, typename T14, typename T15,
5006     typename T16, typename T17, typename T18, typename T19, typename T20,
5007     typename T21, typename T22, typename T23, typename T24, typename T25,
5008     typename T26, typename T27, typename T28, typename T29, typename T30>
5009 struct Types30 {
5010   typedef T1 Head;
5011   typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5012       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5013       T30> Tail;
5014 };
5015 
5016 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5017     typename T6, typename T7, typename T8, typename T9, typename T10,
5018     typename T11, typename T12, typename T13, typename T14, typename T15,
5019     typename T16, typename T17, typename T18, typename T19, typename T20,
5020     typename T21, typename T22, typename T23, typename T24, typename T25,
5021     typename T26, typename T27, typename T28, typename T29, typename T30,
5022     typename T31>
5023 struct Types31 {
5024   typedef T1 Head;
5025   typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5026       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5027       T30, T31> Tail;
5028 };
5029 
5030 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5031     typename T6, typename T7, typename T8, typename T9, typename T10,
5032     typename T11, typename T12, typename T13, typename T14, typename T15,
5033     typename T16, typename T17, typename T18, typename T19, typename T20,
5034     typename T21, typename T22, typename T23, typename T24, typename T25,
5035     typename T26, typename T27, typename T28, typename T29, typename T30,
5036     typename T31, typename T32>
5037 struct Types32 {
5038   typedef T1 Head;
5039   typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5040       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5041       T30, T31, T32> Tail;
5042 };
5043 
5044 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5045     typename T6, typename T7, typename T8, typename T9, typename T10,
5046     typename T11, typename T12, typename T13, typename T14, typename T15,
5047     typename T16, typename T17, typename T18, typename T19, typename T20,
5048     typename T21, typename T22, typename T23, typename T24, typename T25,
5049     typename T26, typename T27, typename T28, typename T29, typename T30,
5050     typename T31, typename T32, typename T33>
5051 struct Types33 {
5052   typedef T1 Head;
5053   typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5054       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5055       T30, T31, T32, T33> Tail;
5056 };
5057 
5058 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5059     typename T6, typename T7, typename T8, typename T9, typename T10,
5060     typename T11, typename T12, typename T13, typename T14, typename T15,
5061     typename T16, typename T17, typename T18, typename T19, typename T20,
5062     typename T21, typename T22, typename T23, typename T24, typename T25,
5063     typename T26, typename T27, typename T28, typename T29, typename T30,
5064     typename T31, typename T32, typename T33, typename T34>
5065 struct Types34 {
5066   typedef T1 Head;
5067   typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5068       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5069       T30, T31, T32, T33, T34> Tail;
5070 };
5071 
5072 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5073     typename T6, typename T7, typename T8, typename T9, typename T10,
5074     typename T11, typename T12, typename T13, typename T14, typename T15,
5075     typename T16, typename T17, typename T18, typename T19, typename T20,
5076     typename T21, typename T22, typename T23, typename T24, typename T25,
5077     typename T26, typename T27, typename T28, typename T29, typename T30,
5078     typename T31, typename T32, typename T33, typename T34, typename T35>
5079 struct Types35 {
5080   typedef T1 Head;
5081   typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5082       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5083       T30, T31, T32, T33, T34, T35> Tail;
5084 };
5085 
5086 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5087     typename T6, typename T7, typename T8, typename T9, typename T10,
5088     typename T11, typename T12, typename T13, typename T14, typename T15,
5089     typename T16, typename T17, typename T18, typename T19, typename T20,
5090     typename T21, typename T22, typename T23, typename T24, typename T25,
5091     typename T26, typename T27, typename T28, typename T29, typename T30,
5092     typename T31, typename T32, typename T33, typename T34, typename T35,
5093     typename T36>
5094 struct Types36 {
5095   typedef T1 Head;
5096   typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5097       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5098       T30, T31, T32, T33, T34, T35, T36> Tail;
5099 };
5100 
5101 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5102     typename T6, typename T7, typename T8, typename T9, typename T10,
5103     typename T11, typename T12, typename T13, typename T14, typename T15,
5104     typename T16, typename T17, typename T18, typename T19, typename T20,
5105     typename T21, typename T22, typename T23, typename T24, typename T25,
5106     typename T26, typename T27, typename T28, typename T29, typename T30,
5107     typename T31, typename T32, typename T33, typename T34, typename T35,
5108     typename T36, typename T37>
5109 struct Types37 {
5110   typedef T1 Head;
5111   typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5112       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5113       T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5114 };
5115 
5116 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5117     typename T6, typename T7, typename T8, typename T9, typename T10,
5118     typename T11, typename T12, typename T13, typename T14, typename T15,
5119     typename T16, typename T17, typename T18, typename T19, typename T20,
5120     typename T21, typename T22, typename T23, typename T24, typename T25,
5121     typename T26, typename T27, typename T28, typename T29, typename T30,
5122     typename T31, typename T32, typename T33, typename T34, typename T35,
5123     typename T36, typename T37, typename T38>
5124 struct Types38 {
5125   typedef T1 Head;
5126   typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5127       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5128       T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5129 };
5130 
5131 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5132     typename T6, typename T7, typename T8, typename T9, typename T10,
5133     typename T11, typename T12, typename T13, typename T14, typename T15,
5134     typename T16, typename T17, typename T18, typename T19, typename T20,
5135     typename T21, typename T22, typename T23, typename T24, typename T25,
5136     typename T26, typename T27, typename T28, typename T29, typename T30,
5137     typename T31, typename T32, typename T33, typename T34, typename T35,
5138     typename T36, typename T37, typename T38, typename T39>
5139 struct Types39 {
5140   typedef T1 Head;
5141   typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5142       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5143       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5144 };
5145 
5146 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5147     typename T6, typename T7, typename T8, typename T9, typename T10,
5148     typename T11, typename T12, typename T13, typename T14, typename T15,
5149     typename T16, typename T17, typename T18, typename T19, typename T20,
5150     typename T21, typename T22, typename T23, typename T24, typename T25,
5151     typename T26, typename T27, typename T28, typename T29, typename T30,
5152     typename T31, typename T32, typename T33, typename T34, typename T35,
5153     typename T36, typename T37, typename T38, typename T39, typename T40>
5154 struct Types40 {
5155   typedef T1 Head;
5156   typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5157       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5158       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5159 };
5160 
5161 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5162     typename T6, typename T7, typename T8, typename T9, typename T10,
5163     typename T11, typename T12, typename T13, typename T14, typename T15,
5164     typename T16, typename T17, typename T18, typename T19, typename T20,
5165     typename T21, typename T22, typename T23, typename T24, typename T25,
5166     typename T26, typename T27, typename T28, typename T29, typename T30,
5167     typename T31, typename T32, typename T33, typename T34, typename T35,
5168     typename T36, typename T37, typename T38, typename T39, typename T40,
5169     typename T41>
5170 struct Types41 {
5171   typedef T1 Head;
5172   typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5173       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5174       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5175 };
5176 
5177 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5178     typename T6, typename T7, typename T8, typename T9, typename T10,
5179     typename T11, typename T12, typename T13, typename T14, typename T15,
5180     typename T16, typename T17, typename T18, typename T19, typename T20,
5181     typename T21, typename T22, typename T23, typename T24, typename T25,
5182     typename T26, typename T27, typename T28, typename T29, typename T30,
5183     typename T31, typename T32, typename T33, typename T34, typename T35,
5184     typename T36, typename T37, typename T38, typename T39, typename T40,
5185     typename T41, typename T42>
5186 struct Types42 {
5187   typedef T1 Head;
5188   typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5189       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5190       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
5191 };
5192 
5193 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5194     typename T6, typename T7, typename T8, typename T9, typename T10,
5195     typename T11, typename T12, typename T13, typename T14, typename T15,
5196     typename T16, typename T17, typename T18, typename T19, typename T20,
5197     typename T21, typename T22, typename T23, typename T24, typename T25,
5198     typename T26, typename T27, typename T28, typename T29, typename T30,
5199     typename T31, typename T32, typename T33, typename T34, typename T35,
5200     typename T36, typename T37, typename T38, typename T39, typename T40,
5201     typename T41, typename T42, typename T43>
5202 struct Types43 {
5203   typedef T1 Head;
5204   typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5205       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5206       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5207       T43> Tail;
5208 };
5209 
5210 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5211     typename T6, typename T7, typename T8, typename T9, typename T10,
5212     typename T11, typename T12, typename T13, typename T14, typename T15,
5213     typename T16, typename T17, typename T18, typename T19, typename T20,
5214     typename T21, typename T22, typename T23, typename T24, typename T25,
5215     typename T26, typename T27, typename T28, typename T29, typename T30,
5216     typename T31, typename T32, typename T33, typename T34, typename T35,
5217     typename T36, typename T37, typename T38, typename T39, typename T40,
5218     typename T41, typename T42, typename T43, typename T44>
5219 struct Types44 {
5220   typedef T1 Head;
5221   typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5222       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5223       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5224       T44> Tail;
5225 };
5226 
5227 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5228     typename T6, typename T7, typename T8, typename T9, typename T10,
5229     typename T11, typename T12, typename T13, typename T14, typename T15,
5230     typename T16, typename T17, typename T18, typename T19, typename T20,
5231     typename T21, typename T22, typename T23, typename T24, typename T25,
5232     typename T26, typename T27, typename T28, typename T29, typename T30,
5233     typename T31, typename T32, typename T33, typename T34, typename T35,
5234     typename T36, typename T37, typename T38, typename T39, typename T40,
5235     typename T41, typename T42, typename T43, typename T44, typename T45>
5236 struct Types45 {
5237   typedef T1 Head;
5238   typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5239       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5240       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5241       T44, T45> Tail;
5242 };
5243 
5244 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5245     typename T6, typename T7, typename T8, typename T9, typename T10,
5246     typename T11, typename T12, typename T13, typename T14, typename T15,
5247     typename T16, typename T17, typename T18, typename T19, typename T20,
5248     typename T21, typename T22, typename T23, typename T24, typename T25,
5249     typename T26, typename T27, typename T28, typename T29, typename T30,
5250     typename T31, typename T32, typename T33, typename T34, typename T35,
5251     typename T36, typename T37, typename T38, typename T39, typename T40,
5252     typename T41, typename T42, typename T43, typename T44, typename T45,
5253     typename T46>
5254 struct Types46 {
5255   typedef T1 Head;
5256   typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5257       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5258       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5259       T44, T45, T46> Tail;
5260 };
5261 
5262 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5263     typename T6, typename T7, typename T8, typename T9, typename T10,
5264     typename T11, typename T12, typename T13, typename T14, typename T15,
5265     typename T16, typename T17, typename T18, typename T19, typename T20,
5266     typename T21, typename T22, typename T23, typename T24, typename T25,
5267     typename T26, typename T27, typename T28, typename T29, typename T30,
5268     typename T31, typename T32, typename T33, typename T34, typename T35,
5269     typename T36, typename T37, typename T38, typename T39, typename T40,
5270     typename T41, typename T42, typename T43, typename T44, typename T45,
5271     typename T46, typename T47>
5272 struct Types47 {
5273   typedef T1 Head;
5274   typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5275       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5276       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5277       T44, T45, T46, T47> Tail;
5278 };
5279 
5280 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5281     typename T6, typename T7, typename T8, typename T9, typename T10,
5282     typename T11, typename T12, typename T13, typename T14, typename T15,
5283     typename T16, typename T17, typename T18, typename T19, typename T20,
5284     typename T21, typename T22, typename T23, typename T24, typename T25,
5285     typename T26, typename T27, typename T28, typename T29, typename T30,
5286     typename T31, typename T32, typename T33, typename T34, typename T35,
5287     typename T36, typename T37, typename T38, typename T39, typename T40,
5288     typename T41, typename T42, typename T43, typename T44, typename T45,
5289     typename T46, typename T47, typename T48>
5290 struct Types48 {
5291   typedef T1 Head;
5292   typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5293       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5294       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5295       T44, T45, T46, T47, T48> Tail;
5296 };
5297 
5298 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5299     typename T6, typename T7, typename T8, typename T9, typename T10,
5300     typename T11, typename T12, typename T13, typename T14, typename T15,
5301     typename T16, typename T17, typename T18, typename T19, typename T20,
5302     typename T21, typename T22, typename T23, typename T24, typename T25,
5303     typename T26, typename T27, typename T28, typename T29, typename T30,
5304     typename T31, typename T32, typename T33, typename T34, typename T35,
5305     typename T36, typename T37, typename T38, typename T39, typename T40,
5306     typename T41, typename T42, typename T43, typename T44, typename T45,
5307     typename T46, typename T47, typename T48, typename T49>
5308 struct Types49 {
5309   typedef T1 Head;
5310   typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5311       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5312       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5313       T44, T45, T46, T47, T48, T49> Tail;
5314 };
5315 
5316 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5317     typename T6, typename T7, typename T8, typename T9, typename T10,
5318     typename T11, typename T12, typename T13, typename T14, typename T15,
5319     typename T16, typename T17, typename T18, typename T19, typename T20,
5320     typename T21, typename T22, typename T23, typename T24, typename T25,
5321     typename T26, typename T27, typename T28, typename T29, typename T30,
5322     typename T31, typename T32, typename T33, typename T34, typename T35,
5323     typename T36, typename T37, typename T38, typename T39, typename T40,
5324     typename T41, typename T42, typename T43, typename T44, typename T45,
5325     typename T46, typename T47, typename T48, typename T49, typename T50>
5326 struct Types50 {
5327   typedef T1 Head;
5328   typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5329       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5330       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5331       T44, T45, T46, T47, T48, T49, T50> Tail;
5332 };
5333 
5334 
5335 }  // namespace internal
5336 
5337 // We don't want to require the users to write TypesN<...> directly,
5338 // as that would require them to count the length.  Types<...> is much
5339 // easier to write, but generates horrible messages when there is a
5340 // compiler error, as gcc insists on printing out each template
5341 // argument, even if it has the default value (this means Types<int>
5342 // will appear as Types<int, None, None, ..., None> in the compiler
5343 // errors).
5344 //
5345 // Our solution is to combine the best part of the two approaches: a
5346 // user would write Types<T1, ..., TN>, and Google Test will translate
5347 // that to TypesN<T1, ..., TN> internally to make error messages
5348 // readable.  The translation is done by the 'type' member of the
5349 // Types template.
5350 template <typename T1 = internal::None, typename T2 = internal::None,
5351     typename T3 = internal::None, typename T4 = internal::None,
5352     typename T5 = internal::None, typename T6 = internal::None,
5353     typename T7 = internal::None, typename T8 = internal::None,
5354     typename T9 = internal::None, typename T10 = internal::None,
5355     typename T11 = internal::None, typename T12 = internal::None,
5356     typename T13 = internal::None, typename T14 = internal::None,
5357     typename T15 = internal::None, typename T16 = internal::None,
5358     typename T17 = internal::None, typename T18 = internal::None,
5359     typename T19 = internal::None, typename T20 = internal::None,
5360     typename T21 = internal::None, typename T22 = internal::None,
5361     typename T23 = internal::None, typename T24 = internal::None,
5362     typename T25 = internal::None, typename T26 = internal::None,
5363     typename T27 = internal::None, typename T28 = internal::None,
5364     typename T29 = internal::None, typename T30 = internal::None,
5365     typename T31 = internal::None, typename T32 = internal::None,
5366     typename T33 = internal::None, typename T34 = internal::None,
5367     typename T35 = internal::None, typename T36 = internal::None,
5368     typename T37 = internal::None, typename T38 = internal::None,
5369     typename T39 = internal::None, typename T40 = internal::None,
5370     typename T41 = internal::None, typename T42 = internal::None,
5371     typename T43 = internal::None, typename T44 = internal::None,
5372     typename T45 = internal::None, typename T46 = internal::None,
5373     typename T47 = internal::None, typename T48 = internal::None,
5374     typename T49 = internal::None, typename T50 = internal::None>
5375 struct Types {
5376   typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5377       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5378       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5379       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
5380 };
5381 
5382 template <>
5383 struct Types<internal::None, internal::None, internal::None, internal::None,
5384     internal::None, internal::None, internal::None, internal::None,
5385     internal::None, internal::None, internal::None, internal::None,
5386     internal::None, internal::None, internal::None, internal::None,
5387     internal::None, internal::None, internal::None, internal::None,
5388     internal::None, internal::None, internal::None, internal::None,
5389     internal::None, internal::None, internal::None, internal::None,
5390     internal::None, internal::None, internal::None, internal::None,
5391     internal::None, internal::None, internal::None, internal::None,
5392     internal::None, internal::None, internal::None, internal::None,
5393     internal::None, internal::None, internal::None, internal::None,
5394     internal::None, internal::None, internal::None, internal::None,
5395     internal::None, internal::None> {
5396   typedef internal::Types0 type;
5397 };
5398 template <typename T1>
5399 struct Types<T1, internal::None, internal::None, internal::None,
5400     internal::None, internal::None, internal::None, internal::None,
5401     internal::None, internal::None, internal::None, internal::None,
5402     internal::None, internal::None, internal::None, internal::None,
5403     internal::None, internal::None, internal::None, internal::None,
5404     internal::None, internal::None, internal::None, internal::None,
5405     internal::None, internal::None, internal::None, internal::None,
5406     internal::None, internal::None, internal::None, internal::None,
5407     internal::None, internal::None, internal::None, internal::None,
5408     internal::None, internal::None, internal::None, internal::None,
5409     internal::None, internal::None, internal::None, internal::None,
5410     internal::None, internal::None, internal::None, internal::None,
5411     internal::None, internal::None> {
5412   typedef internal::Types1<T1> type;
5413 };
5414 template <typename T1, typename T2>
5415 struct Types<T1, T2, internal::None, internal::None, internal::None,
5416     internal::None, internal::None, internal::None, internal::None,
5417     internal::None, internal::None, internal::None, internal::None,
5418     internal::None, internal::None, internal::None, internal::None,
5419     internal::None, internal::None, internal::None, internal::None,
5420     internal::None, internal::None, internal::None, internal::None,
5421     internal::None, internal::None, internal::None, internal::None,
5422     internal::None, internal::None, internal::None, internal::None,
5423     internal::None, internal::None, internal::None, internal::None,
5424     internal::None, internal::None, internal::None, internal::None,
5425     internal::None, internal::None, internal::None, internal::None,
5426     internal::None, internal::None, internal::None, internal::None,
5427     internal::None> {
5428   typedef internal::Types2<T1, T2> type;
5429 };
5430 template <typename T1, typename T2, typename T3>
5431 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
5432     internal::None, internal::None, internal::None, internal::None,
5433     internal::None, internal::None, internal::None, internal::None,
5434     internal::None, internal::None, internal::None, internal::None,
5435     internal::None, internal::None, internal::None, internal::None,
5436     internal::None, internal::None, internal::None, internal::None,
5437     internal::None, internal::None, internal::None, internal::None,
5438     internal::None, internal::None, internal::None, internal::None,
5439     internal::None, internal::None, internal::None, internal::None,
5440     internal::None, internal::None, internal::None, internal::None,
5441     internal::None, internal::None, internal::None, internal::None,
5442     internal::None, internal::None, internal::None, internal::None> {
5443   typedef internal::Types3<T1, T2, T3> type;
5444 };
5445 template <typename T1, typename T2, typename T3, typename T4>
5446 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
5447     internal::None, internal::None, internal::None, internal::None,
5448     internal::None, internal::None, internal::None, internal::None,
5449     internal::None, internal::None, internal::None, internal::None,
5450     internal::None, internal::None, internal::None, internal::None,
5451     internal::None, internal::None, internal::None, internal::None,
5452     internal::None, internal::None, internal::None, internal::None,
5453     internal::None, internal::None, internal::None, internal::None,
5454     internal::None, internal::None, internal::None, internal::None,
5455     internal::None, internal::None, internal::None, internal::None,
5456     internal::None, internal::None, internal::None, internal::None,
5457     internal::None, internal::None, internal::None> {
5458   typedef internal::Types4<T1, T2, T3, T4> type;
5459 };
5460 template <typename T1, typename T2, typename T3, typename T4, typename T5>
5461 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
5462     internal::None, internal::None, internal::None, internal::None,
5463     internal::None, internal::None, internal::None, internal::None,
5464     internal::None, internal::None, internal::None, internal::None,
5465     internal::None, internal::None, internal::None, internal::None,
5466     internal::None, internal::None, internal::None, internal::None,
5467     internal::None, internal::None, internal::None, internal::None,
5468     internal::None, internal::None, internal::None, internal::None,
5469     internal::None, internal::None, internal::None, internal::None,
5470     internal::None, internal::None, internal::None, internal::None,
5471     internal::None, internal::None, internal::None, internal::None,
5472     internal::None, internal::None, internal::None> {
5473   typedef internal::Types5<T1, T2, T3, T4, T5> type;
5474 };
5475 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5476     typename T6>
5477 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
5478     internal::None, internal::None, internal::None, internal::None,
5479     internal::None, internal::None, internal::None, internal::None,
5480     internal::None, internal::None, internal::None, internal::None,
5481     internal::None, internal::None, internal::None, internal::None,
5482     internal::None, internal::None, internal::None, internal::None,
5483     internal::None, internal::None, internal::None, internal::None,
5484     internal::None, internal::None, internal::None, internal::None,
5485     internal::None, internal::None, internal::None, internal::None,
5486     internal::None, internal::None, internal::None, internal::None,
5487     internal::None, internal::None, internal::None, internal::None,
5488     internal::None, internal::None> {
5489   typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
5490 };
5491 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5492     typename T6, typename T7>
5493 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
5494     internal::None, internal::None, internal::None, internal::None,
5495     internal::None, internal::None, internal::None, internal::None,
5496     internal::None, internal::None, internal::None, internal::None,
5497     internal::None, internal::None, internal::None, internal::None,
5498     internal::None, internal::None, internal::None, internal::None,
5499     internal::None, internal::None, internal::None, internal::None,
5500     internal::None, internal::None, internal::None, internal::None,
5501     internal::None, internal::None, internal::None, internal::None,
5502     internal::None, internal::None, internal::None, internal::None,
5503     internal::None, internal::None, internal::None, internal::None,
5504     internal::None> {
5505   typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
5506 };
5507 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5508     typename T6, typename T7, typename T8>
5509 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
5510     internal::None, internal::None, internal::None, internal::None,
5511     internal::None, internal::None, internal::None, internal::None,
5512     internal::None, internal::None, internal::None, internal::None,
5513     internal::None, internal::None, internal::None, internal::None,
5514     internal::None, internal::None, internal::None, internal::None,
5515     internal::None, internal::None, internal::None, internal::None,
5516     internal::None, internal::None, internal::None, internal::None,
5517     internal::None, internal::None, internal::None, internal::None,
5518     internal::None, internal::None, internal::None, internal::None,
5519     internal::None, internal::None, internal::None, internal::None> {
5520   typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
5521 };
5522 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5523     typename T6, typename T7, typename T8, typename T9>
5524 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
5525     internal::None, internal::None, internal::None, internal::None,
5526     internal::None, internal::None, internal::None, internal::None,
5527     internal::None, internal::None, internal::None, internal::None,
5528     internal::None, internal::None, internal::None, internal::None,
5529     internal::None, internal::None, internal::None, internal::None,
5530     internal::None, internal::None, internal::None, internal::None,
5531     internal::None, internal::None, internal::None, internal::None,
5532     internal::None, internal::None, internal::None, internal::None,
5533     internal::None, internal::None, internal::None, internal::None,
5534     internal::None, internal::None, internal::None, internal::None> {
5535   typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
5536 };
5537 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5538     typename T6, typename T7, typename T8, typename T9, typename T10>
5539 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
5540     internal::None, internal::None, internal::None, internal::None,
5541     internal::None, internal::None, internal::None, internal::None,
5542     internal::None, internal::None, internal::None, internal::None,
5543     internal::None, internal::None, internal::None, internal::None,
5544     internal::None, internal::None, internal::None, internal::None,
5545     internal::None, internal::None, internal::None, internal::None,
5546     internal::None, internal::None, internal::None, internal::None,
5547     internal::None, internal::None, internal::None, internal::None,
5548     internal::None, internal::None, internal::None, internal::None,
5549     internal::None, internal::None, internal::None> {
5550   typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
5551 };
5552 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5553     typename T6, typename T7, typename T8, typename T9, typename T10,
5554     typename T11>
5555 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
5556     internal::None, internal::None, internal::None, internal::None,
5557     internal::None, internal::None, internal::None, internal::None,
5558     internal::None, internal::None, internal::None, internal::None,
5559     internal::None, internal::None, internal::None, internal::None,
5560     internal::None, internal::None, internal::None, internal::None,
5561     internal::None, internal::None, internal::None, internal::None,
5562     internal::None, internal::None, internal::None, internal::None,
5563     internal::None, internal::None, internal::None, internal::None,
5564     internal::None, internal::None, internal::None, internal::None,
5565     internal::None, internal::None> {
5566   typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
5567 };
5568 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5569     typename T6, typename T7, typename T8, typename T9, typename T10,
5570     typename T11, typename T12>
5571 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
5572     internal::None, internal::None, internal::None, internal::None,
5573     internal::None, internal::None, internal::None, internal::None,
5574     internal::None, internal::None, internal::None, internal::None,
5575     internal::None, internal::None, internal::None, internal::None,
5576     internal::None, internal::None, internal::None, internal::None,
5577     internal::None, internal::None, internal::None, internal::None,
5578     internal::None, internal::None, internal::None, internal::None,
5579     internal::None, internal::None, internal::None, internal::None,
5580     internal::None, internal::None, internal::None, internal::None,
5581     internal::None> {
5582   typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
5583       T12> type;
5584 };
5585 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5586     typename T6, typename T7, typename T8, typename T9, typename T10,
5587     typename T11, typename T12, typename T13>
5588 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5589     internal::None, internal::None, internal::None, internal::None,
5590     internal::None, internal::None, internal::None, internal::None,
5591     internal::None, internal::None, internal::None, internal::None,
5592     internal::None, internal::None, internal::None, internal::None,
5593     internal::None, internal::None, internal::None, internal::None,
5594     internal::None, internal::None, internal::None, internal::None,
5595     internal::None, internal::None, internal::None, internal::None,
5596     internal::None, internal::None, internal::None, internal::None,
5597     internal::None, internal::None, internal::None, internal::None,
5598     internal::None> {
5599   typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5600       T13> type;
5601 };
5602 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5603     typename T6, typename T7, typename T8, typename T9, typename T10,
5604     typename T11, typename T12, typename T13, typename T14>
5605 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5606     internal::None, internal::None, internal::None, internal::None,
5607     internal::None, internal::None, internal::None, internal::None,
5608     internal::None, internal::None, internal::None, internal::None,
5609     internal::None, internal::None, internal::None, internal::None,
5610     internal::None, internal::None, internal::None, internal::None,
5611     internal::None, internal::None, internal::None, internal::None,
5612     internal::None, internal::None, internal::None, internal::None,
5613     internal::None, internal::None, internal::None, internal::None,
5614     internal::None, internal::None, internal::None, internal::None> {
5615   typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5616       T13, T14> type;
5617 };
5618 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5619     typename T6, typename T7, typename T8, typename T9, typename T10,
5620     typename T11, typename T12, typename T13, typename T14, typename T15>
5621 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5622     internal::None, internal::None, internal::None, internal::None,
5623     internal::None, internal::None, internal::None, internal::None,
5624     internal::None, internal::None, internal::None, internal::None,
5625     internal::None, internal::None, internal::None, internal::None,
5626     internal::None, internal::None, internal::None, internal::None,
5627     internal::None, internal::None, internal::None, internal::None,
5628     internal::None, internal::None, internal::None, internal::None,
5629     internal::None, internal::None, internal::None, internal::None,
5630     internal::None, internal::None, internal::None> {
5631   typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5632       T13, T14, T15> type;
5633 };
5634 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5635     typename T6, typename T7, typename T8, typename T9, typename T10,
5636     typename T11, typename T12, typename T13, typename T14, typename T15,
5637     typename T16>
5638 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5639     T16, internal::None, internal::None, internal::None, internal::None,
5640     internal::None, internal::None, internal::None, internal::None,
5641     internal::None, internal::None, internal::None, internal::None,
5642     internal::None, internal::None, internal::None, internal::None,
5643     internal::None, internal::None, internal::None, internal::None,
5644     internal::None, internal::None, internal::None, internal::None,
5645     internal::None, internal::None, internal::None, internal::None,
5646     internal::None, internal::None, internal::None, internal::None,
5647     internal::None, internal::None> {
5648   typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5649       T13, T14, T15, T16> type;
5650 };
5651 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5652     typename T6, typename T7, typename T8, typename T9, typename T10,
5653     typename T11, typename T12, typename T13, typename T14, typename T15,
5654     typename T16, typename T17>
5655 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5656     T16, T17, internal::None, internal::None, internal::None, internal::None,
5657     internal::None, internal::None, internal::None, internal::None,
5658     internal::None, internal::None, internal::None, internal::None,
5659     internal::None, internal::None, internal::None, internal::None,
5660     internal::None, internal::None, internal::None, internal::None,
5661     internal::None, internal::None, internal::None, internal::None,
5662     internal::None, internal::None, internal::None, internal::None,
5663     internal::None, internal::None, internal::None, internal::None,
5664     internal::None> {
5665   typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5666       T13, T14, T15, T16, T17> type;
5667 };
5668 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5669     typename T6, typename T7, typename T8, typename T9, typename T10,
5670     typename T11, typename T12, typename T13, typename T14, typename T15,
5671     typename T16, typename T17, typename T18>
5672 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5673     T16, T17, T18, internal::None, internal::None, internal::None,
5674     internal::None, internal::None, internal::None, internal::None,
5675     internal::None, internal::None, internal::None, internal::None,
5676     internal::None, internal::None, internal::None, internal::None,
5677     internal::None, internal::None, internal::None, internal::None,
5678     internal::None, internal::None, internal::None, internal::None,
5679     internal::None, internal::None, internal::None, internal::None,
5680     internal::None, internal::None, internal::None, internal::None,
5681     internal::None> {
5682   typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5683       T13, T14, T15, T16, T17, T18> type;
5684 };
5685 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5686     typename T6, typename T7, typename T8, typename T9, typename T10,
5687     typename T11, typename T12, typename T13, typename T14, typename T15,
5688     typename T16, typename T17, typename T18, typename T19>
5689 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5690     T16, T17, T18, T19, internal::None, internal::None, internal::None,
5691     internal::None, internal::None, internal::None, internal::None,
5692     internal::None, internal::None, internal::None, internal::None,
5693     internal::None, internal::None, internal::None, internal::None,
5694     internal::None, internal::None, internal::None, internal::None,
5695     internal::None, internal::None, internal::None, internal::None,
5696     internal::None, internal::None, internal::None, internal::None,
5697     internal::None, internal::None, internal::None, internal::None> {
5698   typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5699       T13, T14, T15, T16, T17, T18, T19> type;
5700 };
5701 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5702     typename T6, typename T7, typename T8, typename T9, typename T10,
5703     typename T11, typename T12, typename T13, typename T14, typename T15,
5704     typename T16, typename T17, typename T18, typename T19, typename T20>
5705 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5706     T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
5707     internal::None, internal::None, internal::None, internal::None,
5708     internal::None, internal::None, internal::None, internal::None,
5709     internal::None, internal::None, internal::None, internal::None,
5710     internal::None, internal::None, internal::None, internal::None,
5711     internal::None, internal::None, internal::None, internal::None,
5712     internal::None, internal::None, internal::None, internal::None,
5713     internal::None, internal::None, internal::None> {
5714   typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5715       T13, T14, T15, T16, T17, T18, T19, T20> type;
5716 };
5717 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5718     typename T6, typename T7, typename T8, typename T9, typename T10,
5719     typename T11, typename T12, typename T13, typename T14, typename T15,
5720     typename T16, typename T17, typename T18, typename T19, typename T20,
5721     typename T21>
5722 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5723     T16, T17, T18, T19, T20, T21, internal::None, internal::None,
5724     internal::None, internal::None, internal::None, internal::None,
5725     internal::None, internal::None, internal::None, internal::None,
5726     internal::None, internal::None, internal::None, internal::None,
5727     internal::None, internal::None, internal::None, internal::None,
5728     internal::None, internal::None, internal::None, internal::None,
5729     internal::None, internal::None, internal::None, internal::None,
5730     internal::None, internal::None, internal::None> {
5731   typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5732       T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
5733 };
5734 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5735     typename T6, typename T7, typename T8, typename T9, typename T10,
5736     typename T11, typename T12, typename T13, typename T14, typename T15,
5737     typename T16, typename T17, typename T18, typename T19, typename T20,
5738     typename T21, typename T22>
5739 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5740     T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
5741     internal::None, internal::None, internal::None, internal::None,
5742     internal::None, internal::None, internal::None, internal::None,
5743     internal::None, internal::None, internal::None, internal::None,
5744     internal::None, internal::None, internal::None, internal::None,
5745     internal::None, internal::None, internal::None, internal::None,
5746     internal::None, internal::None, internal::None, internal::None,
5747     internal::None, internal::None> {
5748   typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5749       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
5750 };
5751 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5752     typename T6, typename T7, typename T8, typename T9, typename T10,
5753     typename T11, typename T12, typename T13, typename T14, typename T15,
5754     typename T16, typename T17, typename T18, typename T19, typename T20,
5755     typename T21, typename T22, typename T23>
5756 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5757     T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
5758     internal::None, internal::None, internal::None, internal::None,
5759     internal::None, internal::None, internal::None, internal::None,
5760     internal::None, internal::None, internal::None, internal::None,
5761     internal::None, internal::None, internal::None, internal::None,
5762     internal::None, internal::None, internal::None, internal::None,
5763     internal::None, internal::None, internal::None, internal::None,
5764     internal::None> {
5765   typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5766       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
5767 };
5768 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5769     typename T6, typename T7, typename T8, typename T9, typename T10,
5770     typename T11, typename T12, typename T13, typename T14, typename T15,
5771     typename T16, typename T17, typename T18, typename T19, typename T20,
5772     typename T21, typename T22, typename T23, typename T24>
5773 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5774     T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
5775     internal::None, internal::None, internal::None, internal::None,
5776     internal::None, internal::None, internal::None, internal::None,
5777     internal::None, internal::None, internal::None, internal::None,
5778     internal::None, internal::None, internal::None, internal::None,
5779     internal::None, internal::None, internal::None, internal::None,
5780     internal::None, internal::None, internal::None, internal::None,
5781     internal::None> {
5782   typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5783       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
5784 };
5785 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5786     typename T6, typename T7, typename T8, typename T9, typename T10,
5787     typename T11, typename T12, typename T13, typename T14, typename T15,
5788     typename T16, typename T17, typename T18, typename T19, typename T20,
5789     typename T21, typename T22, typename T23, typename T24, typename T25>
5790 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5791     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
5792     internal::None, internal::None, internal::None, internal::None,
5793     internal::None, internal::None, internal::None, internal::None,
5794     internal::None, internal::None, internal::None, internal::None,
5795     internal::None, internal::None, internal::None, internal::None,
5796     internal::None, internal::None, internal::None, internal::None,
5797     internal::None, internal::None, internal::None, internal::None> {
5798   typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5799       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
5800 };
5801 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5802     typename T6, typename T7, typename T8, typename T9, typename T10,
5803     typename T11, typename T12, typename T13, typename T14, typename T15,
5804     typename T16, typename T17, typename T18, typename T19, typename T20,
5805     typename T21, typename T22, typename T23, typename T24, typename T25,
5806     typename T26>
5807 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5808     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
5809     internal::None, internal::None, internal::None, internal::None,
5810     internal::None, internal::None, internal::None, internal::None,
5811     internal::None, internal::None, internal::None, internal::None,
5812     internal::None, internal::None, internal::None, internal::None,
5813     internal::None, internal::None, internal::None, internal::None,
5814     internal::None, internal::None, internal::None> {
5815   typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5816       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
5817       T26> type;
5818 };
5819 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5820     typename T6, typename T7, typename T8, typename T9, typename T10,
5821     typename T11, typename T12, typename T13, typename T14, typename T15,
5822     typename T16, typename T17, typename T18, typename T19, typename T20,
5823     typename T21, typename T22, typename T23, typename T24, typename T25,
5824     typename T26, typename T27>
5825 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5826     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
5827     internal::None, internal::None, internal::None, internal::None,
5828     internal::None, internal::None, internal::None, internal::None,
5829     internal::None, internal::None, internal::None, internal::None,
5830     internal::None, internal::None, internal::None, internal::None,
5831     internal::None, internal::None, internal::None, internal::None,
5832     internal::None, internal::None> {
5833   typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5834       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5835       T27> type;
5836 };
5837 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5838     typename T6, typename T7, typename T8, typename T9, typename T10,
5839     typename T11, typename T12, typename T13, typename T14, typename T15,
5840     typename T16, typename T17, typename T18, typename T19, typename T20,
5841     typename T21, typename T22, typename T23, typename T24, typename T25,
5842     typename T26, typename T27, typename T28>
5843 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5844     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5845     internal::None, internal::None, internal::None, internal::None,
5846     internal::None, internal::None, internal::None, internal::None,
5847     internal::None, internal::None, internal::None, internal::None,
5848     internal::None, internal::None, internal::None, internal::None,
5849     internal::None, internal::None, internal::None, internal::None,
5850     internal::None, internal::None> {
5851   typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5852       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5853       T27, T28> type;
5854 };
5855 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5856     typename T6, typename T7, typename T8, typename T9, typename T10,
5857     typename T11, typename T12, typename T13, typename T14, typename T15,
5858     typename T16, typename T17, typename T18, typename T19, typename T20,
5859     typename T21, typename T22, typename T23, typename T24, typename T25,
5860     typename T26, typename T27, typename T28, typename T29>
5861 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5862     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5863     internal::None, internal::None, internal::None, internal::None,
5864     internal::None, internal::None, internal::None, internal::None,
5865     internal::None, internal::None, internal::None, internal::None,
5866     internal::None, internal::None, internal::None, internal::None,
5867     internal::None, internal::None, internal::None, internal::None,
5868     internal::None> {
5869   typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5870       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5871       T27, T28, T29> type;
5872 };
5873 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5874     typename T6, typename T7, typename T8, typename T9, typename T10,
5875     typename T11, typename T12, typename T13, typename T14, typename T15,
5876     typename T16, typename T17, typename T18, typename T19, typename T20,
5877     typename T21, typename T22, typename T23, typename T24, typename T25,
5878     typename T26, typename T27, typename T28, typename T29, typename T30>
5879 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5880     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5881     internal::None, internal::None, internal::None, internal::None,
5882     internal::None, internal::None, internal::None, internal::None,
5883     internal::None, internal::None, internal::None, internal::None,
5884     internal::None, internal::None, internal::None, internal::None,
5885     internal::None, internal::None, internal::None, internal::None> {
5886   typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5887       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5888       T27, T28, T29, T30> type;
5889 };
5890 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5891     typename T6, typename T7, typename T8, typename T9, typename T10,
5892     typename T11, typename T12, typename T13, typename T14, typename T15,
5893     typename T16, typename T17, typename T18, typename T19, typename T20,
5894     typename T21, typename T22, typename T23, typename T24, typename T25,
5895     typename T26, typename T27, typename T28, typename T29, typename T30,
5896     typename T31>
5897 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5898     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5899     T31, internal::None, internal::None, internal::None, internal::None,
5900     internal::None, internal::None, internal::None, internal::None,
5901     internal::None, internal::None, internal::None, internal::None,
5902     internal::None, internal::None, internal::None, internal::None,
5903     internal::None, internal::None, internal::None> {
5904   typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5905       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5906       T27, T28, T29, T30, T31> type;
5907 };
5908 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5909     typename T6, typename T7, typename T8, typename T9, typename T10,
5910     typename T11, typename T12, typename T13, typename T14, typename T15,
5911     typename T16, typename T17, typename T18, typename T19, typename T20,
5912     typename T21, typename T22, typename T23, typename T24, typename T25,
5913     typename T26, typename T27, typename T28, typename T29, typename T30,
5914     typename T31, typename T32>
5915 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5916     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5917     T31, T32, internal::None, internal::None, internal::None, internal::None,
5918     internal::None, internal::None, internal::None, internal::None,
5919     internal::None, internal::None, internal::None, internal::None,
5920     internal::None, internal::None, internal::None, internal::None,
5921     internal::None, internal::None> {
5922   typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5923       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5924       T27, T28, T29, T30, T31, T32> type;
5925 };
5926 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5927     typename T6, typename T7, typename T8, typename T9, typename T10,
5928     typename T11, typename T12, typename T13, typename T14, typename T15,
5929     typename T16, typename T17, typename T18, typename T19, typename T20,
5930     typename T21, typename T22, typename T23, typename T24, typename T25,
5931     typename T26, typename T27, typename T28, typename T29, typename T30,
5932     typename T31, typename T32, typename T33>
5933 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5934     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5935     T31, T32, T33, internal::None, internal::None, internal::None,
5936     internal::None, internal::None, internal::None, internal::None,
5937     internal::None, internal::None, internal::None, internal::None,
5938     internal::None, internal::None, internal::None, internal::None,
5939     internal::None, internal::None> {
5940   typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5941       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5942       T27, T28, T29, T30, T31, T32, T33> type;
5943 };
5944 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5945     typename T6, typename T7, typename T8, typename T9, typename T10,
5946     typename T11, typename T12, typename T13, typename T14, typename T15,
5947     typename T16, typename T17, typename T18, typename T19, typename T20,
5948     typename T21, typename T22, typename T23, typename T24, typename T25,
5949     typename T26, typename T27, typename T28, typename T29, typename T30,
5950     typename T31, typename T32, typename T33, typename T34>
5951 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5952     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5953     T31, T32, T33, T34, internal::None, internal::None, internal::None,
5954     internal::None, internal::None, internal::None, internal::None,
5955     internal::None, internal::None, internal::None, internal::None,
5956     internal::None, internal::None, internal::None, internal::None,
5957     internal::None> {
5958   typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5959       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5960       T27, T28, T29, T30, T31, T32, T33, T34> type;
5961 };
5962 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5963     typename T6, typename T7, typename T8, typename T9, typename T10,
5964     typename T11, typename T12, typename T13, typename T14, typename T15,
5965     typename T16, typename T17, typename T18, typename T19, typename T20,
5966     typename T21, typename T22, typename T23, typename T24, typename T25,
5967     typename T26, typename T27, typename T28, typename T29, typename T30,
5968     typename T31, typename T32, typename T33, typename T34, typename T35>
5969 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5970     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5971     T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5972     internal::None, internal::None, internal::None, internal::None,
5973     internal::None, internal::None, internal::None, internal::None,
5974     internal::None, internal::None, internal::None, internal::None> {
5975   typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5976       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5977       T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5978 };
5979 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5980     typename T6, typename T7, typename T8, typename T9, typename T10,
5981     typename T11, typename T12, typename T13, typename T14, typename T15,
5982     typename T16, typename T17, typename T18, typename T19, typename T20,
5983     typename T21, typename T22, typename T23, typename T24, typename T25,
5984     typename T26, typename T27, typename T28, typename T29, typename T30,
5985     typename T31, typename T32, typename T33, typename T34, typename T35,
5986     typename T36>
5987 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5988     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5989     T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5990     internal::None, internal::None, internal::None, internal::None,
5991     internal::None, internal::None, internal::None, internal::None,
5992     internal::None, internal::None, internal::None, internal::None> {
5993   typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5994       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5995       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
5996 };
5997 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5998     typename T6, typename T7, typename T8, typename T9, typename T10,
5999     typename T11, typename T12, typename T13, typename T14, typename T15,
6000     typename T16, typename T17, typename T18, typename T19, typename T20,
6001     typename T21, typename T22, typename T23, typename T24, typename T25,
6002     typename T26, typename T27, typename T28, typename T29, typename T30,
6003     typename T31, typename T32, typename T33, typename T34, typename T35,
6004     typename T36, typename T37>
6005 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6006     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6007     T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
6008     internal::None, internal::None, internal::None, internal::None,
6009     internal::None, internal::None, internal::None, internal::None,
6010     internal::None, internal::None, internal::None> {
6011   typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6012       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6013       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6014 };
6015 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6016     typename T6, typename T7, typename T8, typename T9, typename T10,
6017     typename T11, typename T12, typename T13, typename T14, typename T15,
6018     typename T16, typename T17, typename T18, typename T19, typename T20,
6019     typename T21, typename T22, typename T23, typename T24, typename T25,
6020     typename T26, typename T27, typename T28, typename T29, typename T30,
6021     typename T31, typename T32, typename T33, typename T34, typename T35,
6022     typename T36, typename T37, typename T38>
6023 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6024     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6025     T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
6026     internal::None, internal::None, internal::None, internal::None,
6027     internal::None, internal::None, internal::None, internal::None,
6028     internal::None, internal::None> {
6029   typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6030       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6031       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6032 };
6033 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6034     typename T6, typename T7, typename T8, typename T9, typename T10,
6035     typename T11, typename T12, typename T13, typename T14, typename T15,
6036     typename T16, typename T17, typename T18, typename T19, typename T20,
6037     typename T21, typename T22, typename T23, typename T24, typename T25,
6038     typename T26, typename T27, typename T28, typename T29, typename T30,
6039     typename T31, typename T32, typename T33, typename T34, typename T35,
6040     typename T36, typename T37, typename T38, typename T39>
6041 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6042     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6043     T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
6044     internal::None, internal::None, internal::None, internal::None,
6045     internal::None, internal::None, internal::None, internal::None,
6046     internal::None, internal::None> {
6047   typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6048       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6049       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6050 };
6051 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6052     typename T6, typename T7, typename T8, typename T9, typename T10,
6053     typename T11, typename T12, typename T13, typename T14, typename T15,
6054     typename T16, typename T17, typename T18, typename T19, typename T20,
6055     typename T21, typename T22, typename T23, typename T24, typename T25,
6056     typename T26, typename T27, typename T28, typename T29, typename T30,
6057     typename T31, typename T32, typename T33, typename T34, typename T35,
6058     typename T36, typename T37, typename T38, typename T39, typename T40>
6059 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6060     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6061     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
6062     internal::None, internal::None, internal::None, internal::None,
6063     internal::None, internal::None, internal::None, internal::None,
6064     internal::None> {
6065   typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6066       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6067       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
6068       T40> type;
6069 };
6070 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6071     typename T6, typename T7, typename T8, typename T9, typename T10,
6072     typename T11, typename T12, typename T13, typename T14, typename T15,
6073     typename T16, typename T17, typename T18, typename T19, typename T20,
6074     typename T21, typename T22, typename T23, typename T24, typename T25,
6075     typename T26, typename T27, typename T28, typename T29, typename T30,
6076     typename T31, typename T32, typename T33, typename T34, typename T35,
6077     typename T36, typename T37, typename T38, typename T39, typename T40,
6078     typename T41>
6079 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6080     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6081     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
6082     internal::None, internal::None, internal::None, internal::None,
6083     internal::None, internal::None, internal::None, internal::None> {
6084   typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6085       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6086       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6087       T41> type;
6088 };
6089 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6090     typename T6, typename T7, typename T8, typename T9, typename T10,
6091     typename T11, typename T12, typename T13, typename T14, typename T15,
6092     typename T16, typename T17, typename T18, typename T19, typename T20,
6093     typename T21, typename T22, typename T23, typename T24, typename T25,
6094     typename T26, typename T27, typename T28, typename T29, typename T30,
6095     typename T31, typename T32, typename T33, typename T34, typename T35,
6096     typename T36, typename T37, typename T38, typename T39, typename T40,
6097     typename T41, typename T42>
6098 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6099     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6100     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
6101     internal::None, internal::None, internal::None, internal::None,
6102     internal::None, internal::None, internal::None> {
6103   typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6104       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6105       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6106       T41, T42> type;
6107 };
6108 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6109     typename T6, typename T7, typename T8, typename T9, typename T10,
6110     typename T11, typename T12, typename T13, typename T14, typename T15,
6111     typename T16, typename T17, typename T18, typename T19, typename T20,
6112     typename T21, typename T22, typename T23, typename T24, typename T25,
6113     typename T26, typename T27, typename T28, typename T29, typename T30,
6114     typename T31, typename T32, typename T33, typename T34, typename T35,
6115     typename T36, typename T37, typename T38, typename T39, typename T40,
6116     typename T41, typename T42, typename T43>
6117 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6118     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6119     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6120     internal::None, internal::None, internal::None, internal::None,
6121     internal::None, internal::None, internal::None> {
6122   typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6123       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6124       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6125       T41, T42, T43> type;
6126 };
6127 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6128     typename T6, typename T7, typename T8, typename T9, typename T10,
6129     typename T11, typename T12, typename T13, typename T14, typename T15,
6130     typename T16, typename T17, typename T18, typename T19, typename T20,
6131     typename T21, typename T22, typename T23, typename T24, typename T25,
6132     typename T26, typename T27, typename T28, typename T29, typename T30,
6133     typename T31, typename T32, typename T33, typename T34, typename T35,
6134     typename T36, typename T37, typename T38, typename T39, typename T40,
6135     typename T41, typename T42, typename T43, typename T44>
6136 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6137     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6138     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6139     internal::None, internal::None, internal::None, internal::None,
6140     internal::None, internal::None> {
6141   typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6142       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6143       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6144       T41, T42, T43, T44> type;
6145 };
6146 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6147     typename T6, typename T7, typename T8, typename T9, typename T10,
6148     typename T11, typename T12, typename T13, typename T14, typename T15,
6149     typename T16, typename T17, typename T18, typename T19, typename T20,
6150     typename T21, typename T22, typename T23, typename T24, typename T25,
6151     typename T26, typename T27, typename T28, typename T29, typename T30,
6152     typename T31, typename T32, typename T33, typename T34, typename T35,
6153     typename T36, typename T37, typename T38, typename T39, typename T40,
6154     typename T41, typename T42, typename T43, typename T44, typename T45>
6155 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6156     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6157     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6158     internal::None, internal::None, internal::None, internal::None,
6159     internal::None> {
6160   typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6161       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6162       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6163       T41, T42, T43, T44, T45> type;
6164 };
6165 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6166     typename T6, typename T7, typename T8, typename T9, typename T10,
6167     typename T11, typename T12, typename T13, typename T14, typename T15,
6168     typename T16, typename T17, typename T18, typename T19, typename T20,
6169     typename T21, typename T22, typename T23, typename T24, typename T25,
6170     typename T26, typename T27, typename T28, typename T29, typename T30,
6171     typename T31, typename T32, typename T33, typename T34, typename T35,
6172     typename T36, typename T37, typename T38, typename T39, typename T40,
6173     typename T41, typename T42, typename T43, typename T44, typename T45,
6174     typename T46>
6175 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6176     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6177     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6178     T46, internal::None, internal::None, internal::None, internal::None> {
6179   typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6180       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6181       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6182       T41, T42, T43, T44, T45, T46> type;
6183 };
6184 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6185     typename T6, typename T7, typename T8, typename T9, typename T10,
6186     typename T11, typename T12, typename T13, typename T14, typename T15,
6187     typename T16, typename T17, typename T18, typename T19, typename T20,
6188     typename T21, typename T22, typename T23, typename T24, typename T25,
6189     typename T26, typename T27, typename T28, typename T29, typename T30,
6190     typename T31, typename T32, typename T33, typename T34, typename T35,
6191     typename T36, typename T37, typename T38, typename T39, typename T40,
6192     typename T41, typename T42, typename T43, typename T44, typename T45,
6193     typename T46, typename T47>
6194 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6195     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6196     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6197     T46, T47, internal::None, internal::None, internal::None> {
6198   typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6199       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6200       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6201       T41, T42, T43, T44, T45, T46, T47> type;
6202 };
6203 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6204     typename T6, typename T7, typename T8, typename T9, typename T10,
6205     typename T11, typename T12, typename T13, typename T14, typename T15,
6206     typename T16, typename T17, typename T18, typename T19, typename T20,
6207     typename T21, typename T22, typename T23, typename T24, typename T25,
6208     typename T26, typename T27, typename T28, typename T29, typename T30,
6209     typename T31, typename T32, typename T33, typename T34, typename T35,
6210     typename T36, typename T37, typename T38, typename T39, typename T40,
6211     typename T41, typename T42, typename T43, typename T44, typename T45,
6212     typename T46, typename T47, typename T48>
6213 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6214     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6215     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6216     T46, T47, T48, internal::None, internal::None> {
6217   typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6218       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6219       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6220       T41, T42, T43, T44, T45, T46, T47, T48> type;
6221 };
6222 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6223     typename T6, typename T7, typename T8, typename T9, typename T10,
6224     typename T11, typename T12, typename T13, typename T14, typename T15,
6225     typename T16, typename T17, typename T18, typename T19, typename T20,
6226     typename T21, typename T22, typename T23, typename T24, typename T25,
6227     typename T26, typename T27, typename T28, typename T29, typename T30,
6228     typename T31, typename T32, typename T33, typename T34, typename T35,
6229     typename T36, typename T37, typename T38, typename T39, typename T40,
6230     typename T41, typename T42, typename T43, typename T44, typename T45,
6231     typename T46, typename T47, typename T48, typename T49>
6232 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6233     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6234     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6235     T46, T47, T48, T49, internal::None> {
6236   typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6237       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6238       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6239       T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
6240 };
6241 
6242 namespace internal {
6243 
6244 # define GTEST_TEMPLATE_ template <typename T> class
6245 
6246 // The template "selector" struct TemplateSel<Tmpl> is used to
6247 // represent Tmpl, which must be a class template with one type
6248 // parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
6249 // as the type Tmpl<T>.  This allows us to actually instantiate the
6250 // template "selected" by TemplateSel<Tmpl>.
6251 //
6252 // This trick is necessary for simulating typedef for class templates,
6253 // which C++ doesn't support directly.
6254 template <GTEST_TEMPLATE_ Tmpl>
6255 struct TemplateSel {
6256   template <typename T>
6257   struct Bind {
6258     typedef Tmpl<T> type;
6259   };
6260 };
6261 
6262 # define GTEST_BIND_(TmplSel, T) \
6263   TmplSel::template Bind<T>::type
6264 
6265 // A unique struct template used as the default value for the
6266 // arguments of class template Templates.  This allows us to simulate
6267 // variadic templates (e.g. Templates<int>, Templates<int, double>,
6268 // and etc), which C++ doesn't support directly.
6269 template <typename T>
6270 struct NoneT {};
6271 
6272 // The following family of struct and struct templates are used to
6273 // represent template lists.  In particular, TemplatesN<T1, T2, ...,
6274 // TN> represents a list of N templates (T1, T2, ..., and TN).  Except
6275 // for Templates0, every struct in the family has two member types:
6276 // Head for the selector of the first template in the list, and Tail
6277 // for the rest of the list.
6278 
6279 // The empty template list.
6280 struct Templates0 {};
6281 
6282 // Template lists of length 1, 2, 3, and so on.
6283 
6284 template <GTEST_TEMPLATE_ T1>
6285 struct Templates1 {
6286   typedef TemplateSel<T1> Head;
6287   typedef Templates0 Tail;
6288 };
6289 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6290 struct Templates2 {
6291   typedef TemplateSel<T1> Head;
6292   typedef Templates1<T2> Tail;
6293 };
6294 
6295 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6296 struct Templates3 {
6297   typedef TemplateSel<T1> Head;
6298   typedef Templates2<T2, T3> Tail;
6299 };
6300 
6301 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6302     GTEST_TEMPLATE_ T4>
6303 struct Templates4 {
6304   typedef TemplateSel<T1> Head;
6305   typedef Templates3<T2, T3, T4> Tail;
6306 };
6307 
6308 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6309     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6310 struct Templates5 {
6311   typedef TemplateSel<T1> Head;
6312   typedef Templates4<T2, T3, T4, T5> Tail;
6313 };
6314 
6315 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6316     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6317 struct Templates6 {
6318   typedef TemplateSel<T1> Head;
6319   typedef Templates5<T2, T3, T4, T5, T6> Tail;
6320 };
6321 
6322 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6323     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6324     GTEST_TEMPLATE_ T7>
6325 struct Templates7 {
6326   typedef TemplateSel<T1> Head;
6327   typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
6328 };
6329 
6330 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6331     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6332     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6333 struct Templates8 {
6334   typedef TemplateSel<T1> Head;
6335   typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
6336 };
6337 
6338 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6339     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6340     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6341 struct Templates9 {
6342   typedef TemplateSel<T1> Head;
6343   typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
6344 };
6345 
6346 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6347     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6348     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6349     GTEST_TEMPLATE_ T10>
6350 struct Templates10 {
6351   typedef TemplateSel<T1> Head;
6352   typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
6353 };
6354 
6355 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6356     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6357     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6358     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6359 struct Templates11 {
6360   typedef TemplateSel<T1> Head;
6361   typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
6362 };
6363 
6364 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6365     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6366     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6367     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6368 struct Templates12 {
6369   typedef TemplateSel<T1> Head;
6370   typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
6371 };
6372 
6373 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6374     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6375     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6376     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6377     GTEST_TEMPLATE_ T13>
6378 struct Templates13 {
6379   typedef TemplateSel<T1> Head;
6380   typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
6381 };
6382 
6383 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6384     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6385     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6386     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6387     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6388 struct Templates14 {
6389   typedef TemplateSel<T1> Head;
6390   typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6391       T14> Tail;
6392 };
6393 
6394 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6395     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6396     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6397     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6398     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6399 struct Templates15 {
6400   typedef TemplateSel<T1> Head;
6401   typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6402       T15> Tail;
6403 };
6404 
6405 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6406     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6407     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6408     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6409     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6410     GTEST_TEMPLATE_ T16>
6411 struct Templates16 {
6412   typedef TemplateSel<T1> Head;
6413   typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6414       T15, T16> Tail;
6415 };
6416 
6417 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6418     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6419     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6420     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6421     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6422     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6423 struct Templates17 {
6424   typedef TemplateSel<T1> Head;
6425   typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6426       T15, T16, T17> Tail;
6427 };
6428 
6429 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6430     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6431     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6432     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6433     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6434     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6435 struct Templates18 {
6436   typedef TemplateSel<T1> Head;
6437   typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6438       T15, T16, T17, T18> Tail;
6439 };
6440 
6441 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6442     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6443     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6444     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6445     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6446     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6447     GTEST_TEMPLATE_ T19>
6448 struct Templates19 {
6449   typedef TemplateSel<T1> Head;
6450   typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6451       T15, T16, T17, T18, T19> Tail;
6452 };
6453 
6454 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6455     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6456     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6457     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6458     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6459     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6460     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6461 struct Templates20 {
6462   typedef TemplateSel<T1> Head;
6463   typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6464       T15, T16, T17, T18, T19, T20> Tail;
6465 };
6466 
6467 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6468     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6469     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6470     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6471     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6472     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6473     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6474 struct Templates21 {
6475   typedef TemplateSel<T1> Head;
6476   typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6477       T15, T16, T17, T18, T19, T20, T21> Tail;
6478 };
6479 
6480 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6481     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6482     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6483     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6484     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6485     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6486     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6487     GTEST_TEMPLATE_ T22>
6488 struct Templates22 {
6489   typedef TemplateSel<T1> Head;
6490   typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6491       T15, T16, T17, T18, T19, T20, T21, T22> Tail;
6492 };
6493 
6494 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6495     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6496     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6497     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6498     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6499     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6500     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6501     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6502 struct Templates23 {
6503   typedef TemplateSel<T1> Head;
6504   typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6505       T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
6506 };
6507 
6508 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6509     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6510     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6511     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6512     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6513     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6514     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6515     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6516 struct Templates24 {
6517   typedef TemplateSel<T1> Head;
6518   typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6519       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
6520 };
6521 
6522 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6523     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6524     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6525     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6526     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6527     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6528     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6529     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6530     GTEST_TEMPLATE_ T25>
6531 struct Templates25 {
6532   typedef TemplateSel<T1> Head;
6533   typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6534       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
6535 };
6536 
6537 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6538     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6539     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6540     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6541     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6542     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6543     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6544     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6545     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6546 struct Templates26 {
6547   typedef TemplateSel<T1> Head;
6548   typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6549       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
6550 };
6551 
6552 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6553     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6554     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6555     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6556     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6557     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6558     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6559     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6560     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6561 struct Templates27 {
6562   typedef TemplateSel<T1> Head;
6563   typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6564       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
6565 };
6566 
6567 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6568     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6569     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6570     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6571     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6572     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6573     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6574     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6575     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6576     GTEST_TEMPLATE_ T28>
6577 struct Templates28 {
6578   typedef TemplateSel<T1> Head;
6579   typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6580       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6581       T28> Tail;
6582 };
6583 
6584 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6585     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6586     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6587     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6588     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6589     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6590     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6591     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6592     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6593     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6594 struct Templates29 {
6595   typedef TemplateSel<T1> Head;
6596   typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6597       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6598       T29> Tail;
6599 };
6600 
6601 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6602     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6603     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6604     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6605     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6606     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6607     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6608     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6609     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6610     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6611 struct Templates30 {
6612   typedef TemplateSel<T1> Head;
6613   typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6614       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6615       T29, T30> Tail;
6616 };
6617 
6618 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6619     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6620     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6621     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6622     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6623     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6624     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6625     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6626     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6627     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6628     GTEST_TEMPLATE_ T31>
6629 struct Templates31 {
6630   typedef TemplateSel<T1> Head;
6631   typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6632       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6633       T29, T30, T31> Tail;
6634 };
6635 
6636 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6637     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6638     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6639     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6640     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6641     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6642     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6643     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6644     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6645     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6646     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6647 struct Templates32 {
6648   typedef TemplateSel<T1> Head;
6649   typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6650       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6651       T29, T30, T31, T32> Tail;
6652 };
6653 
6654 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6655     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6656     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6657     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6658     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6659     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6660     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6661     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6662     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6663     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6664     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6665 struct Templates33 {
6666   typedef TemplateSel<T1> Head;
6667   typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6668       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6669       T29, T30, T31, T32, T33> Tail;
6670 };
6671 
6672 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6673     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6674     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6675     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6676     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6677     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6678     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6679     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6680     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6681     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6682     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6683     GTEST_TEMPLATE_ T34>
6684 struct Templates34 {
6685   typedef TemplateSel<T1> Head;
6686   typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6687       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6688       T29, T30, T31, T32, T33, T34> Tail;
6689 };
6690 
6691 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6692     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6693     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6694     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6695     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6696     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6697     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6698     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6699     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6700     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6701     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6702     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6703 struct Templates35 {
6704   typedef TemplateSel<T1> Head;
6705   typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6706       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6707       T29, T30, T31, T32, T33, T34, T35> Tail;
6708 };
6709 
6710 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6711     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6712     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6713     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6714     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6715     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6716     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6717     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6718     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6719     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6720     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6721     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6722 struct Templates36 {
6723   typedef TemplateSel<T1> Head;
6724   typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6725       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6726       T29, T30, T31, T32, T33, T34, T35, T36> Tail;
6727 };
6728 
6729 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6730     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6731     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6732     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6733     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6734     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6735     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6736     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6737     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6738     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6739     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6740     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6741     GTEST_TEMPLATE_ T37>
6742 struct Templates37 {
6743   typedef TemplateSel<T1> Head;
6744   typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6745       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6746       T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
6747 };
6748 
6749 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6750     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6751     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6752     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6753     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6754     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6755     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6756     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6757     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6758     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6759     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6760     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6761     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6762 struct Templates38 {
6763   typedef TemplateSel<T1> Head;
6764   typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6765       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6766       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
6767 };
6768 
6769 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6770     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6771     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6772     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6773     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6774     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6775     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6776     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6777     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6778     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6779     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6780     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6781     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6782 struct Templates39 {
6783   typedef TemplateSel<T1> Head;
6784   typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6785       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6786       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
6787 };
6788 
6789 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6790     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6791     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6792     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6793     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6794     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6795     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6796     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6797     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6798     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6799     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6800     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6801     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6802     GTEST_TEMPLATE_ T40>
6803 struct Templates40 {
6804   typedef TemplateSel<T1> Head;
6805   typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6806       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6807       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
6808 };
6809 
6810 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6811     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6812     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6813     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6814     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6815     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6816     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6817     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6818     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6819     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6820     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6821     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6822     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6823     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6824 struct Templates41 {
6825   typedef TemplateSel<T1> Head;
6826   typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6827       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6828       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
6829 };
6830 
6831 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6832     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6833     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6834     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6835     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6836     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6837     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6838     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6839     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6840     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6841     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6842     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6843     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6844     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6845 struct Templates42 {
6846   typedef TemplateSel<T1> Head;
6847   typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6848       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6849       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6850       T42> Tail;
6851 };
6852 
6853 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6854     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6855     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6856     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6857     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6858     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6859     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6860     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6861     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6862     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6863     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6864     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6865     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6866     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6867     GTEST_TEMPLATE_ T43>
6868 struct Templates43 {
6869   typedef TemplateSel<T1> Head;
6870   typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6871       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6872       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6873       T43> Tail;
6874 };
6875 
6876 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6877     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6878     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6879     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6880     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6881     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6882     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6883     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6884     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6885     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6886     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6887     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6888     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6889     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6890     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6891 struct Templates44 {
6892   typedef TemplateSel<T1> Head;
6893   typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6894       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6895       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6896       T43, T44> Tail;
6897 };
6898 
6899 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6900     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6901     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6902     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6903     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6904     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6905     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6906     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6907     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6908     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6909     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6910     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6911     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6912     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6913     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6914 struct Templates45 {
6915   typedef TemplateSel<T1> Head;
6916   typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6917       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6918       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6919       T43, T44, T45> Tail;
6920 };
6921 
6922 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6923     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6924     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6925     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6926     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6927     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6928     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6929     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6930     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6931     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6932     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6933     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6934     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6935     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6936     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6937     GTEST_TEMPLATE_ T46>
6938 struct Templates46 {
6939   typedef TemplateSel<T1> Head;
6940   typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6941       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6942       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6943       T43, T44, T45, T46> Tail;
6944 };
6945 
6946 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6947     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6948     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6949     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6950     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6951     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6952     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6953     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6954     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6955     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6956     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6957     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6958     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6959     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6960     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6961     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6962 struct Templates47 {
6963   typedef TemplateSel<T1> Head;
6964   typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6965       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6966       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6967       T43, T44, T45, T46, T47> Tail;
6968 };
6969 
6970 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6971     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6972     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6973     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6974     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6975     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6976     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6977     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6978     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6979     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6980     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6981     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6982     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6983     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6984     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6985     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6986 struct Templates48 {
6987   typedef TemplateSel<T1> Head;
6988   typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6989       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6990       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6991       T43, T44, T45, T46, T47, T48> Tail;
6992 };
6993 
6994 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6995     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6996     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6997     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6998     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6999     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7000     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7001     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7002     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7003     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7004     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7005     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7006     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7007     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7008     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7009     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7010     GTEST_TEMPLATE_ T49>
7011 struct Templates49 {
7012   typedef TemplateSel<T1> Head;
7013   typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7014       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7015       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
7016       T43, T44, T45, T46, T47, T48, T49> Tail;
7017 };
7018 
7019 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7020     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7021     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7022     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7023     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7024     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7025     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7026     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7027     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7028     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7029     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7030     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7031     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7032     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7033     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7034     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7035     GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
7036 struct Templates50 {
7037   typedef TemplateSel<T1> Head;
7038   typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7039       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7040       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
7041       T43, T44, T45, T46, T47, T48, T49, T50> Tail;
7042 };
7043 
7044 
7045 // We don't want to require the users to write TemplatesN<...> directly,
7046 // as that would require them to count the length.  Templates<...> is much
7047 // easier to write, but generates horrible messages when there is a
7048 // compiler error, as gcc insists on printing out each template
7049 // argument, even if it has the default value (this means Templates<list>
7050 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
7051 // errors).
7052 //
7053 // Our solution is to combine the best part of the two approaches: a
7054 // user would write Templates<T1, ..., TN>, and Google Test will translate
7055 // that to TemplatesN<T1, ..., TN> internally to make error messages
7056 // readable.  The translation is done by the 'type' member of the
7057 // Templates template.
7058 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
7059     GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
7060     GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
7061     GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
7062     GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
7063     GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
7064     GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
7065     GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
7066     GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
7067     GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
7068     GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
7069     GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
7070     GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
7071     GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
7072     GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
7073     GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
7074     GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
7075     GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
7076     GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
7077     GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
7078     GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
7079     GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
7080     GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
7081     GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
7082     GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
7083 struct Templates {
7084   typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7085       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7086       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7087       T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
7088 };
7089 
7090 template <>
7091 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7092     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7093     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7094     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7095     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7096     NoneT> {
7097   typedef Templates0 type;
7098 };
7099 template <GTEST_TEMPLATE_ T1>
7100 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7101     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7102     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7103     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7104     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7105     NoneT> {
7106   typedef Templates1<T1> type;
7107 };
7108 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
7109 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7110     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7111     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7112     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7113     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7114     NoneT> {
7115   typedef Templates2<T1, T2> type;
7116 };
7117 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
7118 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7119     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7120     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7121     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7122     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7123   typedef Templates3<T1, T2, T3> type;
7124 };
7125 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7126     GTEST_TEMPLATE_ T4>
7127 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7128     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7129     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7130     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7131     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7132   typedef Templates4<T1, T2, T3, T4> type;
7133 };
7134 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7135     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
7136 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7137     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7138     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7139     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7140     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7141   typedef Templates5<T1, T2, T3, T4, T5> type;
7142 };
7143 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7144     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
7145 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
7146     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7147     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7148     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7149     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7150   typedef Templates6<T1, T2, T3, T4, T5, T6> type;
7151 };
7152 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7153     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7154     GTEST_TEMPLATE_ T7>
7155 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
7156     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7157     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7158     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7159     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7160   typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
7161 };
7162 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7163     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7164     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
7165 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
7166     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7167     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7168     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7169     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7170   typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
7171 };
7172 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7173     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7174     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
7175 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
7176     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7177     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7178     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7179     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7180   typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
7181 };
7182 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7183     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7184     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7185     GTEST_TEMPLATE_ T10>
7186 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
7187     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7188     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7189     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7190     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7191   typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
7192 };
7193 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7194     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7195     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7196     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
7197 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
7198     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7199     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7200     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7201     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7202   typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
7203 };
7204 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7205     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7206     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7207     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
7208 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
7209     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7210     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7211     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7212     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7213   typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
7214 };
7215 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7216     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7217     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7218     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7219     GTEST_TEMPLATE_ T13>
7220 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
7221     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7222     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7223     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7224     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7225   typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7226       T13> type;
7227 };
7228 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7229     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7230     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7231     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7232     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
7233 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7234     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7235     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7236     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7237     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7238   typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7239       T14> type;
7240 };
7241 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7242     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7243     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7244     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7245     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
7246 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7247     T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7248     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7249     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7250     NoneT, NoneT, NoneT, NoneT, NoneT> {
7251   typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7252       T14, T15> type;
7253 };
7254 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7255     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7256     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7257     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7258     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7259     GTEST_TEMPLATE_ T16>
7260 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7261     T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7262     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7263     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7264     NoneT, NoneT, NoneT, NoneT, NoneT> {
7265   typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7266       T14, T15, T16> type;
7267 };
7268 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7269     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7270     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7271     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7272     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7273     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
7274 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7275     T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7276     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7277     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7278     NoneT, NoneT, NoneT, NoneT, NoneT> {
7279   typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7280       T14, T15, T16, T17> type;
7281 };
7282 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7283     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7284     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7285     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7286     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7287     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
7288 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7289     T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7290     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7291     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7292     NoneT, NoneT, NoneT, NoneT> {
7293   typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7294       T14, T15, T16, T17, T18> type;
7295 };
7296 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7297     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7298     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7299     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7300     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7301     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7302     GTEST_TEMPLATE_ T19>
7303 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7304     T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7305     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7306     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7307     NoneT, NoneT, NoneT, NoneT> {
7308   typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7309       T14, T15, T16, T17, T18, T19> type;
7310 };
7311 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7312     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7313     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7314     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7315     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7316     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7317     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
7318 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7319     T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7320     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7321     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7322     NoneT, NoneT, NoneT, NoneT> {
7323   typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7324       T14, T15, T16, T17, T18, T19, T20> type;
7325 };
7326 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7327     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7328     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7329     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7330     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7331     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7332     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
7333 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7334     T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
7335     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7336     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7337     NoneT, NoneT, NoneT, NoneT> {
7338   typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7339       T14, T15, T16, T17, T18, T19, T20, T21> type;
7340 };
7341 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7342     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7343     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7344     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7345     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7346     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7347     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7348     GTEST_TEMPLATE_ T22>
7349 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7350     T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
7351     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7352     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7353     NoneT, NoneT, NoneT> {
7354   typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7355       T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
7356 };
7357 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7358     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7359     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7360     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7361     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7362     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7363     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7364     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
7365 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7366     T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
7367     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7368     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7369     NoneT, NoneT, NoneT> {
7370   typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7371       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
7372 };
7373 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7374     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7375     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7376     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7377     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7378     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7379     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7380     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
7381 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7382     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
7383     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7384     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7385     NoneT, NoneT, NoneT> {
7386   typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7387       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
7388 };
7389 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7390     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7391     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7392     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7393     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7394     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7395     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7396     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7397     GTEST_TEMPLATE_ T25>
7398 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7399     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
7400     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7401     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7402     NoneT, NoneT> {
7403   typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7404       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
7405 };
7406 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7407     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7408     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7409     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7410     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7411     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7412     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7413     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7414     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
7415 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7416     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
7417     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7418     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7419     NoneT, NoneT> {
7420   typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7421       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
7422 };
7423 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7424     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7425     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7426     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7427     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7428     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7429     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7430     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7431     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
7432 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7433     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
7434     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7435     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7436     NoneT, NoneT> {
7437   typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7438       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7439       T27> type;
7440 };
7441 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7442     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7443     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7444     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7445     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7446     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7447     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7448     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7449     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7450     GTEST_TEMPLATE_ T28>
7451 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7452     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7453     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7454     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7455     NoneT, NoneT> {
7456   typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7457       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7458       T28> type;
7459 };
7460 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7461     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7462     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7463     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7464     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7465     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7466     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7467     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7468     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7469     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
7470 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7471     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7472     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7473     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7474     NoneT> {
7475   typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7476       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7477       T28, T29> type;
7478 };
7479 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7480     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7481     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7482     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7483     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7484     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7485     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7486     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7487     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7488     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
7489 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7490     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7491     T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7492     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7493   typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7494       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7495       T28, T29, T30> type;
7496 };
7497 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7498     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7499     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7500     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7501     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7502     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7503     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7504     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7505     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7506     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7507     GTEST_TEMPLATE_ T31>
7508 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7509     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7510     T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7511     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7512   typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7513       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7514       T28, T29, T30, T31> type;
7515 };
7516 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7517     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7518     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7519     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7520     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7521     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7522     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7523     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7524     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7525     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7526     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
7527 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7528     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7529     T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7530     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7531   typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7532       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7533       T28, T29, T30, T31, T32> type;
7534 };
7535 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7536     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7537     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7538     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7539     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7540     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7541     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7542     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7543     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7544     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7545     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
7546 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7547     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7548     T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7549     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7550   typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7551       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7552       T28, T29, T30, T31, T32, T33> type;
7553 };
7554 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7555     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7556     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7557     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7558     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7559     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7560     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7561     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7562     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7563     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7564     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7565     GTEST_TEMPLATE_ T34>
7566 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7567     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7568     T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7569     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7570   typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7571       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7572       T28, T29, T30, T31, T32, T33, T34> type;
7573 };
7574 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7575     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7576     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7577     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7578     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7579     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7580     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7581     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7582     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7583     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7584     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7585     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
7586 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7587     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7588     T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7589     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7590   typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7591       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7592       T28, T29, T30, T31, T32, T33, T34, T35> type;
7593 };
7594 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7595     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7596     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7597     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7598     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7599     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7600     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7601     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7602     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7603     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7604     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7605     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
7606 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7607     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7608     T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
7609     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7610   typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7611       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7612       T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
7613 };
7614 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7615     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7616     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7617     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7618     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7619     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7620     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7621     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7622     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7623     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7624     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7625     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7626     GTEST_TEMPLATE_ T37>
7627 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7628     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7629     T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
7630     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7631   typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7632       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7633       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
7634 };
7635 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7636     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7637     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7638     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7639     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7640     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7641     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7642     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7643     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7644     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7645     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7646     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7647     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
7648 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7649     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7650     T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
7651     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7652   typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7653       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7654       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
7655 };
7656 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7657     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7658     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7659     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7660     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7661     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7662     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7663     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7664     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7665     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7666     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7667     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7668     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
7669 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7670     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7671     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
7672     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7673   typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7674       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7675       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
7676 };
7677 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7678     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7679     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7680     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7681     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7682     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7683     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7684     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7685     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7686     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7687     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7688     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7689     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7690     GTEST_TEMPLATE_ T40>
7691 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7692     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7693     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
7694     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7695   typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7696       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7697       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
7698 };
7699 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7700     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7701     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7702     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7703     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7704     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7705     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7706     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7707     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7708     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7709     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7710     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7711     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7712     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
7713 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7714     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7715     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
7716     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7717   typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7718       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7719       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7720       T41> type;
7721 };
7722 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7723     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7724     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7725     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7726     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7727     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7728     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7729     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7730     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7731     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7732     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7733     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7734     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7735     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
7736 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7737     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7738     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
7739     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7740   typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7741       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7742       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7743       T42> type;
7744 };
7745 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7746     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7747     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7748     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7749     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7750     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7751     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7752     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7753     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7754     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7755     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7756     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7757     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7758     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7759     GTEST_TEMPLATE_ T43>
7760 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7761     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7762     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7763     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7764   typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7765       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7766       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7767       T42, T43> type;
7768 };
7769 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7770     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7771     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7772     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7773     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7774     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7775     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7776     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7777     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7778     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7779     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7780     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7781     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7782     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7783     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
7784 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7785     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7786     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7787     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7788   typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7789       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7790       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7791       T42, T43, T44> type;
7792 };
7793 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7794     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7795     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7796     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7797     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7798     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7799     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7800     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7801     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7802     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7803     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7804     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7805     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7806     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7807     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
7808 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7809     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7810     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7811     T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
7812   typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7813       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7814       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7815       T42, T43, T44, T45> type;
7816 };
7817 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7818     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7819     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7820     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7821     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7822     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7823     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7824     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7825     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7826     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7827     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7828     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7829     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7830     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7831     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7832     GTEST_TEMPLATE_ T46>
7833 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7834     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7835     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7836     T45, T46, NoneT, NoneT, NoneT, NoneT> {
7837   typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7838       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7839       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7840       T42, T43, T44, T45, T46> type;
7841 };
7842 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7843     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7844     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7845     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7846     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7847     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7848     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7849     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7850     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7851     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7852     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7853     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7854     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7855     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7856     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7857     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
7858 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7859     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7860     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7861     T45, T46, T47, NoneT, NoneT, NoneT> {
7862   typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7863       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7864       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7865       T42, T43, T44, T45, T46, T47> type;
7866 };
7867 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7868     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7869     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7870     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7871     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7872     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7873     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7874     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7875     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7876     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7877     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7878     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7879     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7880     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7881     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7882     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
7883 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7884     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7885     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7886     T45, T46, T47, T48, NoneT, NoneT> {
7887   typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7888       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7889       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7890       T42, T43, T44, T45, T46, T47, T48> type;
7891 };
7892 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7893     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7894     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7895     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7896     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7897     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7898     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7899     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7900     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7901     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7902     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7903     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7904     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7905     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7906     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7907     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7908     GTEST_TEMPLATE_ T49>
7909 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7910     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7911     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7912     T45, T46, T47, T48, T49, NoneT> {
7913   typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7914       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7915       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7916       T42, T43, T44, T45, T46, T47, T48, T49> type;
7917 };
7918 
7919 // The TypeList template makes it possible to use either a single type
7920 // or a Types<...> list in TYPED_TEST_CASE() and
7921 // INSTANTIATE_TYPED_TEST_CASE_P().
7922 
7923 template <typename T>
7924 struct TypeList {
7925   typedef Types1<T> type;
7926 };
7927 
7928 template <typename T1, typename T2, typename T3, typename T4, typename T5,
7929     typename T6, typename T7, typename T8, typename T9, typename T10,
7930     typename T11, typename T12, typename T13, typename T14, typename T15,
7931     typename T16, typename T17, typename T18, typename T19, typename T20,
7932     typename T21, typename T22, typename T23, typename T24, typename T25,
7933     typename T26, typename T27, typename T28, typename T29, typename T30,
7934     typename T31, typename T32, typename T33, typename T34, typename T35,
7935     typename T36, typename T37, typename T38, typename T39, typename T40,
7936     typename T41, typename T42, typename T43, typename T44, typename T45,
7937     typename T46, typename T47, typename T48, typename T49, typename T50>
7938 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7939     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7940     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7941     T44, T45, T46, T47, T48, T49, T50> > {
7942   typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7943       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7944       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7945       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7946 };
7947 
7948 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7949 
7950 }  // namespace internal
7951 }  // namespace testing
7952 
7953 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7954 
7955 // Due to C++ preprocessor weirdness, we need double indirection to
7956 // concatenate two tokens when one of them is __LINE__.  Writing
7957 //
7958 //   foo ## __LINE__
7959 //
7960 // will result in the token foo__LINE__, instead of foo followed by
7961 // the current line number.  For more details, see
7962 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7963 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7964 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7965 
7966 // Stringifies its argument.
7967 #define GTEST_STRINGIFY_(name) #name
7968 
7969 class ProtocolMessage;
7970 namespace proto2 { class Message; }
7971 
7972 namespace testing {
7973 
7974 // Forward declarations.
7975 
7976 class AssertionResult;                 // Result of an assertion.
7977 class Message;                         // Represents a failure message.
7978 class Test;                            // Represents a test.
7979 class TestInfo;                        // Information about a test.
7980 class TestPartResult;                  // Result of a test part.
7981 class UnitTest;                        // A collection of test cases.
7982 
7983 template <typename T>
7984 ::std::string PrintToString(const T& value);
7985 
7986 namespace internal {
7987 
7988 struct TraceInfo;                      // Information about a trace point.
7989 class TestInfoImpl;                    // Opaque implementation of TestInfo
7990 class UnitTestImpl;                    // Opaque implementation of UnitTest
7991 
7992 // The text used in failure messages to indicate the start of the
7993 // stack trace.
7994 GTEST_API_ extern const char kStackTraceMarker[];
7995 
7996 // Two overloaded helpers for checking at compile time whether an
7997 // expression is a null pointer literal (i.e. NULL or any 0-valued
7998 // compile-time integral constant).  Their return values have
7999 // different sizes, so we can use sizeof() to test which version is
8000 // picked by the compiler.  These helpers have no implementations, as
8001 // we only need their signatures.
8002 //
8003 // Given IsNullLiteralHelper(x), the compiler will pick the first
8004 // version if x can be implicitly converted to Secret*, and pick the
8005 // second version otherwise.  Since Secret is a secret and incomplete
8006 // type, the only expression a user can write that has type Secret* is
8007 // a null pointer literal.  Therefore, we know that x is a null
8008 // pointer literal if and only if the first version is picked by the
8009 // compiler.
8010 char IsNullLiteralHelper(Secret* p);
8011 char (&IsNullLiteralHelper(...))[2];  // NOLINT
8012 
8013 // A compile-time bool constant that is true if and only if x is a
8014 // null pointer literal (i.e. NULL or any 0-valued compile-time
8015 // integral constant).
8016 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
8017 // We lose support for NULL detection where the compiler doesn't like
8018 // passing non-POD classes through ellipsis (...).
8019 # define GTEST_IS_NULL_LITERAL_(x) false
8020 #else
8021 # define GTEST_IS_NULL_LITERAL_(x) \
8022     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
8023 #endif  // GTEST_ELLIPSIS_NEEDS_POD_
8024 
8025 // Appends the user-supplied message to the Google-Test-generated message.
8026 GTEST_API_ std::string AppendUserMessage(
8027     const std::string& gtest_msg, const Message& user_msg);
8028 
8029 #if GTEST_HAS_EXCEPTIONS
8030 
8031 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4275 \
8032 /* an exported class was derived from a class that was not exported */)
8033 
8034 // This exception is thrown by (and only by) a failed Google Test
8035 // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
8036 // are enabled).  We derive it from std::runtime_error, which is for
8037 // errors presumably detectable only at run time.  Since
8038 // std::runtime_error inherits from std::exception, many testing
8039 // frameworks know how to extract and print the message inside it.
8040 class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
8041  public:
8042   explicit GoogleTestFailureException(const TestPartResult& failure);
8043 };
8044 
8045 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4275
8046 
8047 #endif  // GTEST_HAS_EXCEPTIONS
8048 
8049 namespace edit_distance {
8050 // Returns the optimal edits to go from 'left' to 'right'.
8051 // All edits cost the same, with replace having lower priority than
8052 // add/remove.
8053 // Simple implementation of the Wagner-Fischer algorithm.
8054 // See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
8055 enum EditType { kMatch, kAdd, kRemove, kReplace };
8056 GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
8057     const std::vector<size_t>& left, const std::vector<size_t>& right);
8058 
8059 // Same as above, but the input is represented as strings.
8060 GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
8061     const std::vector<std::string>& left,
8062     const std::vector<std::string>& right);
8063 
8064 // Create a diff of the input strings in Unified diff format.
8065 GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
8066                                          const std::vector<std::string>& right,
8067                                          size_t context = 2);
8068 
8069 }  // namespace edit_distance
8070 
8071 // Calculate the diff between 'left' and 'right' and return it in unified diff
8072 // format.
8073 // If not null, stores in 'total_line_count' the total number of lines found
8074 // in left + right.
8075 GTEST_API_ std::string DiffStrings(const std::string& left,
8076                                    const std::string& right,
8077                                    size_t* total_line_count);
8078 
8079 // Constructs and returns the message for an equality assertion
8080 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
8081 //
8082 // The first four parameters are the expressions used in the assertion
8083 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
8084 // where foo is 5 and bar is 6, we have:
8085 //
8086 //   expected_expression: "foo"
8087 //   actual_expression:   "bar"
8088 //   expected_value:      "5"
8089 //   actual_value:        "6"
8090 //
8091 // The ignoring_case parameter is true iff the assertion is a
8092 // *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
8093 // be inserted into the message.
8094 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
8095                                      const char* actual_expression,
8096                                      const std::string& expected_value,
8097                                      const std::string& actual_value,
8098                                      bool ignoring_case);
8099 
8100 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
8101 GTEST_API_ std::string GetBoolAssertionFailureMessage(
8102     const AssertionResult& assertion_result,
8103     const char* expression_text,
8104     const char* actual_predicate_value,
8105     const char* expected_predicate_value);
8106 
8107 // This template class represents an IEEE floating-point number
8108 // (either single-precision or double-precision, depending on the
8109 // template parameters).
8110 //
8111 // The purpose of this class is to do more sophisticated number
8112 // comparison.  (Due to round-off error, etc, it's very unlikely that
8113 // two floating-points will be equal exactly.  Hence a naive
8114 // comparison by the == operation often doesn't work.)
8115 //
8116 // Format of IEEE floating-point:
8117 //
8118 //   The most-significant bit being the leftmost, an IEEE
8119 //   floating-point looks like
8120 //
8121 //     sign_bit exponent_bits fraction_bits
8122 //
8123 //   Here, sign_bit is a single bit that designates the sign of the
8124 //   number.
8125 //
8126 //   For float, there are 8 exponent bits and 23 fraction bits.
8127 //
8128 //   For double, there are 11 exponent bits and 52 fraction bits.
8129 //
8130 //   More details can be found at
8131 //   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
8132 //
8133 // Template parameter:
8134 //
8135 //   RawType: the raw floating-point type (either float or double)
8136 template <typename RawType>
8137 class FloatingPoint {
8138  public:
8139   // Defines the unsigned integer type that has the same size as the
8140   // floating point number.
8141   typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
8142 
8143   // Constants.
8144 
8145   // # of bits in a number.
8146   static const size_t kBitCount = 8*sizeof(RawType);
8147 
8148   // # of fraction bits in a number.
8149   static const size_t kFractionBitCount =
8150     std::numeric_limits<RawType>::digits - 1;
8151 
8152   // # of exponent bits in a number.
8153   static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
8154 
8155   // The mask for the sign bit.
8156   static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
8157 
8158   // The mask for the fraction bits.
8159   static const Bits kFractionBitMask =
8160     ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
8161 
8162   // The mask for the exponent bits.
8163   static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
8164 
8165   // How many ULP's (Units in the Last Place) we want to tolerate when
8166   // comparing two numbers.  The larger the value, the more error we
8167   // allow.  A 0 value means that two numbers must be exactly the same
8168   // to be considered equal.
8169   //
8170   // The maximum error of a single floating-point operation is 0.5
8171   // units in the last place.  On Intel CPU's, all floating-point
8172   // calculations are done with 80-bit precision, while double has 64
8173   // bits.  Therefore, 4 should be enough for ordinary use.
8174   //
8175   // See the following article for more details on ULP:
8176   // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
8177   static const size_t kMaxUlps = 4;
8178 
8179   // Constructs a FloatingPoint from a raw floating-point number.
8180   //
8181   // On an Intel CPU, passing a non-normalized NAN (Not a Number)
8182   // around may change its bits, although the new value is guaranteed
8183   // to be also a NAN.  Therefore, don't expect this constructor to
8184   // preserve the bits in x when x is a NAN.
8185   explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
8186 
8187   // Static methods
8188 
8189   // Reinterprets a bit pattern as a floating-point number.
8190   //
8191   // This function is needed to test the AlmostEquals() method.
8192   static RawType ReinterpretBits(const Bits bits) {
8193     FloatingPoint fp(0);
8194     fp.u_.bits_ = bits;
8195     return fp.u_.value_;
8196   }
8197 
8198   // Returns the floating-point number that represent positive infinity.
8199   static RawType Infinity() {
8200     return ReinterpretBits(kExponentBitMask);
8201   }
8202 
8203   // Returns the maximum representable finite floating-point number.
8204   static RawType Max();
8205 
8206   // Non-static methods
8207 
8208   // Returns the bits that represents this number.
8209   const Bits &bits() const { return u_.bits_; }
8210 
8211   // Returns the exponent bits of this number.
8212   Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
8213 
8214   // Returns the fraction bits of this number.
8215   Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
8216 
8217   // Returns the sign bit of this number.
8218   Bits sign_bit() const { return kSignBitMask & u_.bits_; }
8219 
8220   // Returns true iff this is NAN (not a number).
8221   bool is_nan() const {
8222     // It's a NAN if the exponent bits are all ones and the fraction
8223     // bits are not entirely zeros.
8224     return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
8225   }
8226 
8227   // Returns true iff this number is at most kMaxUlps ULP's away from
8228   // rhs.  In particular, this function:
8229   //
8230   //   - returns false if either number is (or both are) NAN.
8231   //   - treats really large numbers as almost equal to infinity.
8232   //   - thinks +0.0 and -0.0 are 0 DLP's apart.
8233   bool AlmostEquals(const FloatingPoint& rhs) const {
8234     // The IEEE standard says that any comparison operation involving
8235     // a NAN must return false.
8236     if (is_nan() || rhs.is_nan()) return false;
8237 
8238     return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
8239         <= kMaxUlps;
8240   }
8241 
8242  private:
8243   // The data type used to store the actual floating-point number.
8244   union FloatingPointUnion {
8245     RawType value_;  // The raw floating-point number.
8246     Bits bits_;      // The bits that represent the number.
8247   };
8248 
8249   // Converts an integer from the sign-and-magnitude representation to
8250   // the biased representation.  More precisely, let N be 2 to the
8251   // power of (kBitCount - 1), an integer x is represented by the
8252   // unsigned number x + N.
8253   //
8254   // For instance,
8255   //
8256   //   -N + 1 (the most negative number representable using
8257   //          sign-and-magnitude) is represented by 1;
8258   //   0      is represented by N; and
8259   //   N - 1  (the biggest number representable using
8260   //          sign-and-magnitude) is represented by 2N - 1.
8261   //
8262   // Read http://en.wikipedia.org/wiki/Signed_number_representations
8263   // for more details on signed number representations.
8264   static Bits SignAndMagnitudeToBiased(const Bits &sam) {
8265     if (kSignBitMask & sam) {
8266       // sam represents a negative number.
8267       return ~sam + 1;
8268     } else {
8269       // sam represents a positive number.
8270       return kSignBitMask | sam;
8271     }
8272   }
8273 
8274   // Given two numbers in the sign-and-magnitude representation,
8275   // returns the distance between them as an unsigned number.
8276   static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
8277                                                      const Bits &sam2) {
8278     const Bits biased1 = SignAndMagnitudeToBiased(sam1);
8279     const Bits biased2 = SignAndMagnitudeToBiased(sam2);
8280     return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
8281   }
8282 
8283   FloatingPointUnion u_;
8284 };
8285 
8286 // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
8287 // macro defined by <windows.h>.
8288 template <>
8289 inline float FloatingPoint<float>::Max() { return FLT_MAX; }
8290 template <>
8291 inline double FloatingPoint<double>::Max() { return DBL_MAX; }
8292 
8293 // Typedefs the instances of the FloatingPoint template class that we
8294 // care to use.
8295 typedef FloatingPoint<float> Float;
8296 typedef FloatingPoint<double> Double;
8297 
8298 // In order to catch the mistake of putting tests that use different
8299 // test fixture classes in the same test case, we need to assign
8300 // unique IDs to fixture classes and compare them.  The TypeId type is
8301 // used to hold such IDs.  The user should treat TypeId as an opaque
8302 // type: the only operation allowed on TypeId values is to compare
8303 // them for equality using the == operator.
8304 typedef const void* TypeId;
8305 
8306 template <typename T>
8307 class TypeIdHelper {
8308  public:
8309   // dummy_ must not have a const type.  Otherwise an overly eager
8310   // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
8311   // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
8312   static bool dummy_;
8313 };
8314 
8315 template <typename T>
8316 bool TypeIdHelper<T>::dummy_ = false;
8317 
8318 // GetTypeId<T>() returns the ID of type T.  Different values will be
8319 // returned for different types.  Calling the function twice with the
8320 // same type argument is guaranteed to return the same ID.
8321 template <typename T>
8322 TypeId GetTypeId() {
8323   // The compiler is required to allocate a different
8324   // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
8325   // the template.  Therefore, the address of dummy_ is guaranteed to
8326   // be unique.
8327   return &(TypeIdHelper<T>::dummy_);
8328 }
8329 
8330 // Returns the type ID of ::testing::Test.  Always call this instead
8331 // of GetTypeId< ::testing::Test>() to get the type ID of
8332 // ::testing::Test, as the latter may give the wrong result due to a
8333 // suspected linker bug when compiling Google Test as a Mac OS X
8334 // framework.
8335 GTEST_API_ TypeId GetTestTypeId();
8336 
8337 // Defines the abstract factory interface that creates instances
8338 // of a Test object.
8339 class TestFactoryBase {
8340  public:
8341   virtual ~TestFactoryBase() {}
8342 
8343   // Creates a test instance to run. The instance is both created and destroyed
8344   // within TestInfoImpl::Run()
8345   virtual Test* CreateTest() = 0;
8346 
8347  protected:
8348   TestFactoryBase() {}
8349 
8350  private:
8351   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
8352 };
8353 
8354 // This class provides implementation of TeastFactoryBase interface.
8355 // It is used in TEST and TEST_F macros.
8356 template <class TestClass>
8357 class TestFactoryImpl : public TestFactoryBase {
8358  public:
8359   virtual Test* CreateTest() { return new TestClass; }
8360 };
8361 
8362 #if GTEST_OS_WINDOWS
8363 
8364 // Predicate-formatters for implementing the HRESULT checking macros
8365 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
8366 // We pass a long instead of HRESULT to avoid causing an
8367 // include dependency for the HRESULT type.
8368 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
8369                                             long hr);  // NOLINT
8370 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
8371                                             long hr);  // NOLINT
8372 
8373 #endif  // GTEST_OS_WINDOWS
8374 
8375 // Types of SetUpTestCase() and TearDownTestCase() functions.
8376 typedef void (*SetUpTestCaseFunc)();
8377 typedef void (*TearDownTestCaseFunc)();
8378 
8379 struct CodeLocation {
8380   CodeLocation(const std::string& a_file, int a_line)
8381       : file(a_file), line(a_line) {}
8382 
8383   std::string file;
8384   int line;
8385 };
8386 
8387 // Creates a new TestInfo object and registers it with Google Test;
8388 // returns the created object.
8389 //
8390 // Arguments:
8391 //
8392 //   test_case_name:   name of the test case
8393 //   name:             name of the test
8394 //   type_param        the name of the test's type parameter, or NULL if
8395 //                     this is not a typed or a type-parameterized test.
8396 //   value_param       text representation of the test's value parameter,
8397 //                     or NULL if this is not a type-parameterized test.
8398 //   code_location:    code location where the test is defined
8399 //   fixture_class_id: ID of the test fixture class
8400 //   set_up_tc:        pointer to the function that sets up the test case
8401 //   tear_down_tc:     pointer to the function that tears down the test case
8402 //   factory:          pointer to the factory that creates a test object.
8403 //                     The newly created TestInfo instance will assume
8404 //                     ownership of the factory object.
8405 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
8406     const char* test_case_name,
8407     const char* name,
8408     const char* type_param,
8409     const char* value_param,
8410     CodeLocation code_location,
8411     TypeId fixture_class_id,
8412     SetUpTestCaseFunc set_up_tc,
8413     TearDownTestCaseFunc tear_down_tc,
8414     TestFactoryBase* factory);
8415 
8416 // If *pstr starts with the given prefix, modifies *pstr to be right
8417 // past the prefix and returns true; otherwise leaves *pstr unchanged
8418 // and returns false.  None of pstr, *pstr, and prefix can be NULL.
8419 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
8420 
8421 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
8422 
8423 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
8424 /* class A needs to have dll-interface to be used by clients of class B */)
8425 
8426 // State of the definition of a type-parameterized test case.
8427 class GTEST_API_ TypedTestCasePState {
8428  public:
8429   TypedTestCasePState() : registered_(false) {}
8430 
8431   // Adds the given test name to defined_test_names_ and return true
8432   // if the test case hasn't been registered; otherwise aborts the
8433   // program.
8434   bool AddTestName(const char* file, int line, const char* case_name,
8435                    const char* test_name) {
8436     if (registered_) {
8437       fprintf(stderr, "%s Test %s must be defined before "
8438               "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
8439               FormatFileLocation(file, line).c_str(), test_name, case_name);
8440       fflush(stderr);
8441       posix::Abort();
8442     }
8443     registered_tests_.insert(
8444         ::std::make_pair(test_name, CodeLocation(file, line)));
8445     return true;
8446   }
8447 
8448   bool TestExists(const std::string& test_name) const {
8449     return registered_tests_.count(test_name) > 0;
8450   }
8451 
8452   const CodeLocation& GetCodeLocation(const std::string& test_name) const {
8453     RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
8454     GTEST_CHECK_(it != registered_tests_.end());
8455     return it->second;
8456   }
8457 
8458   // Verifies that registered_tests match the test names in
8459   // defined_test_names_; returns registered_tests if successful, or
8460   // aborts the program otherwise.
8461   const char* VerifyRegisteredTestNames(
8462       const char* file, int line, const char* registered_tests);
8463 
8464  private:
8465   typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
8466 
8467   bool registered_;
8468   RegisteredTestsMap registered_tests_;
8469 };
8470 
8471 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251
8472 
8473 // Skips to the first non-space char after the first comma in 'str';
8474 // returns NULL if no comma is found in 'str'.
8475 inline const char* SkipComma(const char* str) {
8476   const char* comma = strchr(str, ',');
8477   if (comma == NULL) {
8478     return NULL;
8479   }
8480   while (IsSpace(*(++comma))) {}
8481   return comma;
8482 }
8483 
8484 // Returns the prefix of 'str' before the first comma in it; returns
8485 // the entire string if it contains no comma.
8486 inline std::string GetPrefixUntilComma(const char* str) {
8487   const char* comma = strchr(str, ',');
8488   return comma == NULL ? str : std::string(str, comma);
8489 }
8490 
8491 // Splits a given string on a given delimiter, populating a given
8492 // vector with the fields.
8493 void SplitString(const ::std::string& str, char delimiter,
8494                  ::std::vector< ::std::string>* dest);
8495 
8496 // The default argument to the template below for the case when the user does
8497 // not provide a name generator.
8498 struct DefaultNameGenerator {
8499   template <typename T>
8500   static std::string GetName(int i) {
8501     return StreamableToString(i);
8502   }
8503 };
8504 
8505 template <typename Provided = DefaultNameGenerator>
8506 struct NameGeneratorSelector {
8507   typedef Provided type;
8508 };
8509 
8510 template <typename NameGenerator>
8511 void GenerateNamesRecursively(Types0, std::vector<std::string>*, int) {}
8512 
8513 template <typename NameGenerator, typename Types>
8514 void GenerateNamesRecursively(Types, std::vector<std::string>* result, int i) {
8515   result->push_back(NameGenerator::template GetName<typename Types::Head>(i));
8516   GenerateNamesRecursively<NameGenerator>(typename Types::Tail(), result,
8517                                           i + 1);
8518 }
8519 
8520 template <typename NameGenerator, typename Types>
8521 std::vector<std::string> GenerateNames() {
8522   std::vector<std::string> result;
8523   GenerateNamesRecursively<NameGenerator>(Types(), &result, 0);
8524   return result;
8525 }
8526 
8527 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
8528 // registers a list of type-parameterized tests with Google Test.  The
8529 // return value is insignificant - we just need to return something
8530 // such that we can call this function in a namespace scope.
8531 //
8532 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
8533 // template parameter.  It's defined in gtest-type-util.h.
8534 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
8535 class TypeParameterizedTest {
8536  public:
8537   // 'index' is the index of the test in the type list 'Types'
8538   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
8539   // Types).  Valid values for 'index' are [0, N - 1] where N is the
8540   // length of Types.
8541   static bool Register(const char* prefix, const CodeLocation& code_location,
8542                        const char* case_name, const char* test_names, int index,
8543                        const std::vector<std::string>& type_names =
8544                            GenerateNames<DefaultNameGenerator, Types>()) {
8545     typedef typename Types::Head Type;
8546     typedef Fixture<Type> FixtureClass;
8547     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
8548 
8549     // First, registers the first type-parameterized test in the type
8550     // list.
8551     MakeAndRegisterTestInfo(
8552         (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
8553          "/" + type_names[index])
8554             .c_str(),
8555         StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
8556         GetTypeName<Type>().c_str(),
8557         NULL,  // No value parameter.
8558         code_location, GetTypeId<FixtureClass>(), TestClass::SetUpTestCase,
8559         TestClass::TearDownTestCase, new TestFactoryImpl<TestClass>);
8560 
8561     // Next, recurses (at compile time) with the tail of the type list.
8562     return TypeParameterizedTest<Fixture, TestSel,
8563                                  typename Types::Tail>::Register(prefix,
8564                                                                  code_location,
8565                                                                  case_name,
8566                                                                  test_names,
8567                                                                  index + 1,
8568                                                                  type_names);
8569   }
8570 };
8571 
8572 // The base case for the compile time recursion.
8573 template <GTEST_TEMPLATE_ Fixture, class TestSel>
8574 class TypeParameterizedTest<Fixture, TestSel, Types0> {
8575  public:
8576   static bool Register(const char* /*prefix*/, const CodeLocation&,
8577                        const char* /*case_name*/, const char* /*test_names*/,
8578                        int /*index*/,
8579                        const std::vector<std::string>& =
8580                            std::vector<std::string>() /*type_names*/) {
8581     return true;
8582   }
8583 };
8584 
8585 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
8586 // registers *all combinations* of 'Tests' and 'Types' with Google
8587 // Test.  The return value is insignificant - we just need to return
8588 // something such that we can call this function in a namespace scope.
8589 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
8590 class TypeParameterizedTestCase {
8591  public:
8592   static bool Register(const char* prefix, CodeLocation code_location,
8593                        const TypedTestCasePState* state, const char* case_name,
8594                        const char* test_names,
8595                        const std::vector<std::string>& type_names =
8596                            GenerateNames<DefaultNameGenerator, Types>()) {
8597     std::string test_name = StripTrailingSpaces(
8598         GetPrefixUntilComma(test_names));
8599     if (!state->TestExists(test_name)) {
8600       fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
8601               case_name, test_name.c_str(),
8602               FormatFileLocation(code_location.file.c_str(),
8603                                  code_location.line).c_str());
8604       fflush(stderr);
8605       posix::Abort();
8606     }
8607     const CodeLocation& test_location = state->GetCodeLocation(test_name);
8608 
8609     typedef typename Tests::Head Head;
8610 
8611     // First, register the first test in 'Test' for each type in 'Types'.
8612     TypeParameterizedTest<Fixture, Head, Types>::Register(
8613         prefix, test_location, case_name, test_names, 0, type_names);
8614 
8615     // Next, recurses (at compile time) with the tail of the test list.
8616     return TypeParameterizedTestCase<Fixture, typename Tests::Tail,
8617                                      Types>::Register(prefix, code_location,
8618                                                       state, case_name,
8619                                                       SkipComma(test_names),
8620                                                       type_names);
8621   }
8622 };
8623 
8624 // The base case for the compile time recursion.
8625 template <GTEST_TEMPLATE_ Fixture, typename Types>
8626 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
8627  public:
8628   static bool Register(const char* /*prefix*/, const CodeLocation&,
8629                        const TypedTestCasePState* /*state*/,
8630                        const char* /*case_name*/, const char* /*test_names*/,
8631                        const std::vector<std::string>& =
8632                            std::vector<std::string>() /*type_names*/) {
8633     return true;
8634   }
8635 };
8636 
8637 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
8638 
8639 // Returns the current OS stack trace as an std::string.
8640 //
8641 // The maximum number of stack frames to be included is specified by
8642 // the gtest_stack_trace_depth flag.  The skip_count parameter
8643 // specifies the number of top frames to be skipped, which doesn't
8644 // count against the number of frames to be included.
8645 //
8646 // For example, if Foo() calls Bar(), which in turn calls
8647 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
8648 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
8649 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
8650     UnitTest* unit_test, int skip_count);
8651 
8652 // Helpers for suppressing warnings on unreachable code or constant
8653 // condition.
8654 
8655 // Always returns true.
8656 GTEST_API_ bool AlwaysTrue();
8657 
8658 // Always returns false.
8659 inline bool AlwaysFalse() { return !AlwaysTrue(); }
8660 
8661 // Helper for suppressing false warning from Clang on a const char*
8662 // variable declared in a conditional expression always being NULL in
8663 // the else branch.
8664 struct GTEST_API_ ConstCharPtr {
8665   ConstCharPtr(const char* str) : value(str) {}
8666   operator bool() const { return true; }
8667   const char* value;
8668 };
8669 
8670 // A simple Linear Congruential Generator for generating random
8671 // numbers with a uniform distribution.  Unlike rand() and srand(), it
8672 // doesn't use global state (and therefore can't interfere with user
8673 // code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
8674 // but it's good enough for our purposes.
8675 class GTEST_API_ Random {
8676  public:
8677   static const UInt32 kMaxRange = 1u << 31;
8678 
8679   explicit Random(UInt32 seed) : state_(seed) {}
8680 
8681   void Reseed(UInt32 seed) { state_ = seed; }
8682 
8683   // Generates a random number from [0, range).  Crashes if 'range' is
8684   // 0 or greater than kMaxRange.
8685   UInt32 Generate(UInt32 range);
8686 
8687  private:
8688   UInt32 state_;
8689   GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
8690 };
8691 
8692 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
8693 // compiler error iff T1 and T2 are different types.
8694 template <typename T1, typename T2>
8695 struct CompileAssertTypesEqual;
8696 
8697 template <typename T>
8698 struct CompileAssertTypesEqual<T, T> {
8699 };
8700 
8701 // Removes the reference from a type if it is a reference type,
8702 // otherwise leaves it unchanged.  This is the same as
8703 // tr1::remove_reference, which is not widely available yet.
8704 template <typename T>
8705 struct RemoveReference { typedef T type; };  // NOLINT
8706 template <typename T>
8707 struct RemoveReference<T&> { typedef T type; };  // NOLINT
8708 
8709 // A handy wrapper around RemoveReference that works when the argument
8710 // T depends on template parameters.
8711 #define GTEST_REMOVE_REFERENCE_(T) \
8712     typename ::testing::internal::RemoveReference<T>::type
8713 
8714 // Removes const from a type if it is a const type, otherwise leaves
8715 // it unchanged.  This is the same as tr1::remove_const, which is not
8716 // widely available yet.
8717 template <typename T>
8718 struct RemoveConst { typedef T type; };  // NOLINT
8719 template <typename T>
8720 struct RemoveConst<const T> { typedef T type; };  // NOLINT
8721 
8722 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
8723 // definition to fail to remove the const in 'const int[3]' and 'const
8724 // char[3][4]'.  The following specialization works around the bug.
8725 template <typename T, size_t N>
8726 struct RemoveConst<const T[N]> {
8727   typedef typename RemoveConst<T>::type type[N];
8728 };
8729 
8730 #if defined(_MSC_VER) && _MSC_VER < 1400
8731 // This is the only specialization that allows VC++ 7.1 to remove const in
8732 // 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
8733 // and thus needs to be conditionally compiled.
8734 template <typename T, size_t N>
8735 struct RemoveConst<T[N]> {
8736   typedef typename RemoveConst<T>::type type[N];
8737 };
8738 #endif
8739 
8740 // A handy wrapper around RemoveConst that works when the argument
8741 // T depends on template parameters.
8742 #define GTEST_REMOVE_CONST_(T) \
8743     typename ::testing::internal::RemoveConst<T>::type
8744 
8745 // Turns const U&, U&, const U, and U all into U.
8746 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
8747     GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
8748 
8749 // ImplicitlyConvertible<From, To>::value is a compile-time bool
8750 // constant that's true iff type From can be implicitly converted to
8751 // type To.
8752 template <typename From, typename To>
8753 class ImplicitlyConvertible {
8754  private:
8755   // We need the following helper functions only for their types.
8756   // They have no implementations.
8757 
8758   // MakeFrom() is an expression whose type is From.  We cannot simply
8759   // use From(), as the type From may not have a public default
8760   // constructor.
8761   static typename AddReference<From>::type MakeFrom();
8762 
8763   // These two functions are overloaded.  Given an expression
8764   // Helper(x), the compiler will pick the first version if x can be
8765   // implicitly converted to type To; otherwise it will pick the
8766   // second version.
8767   //
8768   // The first version returns a value of size 1, and the second
8769   // version returns a value of size 2.  Therefore, by checking the
8770   // size of Helper(x), which can be done at compile time, we can tell
8771   // which version of Helper() is used, and hence whether x can be
8772   // implicitly converted to type To.
8773   static char Helper(To);
8774   static char (&Helper(...))[2];  // NOLINT
8775 
8776   // We have to put the 'public' section after the 'private' section,
8777   // or MSVC refuses to compile the code.
8778  public:
8779 #if defined(__BORLANDC__)
8780   // C++Builder cannot use member overload resolution during template
8781   // instantiation.  The simplest workaround is to use its C++0x type traits
8782   // functions (C++Builder 2009 and above only).
8783   static const bool value = __is_convertible(From, To);
8784 #else
8785   // MSVC warns about implicitly converting from double to int for
8786   // possible loss of data, so we need to temporarily disable the
8787   // warning.
8788   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
8789   static const bool value =
8790       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
8791   GTEST_DISABLE_MSC_WARNINGS_POP_()
8792 #endif  // __BORLANDC__
8793 };
8794 template <typename From, typename To>
8795 const bool ImplicitlyConvertible<From, To>::value;
8796 
8797 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
8798 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
8799 // of those.
8800 template <typename T>
8801 struct IsAProtocolMessage
8802     : public bool_constant<
8803   ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
8804   ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
8805 };
8806 
8807 // When the compiler sees expression IsContainerTest<C>(0), if C is an
8808 // STL-style container class, the first overload of IsContainerTest
8809 // will be viable (since both C::iterator* and C::const_iterator* are
8810 // valid types and NULL can be implicitly converted to them).  It will
8811 // be picked over the second overload as 'int' is a perfect match for
8812 // the type of argument 0.  If C::iterator or C::const_iterator is not
8813 // a valid type, the first overload is not viable, and the second
8814 // overload will be picked.  Therefore, we can determine whether C is
8815 // a container class by checking the type of IsContainerTest<C>(0).
8816 // The value of the expression is insignificant.
8817 //
8818 // In C++11 mode we check the existence of a const_iterator and that an
8819 // iterator is properly implemented for the container.
8820 //
8821 // For pre-C++11 that we look for both C::iterator and C::const_iterator.
8822 // The reason is that C++ injects the name of a class as a member of the
8823 // class itself (e.g. you can refer to class iterator as either
8824 // 'iterator' or 'iterator::iterator').  If we look for C::iterator
8825 // only, for example, we would mistakenly think that a class named
8826 // iterator is an STL container.
8827 //
8828 // Also note that the simpler approach of overloading
8829 // IsContainerTest(typename C::const_iterator*) and
8830 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
8831 typedef int IsContainer;
8832 #if GTEST_LANG_CXX11
8833 template <class C,
8834           class Iterator = decltype(::std::declval<const C&>().begin()),
8835           class = decltype(::std::declval<const C&>().end()),
8836           class = decltype(++::std::declval<Iterator&>()),
8837           class = decltype(*::std::declval<Iterator>()),
8838           class = typename C::const_iterator>
8839 IsContainer IsContainerTest(int /* dummy */) {
8840   return 0;
8841 }
8842 #else
8843 template <class C>
8844 IsContainer IsContainerTest(int /* dummy */,
8845                             typename C::iterator* /* it */ = NULL,
8846                             typename C::const_iterator* /* const_it */ = NULL) {
8847   return 0;
8848 }
8849 #endif  // GTEST_LANG_CXX11
8850 
8851 typedef char IsNotContainer;
8852 template <class C>
8853 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
8854 
8855 // Trait to detect whether a type T is a hash table.
8856 // The heuristic used is that the type contains an inner type `hasher` and does
8857 // not contain an inner type `reverse_iterator`.
8858 // If the container is iterable in reverse, then order might actually matter.
8859 template <typename T>
8860 struct IsHashTable {
8861  private:
8862   template <typename U>
8863   static char test(typename U::hasher*, typename U::reverse_iterator*);
8864   template <typename U>
8865   static int test(typename U::hasher*, ...);
8866   template <typename U>
8867   static char test(...);
8868 
8869  public:
8870   static const bool value = sizeof(test<T>(0, 0)) == sizeof(int);
8871 };
8872 
8873 template <typename T>
8874 const bool IsHashTable<T>::value;
8875 
8876 template<typename T>
8877 struct VoidT {
8878     typedef void value_type;
8879 };
8880 
8881 template <typename T, typename = void>
8882 struct HasValueType : false_type {};
8883 template <typename T>
8884 struct HasValueType<T, VoidT<typename T::value_type> > : true_type {
8885 };
8886 
8887 template <typename C,
8888           bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer),
8889           bool = HasValueType<C>::value>
8890 struct IsRecursiveContainerImpl;
8891 
8892 template <typename C, bool HV>
8893 struct IsRecursiveContainerImpl<C, false, HV> : public false_type {};
8894 
8895 // Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
8896 // obey the same inconsistencies as the IsContainerTest, namely check if
8897 // something is a container is relying on only const_iterator in C++11 and
8898 // is relying on both const_iterator and iterator otherwise
8899 template <typename C>
8900 struct IsRecursiveContainerImpl<C, true, false> : public false_type {};
8901 
8902 template <typename C>
8903 struct IsRecursiveContainerImpl<C, true, true> {
8904   #if GTEST_LANG_CXX11
8905   typedef typename IteratorTraits<typename C::const_iterator>::value_type
8906       value_type;
8907 #else
8908   typedef typename IteratorTraits<typename C::iterator>::value_type value_type;
8909 #endif
8910   typedef is_same<value_type, C> type;
8911 };
8912 
8913 // IsRecursiveContainer<Type> is a unary compile-time predicate that
8914 // evaluates whether C is a recursive container type. A recursive container
8915 // type is a container type whose value_type is equal to the container type
8916 // itself. An example for a recursive container type is
8917 // boost::filesystem::path, whose iterator has a value_type that is equal to
8918 // boost::filesystem::path.
8919 template <typename C>
8920 struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
8921 
8922 // EnableIf<condition>::type is void when 'Cond' is true, and
8923 // undefined when 'Cond' is false.  To use SFINAE to make a function
8924 // overload only apply when a particular expression is true, add
8925 // "typename EnableIf<expression>::type* = 0" as the last parameter.
8926 template<bool> struct EnableIf;
8927 template<> struct EnableIf<true> { typedef void type; };  // NOLINT
8928 
8929 // Utilities for native arrays.
8930 
8931 // ArrayEq() compares two k-dimensional native arrays using the
8932 // elements' operator==, where k can be any integer >= 0.  When k is
8933 // 0, ArrayEq() degenerates into comparing a single pair of values.
8934 
8935 template <typename T, typename U>
8936 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
8937 
8938 // This generic version is used when k is 0.
8939 template <typename T, typename U>
8940 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
8941 
8942 // This overload is used when k >= 1.
8943 template <typename T, typename U, size_t N>
8944 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
8945   return internal::ArrayEq(lhs, N, rhs);
8946 }
8947 
8948 // This helper reduces code bloat.  If we instead put its logic inside
8949 // the previous ArrayEq() function, arrays with different sizes would
8950 // lead to different copies of the template code.
8951 template <typename T, typename U>
8952 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
8953   for (size_t i = 0; i != size; i++) {
8954     if (!internal::ArrayEq(lhs[i], rhs[i]))
8955       return false;
8956   }
8957   return true;
8958 }
8959 
8960 // Finds the first element in the iterator range [begin, end) that
8961 // equals elem.  Element may be a native array type itself.
8962 template <typename Iter, typename Element>
8963 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
8964   for (Iter it = begin; it != end; ++it) {
8965     if (internal::ArrayEq(*it, elem))
8966       return it;
8967   }
8968   return end;
8969 }
8970 
8971 // CopyArray() copies a k-dimensional native array using the elements'
8972 // operator=, where k can be any integer >= 0.  When k is 0,
8973 // CopyArray() degenerates into copying a single value.
8974 
8975 template <typename T, typename U>
8976 void CopyArray(const T* from, size_t size, U* to);
8977 
8978 // This generic version is used when k is 0.
8979 template <typename T, typename U>
8980 inline void CopyArray(const T& from, U* to) { *to = from; }
8981 
8982 // This overload is used when k >= 1.
8983 template <typename T, typename U, size_t N>
8984 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
8985   internal::CopyArray(from, N, *to);
8986 }
8987 
8988 // This helper reduces code bloat.  If we instead put its logic inside
8989 // the previous CopyArray() function, arrays with different sizes
8990 // would lead to different copies of the template code.
8991 template <typename T, typename U>
8992 void CopyArray(const T* from, size_t size, U* to) {
8993   for (size_t i = 0; i != size; i++) {
8994     internal::CopyArray(from[i], to + i);
8995   }
8996 }
8997 
8998 // The relation between an NativeArray object (see below) and the
8999 // native array it represents.
9000 // We use 2 different structs to allow non-copyable types to be used, as long
9001 // as RelationToSourceReference() is passed.
9002 struct RelationToSourceReference {};
9003 struct RelationToSourceCopy {};
9004 
9005 // Adapts a native array to a read-only STL-style container.  Instead
9006 // of the complete STL container concept, this adaptor only implements
9007 // members useful for Google Mock's container matchers.  New members
9008 // should be added as needed.  To simplify the implementation, we only
9009 // support Element being a raw type (i.e. having no top-level const or
9010 // reference modifier).  It's the client's responsibility to satisfy
9011 // this requirement.  Element can be an array type itself (hence
9012 // multi-dimensional arrays are supported).
9013 template <typename Element>
9014 class NativeArray {
9015  public:
9016   // STL-style container typedefs.
9017   typedef Element value_type;
9018   typedef Element* iterator;
9019   typedef const Element* const_iterator;
9020 
9021   // Constructs from a native array. References the source.
9022   NativeArray(const Element* array, size_t count, RelationToSourceReference) {
9023     InitRef(array, count);
9024   }
9025 
9026   // Constructs from a native array. Copies the source.
9027   NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
9028     InitCopy(array, count);
9029   }
9030 
9031   // Copy constructor.
9032   NativeArray(const NativeArray& rhs) {
9033     (this->*rhs.clone_)(rhs.array_, rhs.size_);
9034   }
9035 
9036   ~NativeArray() {
9037     if (clone_ != &NativeArray::InitRef)
9038       delete[] array_;
9039   }
9040 
9041   // STL-style container methods.
9042   size_t size() const { return size_; }
9043   const_iterator begin() const { return array_; }
9044   const_iterator end() const { return array_ + size_; }
9045   bool operator==(const NativeArray& rhs) const {
9046     return size() == rhs.size() &&
9047         ArrayEq(begin(), size(), rhs.begin());
9048   }
9049 
9050  private:
9051   enum {
9052     kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
9053         Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value
9054   };
9055 
9056   // Initializes this object with a copy of the input.
9057   void InitCopy(const Element* array, size_t a_size) {
9058     Element* const copy = new Element[a_size];
9059     CopyArray(array, a_size, copy);
9060     array_ = copy;
9061     size_ = a_size;
9062     clone_ = &NativeArray::InitCopy;
9063   }
9064 
9065   // Initializes this object with a reference of the input.
9066   void InitRef(const Element* array, size_t a_size) {
9067     array_ = array;
9068     size_ = a_size;
9069     clone_ = &NativeArray::InitRef;
9070   }
9071 
9072   const Element* array_;
9073   size_t size_;
9074   void (NativeArray::*clone_)(const Element*, size_t);
9075 
9076   GTEST_DISALLOW_ASSIGN_(NativeArray);
9077 };
9078 
9079 }  // namespace internal
9080 }  // namespace testing
9081 
9082 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
9083   ::testing::internal::AssertHelper(result_type, file, line, message) \
9084     = ::testing::Message()
9085 
9086 #define GTEST_MESSAGE_(message, result_type) \
9087   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
9088 
9089 #define GTEST_FATAL_FAILURE_(message) \
9090   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
9091 
9092 #define GTEST_NONFATAL_FAILURE_(message) \
9093   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
9094 
9095 #define GTEST_SUCCESS_(message) \
9096   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
9097 
9098 // Suppress MSVC warning 4702 (unreachable code) for the code following
9099 // statement if it returns or throws (or doesn't return or throw in some
9100 // situations).
9101 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
9102   if (::testing::internal::AlwaysTrue()) { statement; }
9103 
9104 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
9105   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9106   if (::testing::internal::ConstCharPtr gtest_msg = "") { \
9107     bool gtest_caught_expected = false; \
9108     try { \
9109       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9110     } \
9111     catch (expected_exception const&) { \
9112       gtest_caught_expected = true; \
9113     } \
9114     catch (...) { \
9115       gtest_msg.value = \
9116           "Expected: " #statement " throws an exception of type " \
9117           #expected_exception ".\n  Actual: it throws a different type."; \
9118       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
9119     } \
9120     if (!gtest_caught_expected) { \
9121       gtest_msg.value = \
9122           "Expected: " #statement " throws an exception of type " \
9123           #expected_exception ".\n  Actual: it throws nothing."; \
9124       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
9125     } \
9126   } else \
9127     GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
9128       fail(gtest_msg.value)
9129 
9130 #define GTEST_TEST_NO_THROW_(statement, fail) \
9131   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9132   if (::testing::internal::AlwaysTrue()) { \
9133     try { \
9134       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9135     } \
9136     catch (...) { \
9137       goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
9138     } \
9139   } else \
9140     GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
9141       fail("Expected: " #statement " doesn't throw an exception.\n" \
9142            "  Actual: it throws.")
9143 
9144 #define GTEST_TEST_ANY_THROW_(statement, fail) \
9145   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9146   if (::testing::internal::AlwaysTrue()) { \
9147     bool gtest_caught_any = false; \
9148     try { \
9149       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9150     } \
9151     catch (...) { \
9152       gtest_caught_any = true; \
9153     } \
9154     if (!gtest_caught_any) { \
9155       goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
9156     } \
9157   } else \
9158     GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
9159       fail("Expected: " #statement " throws an exception.\n" \
9160            "  Actual: it doesn't.")
9161 
9162 
9163 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
9164 // either a boolean expression or an AssertionResult. text is a textual
9165 // represenation of expression as it was passed into the EXPECT_TRUE.
9166 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
9167   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9168   if (const ::testing::AssertionResult gtest_ar_ = \
9169       ::testing::AssertionResult(expression)) \
9170     ; \
9171   else \
9172     fail(::testing::internal::GetBoolAssertionFailureMessage(\
9173         gtest_ar_, text, #actual, #expected).c_str())
9174 
9175 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
9176   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9177   if (::testing::internal::AlwaysTrue()) { \
9178     ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
9179     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9180     if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
9181       goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
9182     } \
9183   } else \
9184     GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
9185       fail("Expected: " #statement " doesn't generate new fatal " \
9186            "failures in the current thread.\n" \
9187            "  Actual: it does.")
9188 
9189 // Expands to the name of the class that implements the given test.
9190 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
9191   test_case_name##_##test_name##_Test
9192 
9193 // Helper macro for defining tests.
9194 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
9195 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
9196  public:\
9197   GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
9198  private:\
9199   virtual void TestBody();\
9200   static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
9201   GTEST_DISALLOW_COPY_AND_ASSIGN_(\
9202       GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
9203 };\
9204 \
9205 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
9206   ::test_info_ =\
9207     ::testing::internal::MakeAndRegisterTestInfo(\
9208         #test_case_name, #test_name, NULL, NULL, \
9209         ::testing::internal::CodeLocation(__FILE__, __LINE__), \
9210         (parent_id), \
9211         parent_class::SetUpTestCase, \
9212         parent_class::TearDownTestCase, \
9213         new ::testing::internal::TestFactoryImpl<\
9214             GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
9215 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
9216 
9217 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
9218 // Copyright 2005, Google Inc.
9219 // All rights reserved.
9220 //
9221 // Redistribution and use in source and binary forms, with or without
9222 // modification, are permitted provided that the following conditions are
9223 // met:
9224 //
9225 //     * Redistributions of source code must retain the above copyright
9226 // notice, this list of conditions and the following disclaimer.
9227 //     * Redistributions in binary form must reproduce the above
9228 // copyright notice, this list of conditions and the following disclaimer
9229 // in the documentation and/or other materials provided with the
9230 // distribution.
9231 //     * Neither the name of Google Inc. nor the names of its
9232 // contributors may be used to endorse or promote products derived from
9233 // this software without specific prior written permission.
9234 //
9235 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9236 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9237 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9238 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9239 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9240 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9241 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9242 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9243 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9244 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9245 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9246 
9247 //
9248 // The Google C++ Testing and Mocking Framework (Google Test)
9249 //
9250 // This header file defines the public API for death tests.  It is
9251 // #included by gtest.h so a user doesn't need to include this
9252 // directly.
9253 // GOOGLETEST_CM0001 DO NOT DELETE
9254 
9255 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9256 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9257 
9258 // Copyright 2005, Google Inc.
9259 // All rights reserved.
9260 //
9261 // Redistribution and use in source and binary forms, with or without
9262 // modification, are permitted provided that the following conditions are
9263 // met:
9264 //
9265 //     * Redistributions of source code must retain the above copyright
9266 // notice, this list of conditions and the following disclaimer.
9267 //     * Redistributions in binary form must reproduce the above
9268 // copyright notice, this list of conditions and the following disclaimer
9269 // in the documentation and/or other materials provided with the
9270 // distribution.
9271 //     * Neither the name of Google Inc. nor the names of its
9272 // contributors may be used to endorse or promote products derived from
9273 // this software without specific prior written permission.
9274 //
9275 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9276 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9277 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9278 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9279 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9280 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9281 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9282 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9283 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9284 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9285 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9286 //
9287 // The Google C++ Testing and Mocking Framework (Google Test)
9288 //
9289 // This header file defines internal utilities needed for implementing
9290 // death tests.  They are subject to change without notice.
9291 // GOOGLETEST_CM0001 DO NOT DELETE
9292 
9293 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9294 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9295 
9296 
9297 #include <stdio.h>
9298 
9299 namespace testing {
9300 namespace internal {
9301 
9302 GTEST_DECLARE_string_(internal_run_death_test);
9303 
9304 // Names of the flags (needed for parsing Google Test flags).
9305 const char kDeathTestStyleFlag[] = "death_test_style";
9306 const char kDeathTestUseFork[] = "death_test_use_fork";
9307 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
9308 
9309 #if GTEST_HAS_DEATH_TEST
9310 
9311 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
9312 /* class A needs to have dll-interface to be used by clients of class B */)
9313 
9314 // DeathTest is a class that hides much of the complexity of the
9315 // GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
9316 // returns a concrete class that depends on the prevailing death test
9317 // style, as defined by the --gtest_death_test_style and/or
9318 // --gtest_internal_run_death_test flags.
9319 
9320 // In describing the results of death tests, these terms are used with
9321 // the corresponding definitions:
9322 //
9323 // exit status:  The integer exit information in the format specified
9324 //               by wait(2)
9325 // exit code:    The integer code passed to exit(3), _exit(2), or
9326 //               returned from main()
9327 class GTEST_API_ DeathTest {
9328  public:
9329   // Create returns false if there was an error determining the
9330   // appropriate action to take for the current death test; for example,
9331   // if the gtest_death_test_style flag is set to an invalid value.
9332   // The LastMessage method will return a more detailed message in that
9333   // case.  Otherwise, the DeathTest pointer pointed to by the "test"
9334   // argument is set.  If the death test should be skipped, the pointer
9335   // is set to NULL; otherwise, it is set to the address of a new concrete
9336   // DeathTest object that controls the execution of the current test.
9337   static bool Create(const char* statement, const RE* regex,
9338                      const char* file, int line, DeathTest** test);
9339   DeathTest();
9340   virtual ~DeathTest() { }
9341 
9342   // A helper class that aborts a death test when it's deleted.
9343   class ReturnSentinel {
9344    public:
9345     explicit ReturnSentinel(DeathTest* test) : test_(test) { }
9346     ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
9347    private:
9348     DeathTest* const test_;
9349     GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
9350   } GTEST_ATTRIBUTE_UNUSED_;
9351 
9352   // An enumeration of possible roles that may be taken when a death
9353   // test is encountered.  EXECUTE means that the death test logic should
9354   // be executed immediately.  OVERSEE means that the program should prepare
9355   // the appropriate environment for a child process to execute the death
9356   // test, then wait for it to complete.
9357   enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
9358 
9359   // An enumeration of the three reasons that a test might be aborted.
9360   enum AbortReason {
9361     TEST_ENCOUNTERED_RETURN_STATEMENT,
9362     TEST_THREW_EXCEPTION,
9363     TEST_DID_NOT_DIE
9364   };
9365 
9366   // Assumes one of the above roles.
9367   virtual TestRole AssumeRole() = 0;
9368 
9369   // Waits for the death test to finish and returns its status.
9370   virtual int Wait() = 0;
9371 
9372   // Returns true if the death test passed; that is, the test process
9373   // exited during the test, its exit status matches a user-supplied
9374   // predicate, and its stderr output matches a user-supplied regular
9375   // expression.
9376   // The user-supplied predicate may be a macro expression rather
9377   // than a function pointer or functor, or else Wait and Passed could
9378   // be combined.
9379   virtual bool Passed(bool exit_status_ok) = 0;
9380 
9381   // Signals that the death test did not die as expected.
9382   virtual void Abort(AbortReason reason) = 0;
9383 
9384   // Returns a human-readable outcome message regarding the outcome of
9385   // the last death test.
9386   static const char* LastMessage();
9387 
9388   static void set_last_death_test_message(const std::string& message);
9389 
9390  private:
9391   // A string containing a description of the outcome of the last death test.
9392   static std::string last_death_test_message_;
9393 
9394   GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
9395 };
9396 
9397 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251
9398 
9399 // Factory interface for death tests.  May be mocked out for testing.
9400 class DeathTestFactory {
9401  public:
9402   virtual ~DeathTestFactory() { }
9403   virtual bool Create(const char* statement, const RE* regex,
9404                       const char* file, int line, DeathTest** test) = 0;
9405 };
9406 
9407 // A concrete DeathTestFactory implementation for normal use.
9408 class DefaultDeathTestFactory : public DeathTestFactory {
9409  public:
9410   virtual bool Create(const char* statement, const RE* regex,
9411                       const char* file, int line, DeathTest** test);
9412 };
9413 
9414 // Returns true if exit_status describes a process that was terminated
9415 // by a signal, or exited normally with a nonzero exit code.
9416 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
9417 
9418 // Traps C++ exceptions escaping statement and reports them as test
9419 // failures. Note that trapping SEH exceptions is not implemented here.
9420 # if GTEST_HAS_EXCEPTIONS
9421 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
9422   try { \
9423     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9424   } catch (const ::std::exception& gtest_exception) { \
9425     fprintf(\
9426         stderr, \
9427         "\n%s: Caught std::exception-derived exception escaping the " \
9428         "death test statement. Exception message: %s\n", \
9429         ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
9430         gtest_exception.what()); \
9431     fflush(stderr); \
9432     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
9433   } catch (...) { \
9434     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
9435   }
9436 
9437 # else
9438 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
9439   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
9440 
9441 # endif
9442 
9443 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
9444 // ASSERT_EXIT*, and EXPECT_EXIT*.
9445 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
9446   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9447   if (::testing::internal::AlwaysTrue()) { \
9448     const ::testing::internal::RE& gtest_regex = (regex); \
9449     ::testing::internal::DeathTest* gtest_dt; \
9450     if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
9451         __FILE__, __LINE__, &gtest_dt)) { \
9452       goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
9453     } \
9454     if (gtest_dt != NULL) { \
9455       ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
9456           gtest_dt_ptr(gtest_dt); \
9457       switch (gtest_dt->AssumeRole()) { \
9458         case ::testing::internal::DeathTest::OVERSEE_TEST: \
9459           if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
9460             goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
9461           } \
9462           break; \
9463         case ::testing::internal::DeathTest::EXECUTE_TEST: { \
9464           ::testing::internal::DeathTest::ReturnSentinel \
9465               gtest_sentinel(gtest_dt); \
9466           GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
9467           gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
9468           break; \
9469         } \
9470         default: \
9471           break; \
9472       } \
9473     } \
9474   } else \
9475     GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
9476       fail(::testing::internal::DeathTest::LastMessage())
9477 // The symbol "fail" here expands to something into which a message
9478 // can be streamed.
9479 
9480 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
9481 // NDEBUG mode. In this case we need the statements to be executed and the macro
9482 // must accept a streamed message even though the message is never printed.
9483 // The regex object is not evaluated, but it is used to prevent "unused"
9484 // warnings and to avoid an expression that doesn't compile in debug mode.
9485 #define GTEST_EXECUTE_STATEMENT_(statement, regex)             \
9486   GTEST_AMBIGUOUS_ELSE_BLOCKER_                                \
9487   if (::testing::internal::AlwaysTrue()) {                     \
9488     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9489   } else if (!::testing::internal::AlwaysTrue()) {             \
9490     const ::testing::internal::RE& gtest_regex = (regex);      \
9491     static_cast<void>(gtest_regex);                            \
9492   } else                                                       \
9493     ::testing::Message()
9494 
9495 // A class representing the parsed contents of the
9496 // --gtest_internal_run_death_test flag, as it existed when
9497 // RUN_ALL_TESTS was called.
9498 class InternalRunDeathTestFlag {
9499  public:
9500   InternalRunDeathTestFlag(const std::string& a_file,
9501                            int a_line,
9502                            int an_index,
9503                            int a_write_fd)
9504       : file_(a_file), line_(a_line), index_(an_index),
9505         write_fd_(a_write_fd) {}
9506 
9507   ~InternalRunDeathTestFlag() {
9508     if (write_fd_ >= 0)
9509       posix::Close(write_fd_);
9510   }
9511 
9512   const std::string& file() const { return file_; }
9513   int line() const { return line_; }
9514   int index() const { return index_; }
9515   int write_fd() const { return write_fd_; }
9516 
9517  private:
9518   std::string file_;
9519   int line_;
9520   int index_;
9521   int write_fd_;
9522 
9523   GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
9524 };
9525 
9526 // Returns a newly created InternalRunDeathTestFlag object with fields
9527 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
9528 // the flag is specified; otherwise returns NULL.
9529 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
9530 
9531 #endif  // GTEST_HAS_DEATH_TEST
9532 
9533 }  // namespace internal
9534 }  // namespace testing
9535 
9536 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9537 
9538 namespace testing {
9539 
9540 // This flag controls the style of death tests.  Valid values are "threadsafe",
9541 // meaning that the death test child process will re-execute the test binary
9542 // from the start, running only a single death test, or "fast",
9543 // meaning that the child process will execute the test logic immediately
9544 // after forking.
9545 GTEST_DECLARE_string_(death_test_style);
9546 
9547 #if GTEST_HAS_DEATH_TEST
9548 
9549 namespace internal {
9550 
9551 // Returns a Boolean value indicating whether the caller is currently
9552 // executing in the context of the death test child process.  Tools such as
9553 // Valgrind heap checkers may need this to modify their behavior in death
9554 // tests.  IMPORTANT: This is an internal utility.  Using it may break the
9555 // implementation of death tests.  User code MUST NOT use it.
9556 GTEST_API_ bool InDeathTestChild();
9557 
9558 }  // namespace internal
9559 
9560 // The following macros are useful for writing death tests.
9561 
9562 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
9563 // executed:
9564 //
9565 //   1. It generates a warning if there is more than one active
9566 //   thread.  This is because it's safe to fork() or clone() only
9567 //   when there is a single thread.
9568 //
9569 //   2. The parent process clone()s a sub-process and runs the death
9570 //   test in it; the sub-process exits with code 0 at the end of the
9571 //   death test, if it hasn't exited already.
9572 //
9573 //   3. The parent process waits for the sub-process to terminate.
9574 //
9575 //   4. The parent process checks the exit code and error message of
9576 //   the sub-process.
9577 //
9578 // Examples:
9579 //
9580 //   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
9581 //   for (int i = 0; i < 5; i++) {
9582 //     EXPECT_DEATH(server.ProcessRequest(i),
9583 //                  "Invalid request .* in ProcessRequest()")
9584 //                  << "Failed to die on request " << i;
9585 //   }
9586 //
9587 //   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
9588 //
9589 //   bool KilledBySIGHUP(int exit_code) {
9590 //     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
9591 //   }
9592 //
9593 //   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
9594 //
9595 // On the regular expressions used in death tests:
9596 //
9597 //   GOOGLETEST_CM0005 DO NOT DELETE
9598 //   On POSIX-compliant systems (*nix), we use the <regex.h> library,
9599 //   which uses the POSIX extended regex syntax.
9600 //
9601 //   On other platforms (e.g. Windows or Mac), we only support a simple regex
9602 //   syntax implemented as part of Google Test.  This limited
9603 //   implementation should be enough most of the time when writing
9604 //   death tests; though it lacks many features you can find in PCRE
9605 //   or POSIX extended regex syntax.  For example, we don't support
9606 //   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
9607 //   repetition count ("x{5,7}"), among others.
9608 //
9609 //   Below is the syntax that we do support.  We chose it to be a
9610 //   subset of both PCRE and POSIX extended regex, so it's easy to
9611 //   learn wherever you come from.  In the following: 'A' denotes a
9612 //   literal character, period (.), or a single \\ escape sequence;
9613 //   'x' and 'y' denote regular expressions; 'm' and 'n' are for
9614 //   natural numbers.
9615 //
9616 //     c     matches any literal character c
9617 //     \\d   matches any decimal digit
9618 //     \\D   matches any character that's not a decimal digit
9619 //     \\f   matches \f
9620 //     \\n   matches \n
9621 //     \\r   matches \r
9622 //     \\s   matches any ASCII whitespace, including \n
9623 //     \\S   matches any character that's not a whitespace
9624 //     \\t   matches \t
9625 //     \\v   matches \v
9626 //     \\w   matches any letter, _, or decimal digit
9627 //     \\W   matches any character that \\w doesn't match
9628 //     \\c   matches any literal character c, which must be a punctuation
9629 //     .     matches any single character except \n
9630 //     A?    matches 0 or 1 occurrences of A
9631 //     A*    matches 0 or many occurrences of A
9632 //     A+    matches 1 or many occurrences of A
9633 //     ^     matches the beginning of a string (not that of each line)
9634 //     $     matches the end of a string (not that of each line)
9635 //     xy    matches x followed by y
9636 //
9637 //   If you accidentally use PCRE or POSIX extended regex features
9638 //   not implemented by us, you will get a run-time failure.  In that
9639 //   case, please try to rewrite your regular expression within the
9640 //   above syntax.
9641 //
9642 //   This implementation is *not* meant to be as highly tuned or robust
9643 //   as a compiled regex library, but should perform well enough for a
9644 //   death test, which already incurs significant overhead by launching
9645 //   a child process.
9646 //
9647 // Known caveats:
9648 //
9649 //   A "threadsafe" style death test obtains the path to the test
9650 //   program from argv[0] and re-executes it in the sub-process.  For
9651 //   simplicity, the current implementation doesn't search the PATH
9652 //   when launching the sub-process.  This means that the user must
9653 //   invoke the test program via a path that contains at least one
9654 //   path separator (e.g. path/to/foo_test and
9655 //   /absolute/path/to/bar_test are fine, but foo_test is not).  This
9656 //   is rarely a problem as people usually don't put the test binary
9657 //   directory in PATH.
9658 //
9659 // FIXME: make thread-safe death tests search the PATH.
9660 
9661 // Asserts that a given statement causes the program to exit, with an
9662 // integer exit status that satisfies predicate, and emitting error output
9663 // that matches regex.
9664 # define ASSERT_EXIT(statement, predicate, regex) \
9665     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
9666 
9667 // Like ASSERT_EXIT, but continues on to successive tests in the
9668 // test case, if any:
9669 # define EXPECT_EXIT(statement, predicate, regex) \
9670     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
9671 
9672 // Asserts that a given statement causes the program to exit, either by
9673 // explicitly exiting with a nonzero exit code or being killed by a
9674 // signal, and emitting error output that matches regex.
9675 # define ASSERT_DEATH(statement, regex) \
9676     ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
9677 
9678 // Like ASSERT_DEATH, but continues on to successive tests in the
9679 // test case, if any:
9680 # define EXPECT_DEATH(statement, regex) \
9681     EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
9682 
9683 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
9684 
9685 // Tests that an exit code describes a normal exit with a given exit code.
9686 class GTEST_API_ ExitedWithCode {
9687  public:
9688   explicit ExitedWithCode(int exit_code);
9689   bool operator()(int exit_status) const;
9690  private:
9691   // No implementation - assignment is unsupported.
9692   void operator=(const ExitedWithCode& other);
9693 
9694   const int exit_code_;
9695 };
9696 
9697 # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
9698 // Tests that an exit code describes an exit due to termination by a
9699 // given signal.
9700 // GOOGLETEST_CM0006 DO NOT DELETE
9701 class GTEST_API_ KilledBySignal {
9702  public:
9703   explicit KilledBySignal(int signum);
9704   bool operator()(int exit_status) const;
9705  private:
9706   const int signum_;
9707 };
9708 # endif  // !GTEST_OS_WINDOWS
9709 
9710 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
9711 // The death testing framework causes this to have interesting semantics,
9712 // since the sideeffects of the call are only visible in opt mode, and not
9713 // in debug mode.
9714 //
9715 // In practice, this can be used to test functions that utilize the
9716 // LOG(DFATAL) macro using the following style:
9717 //
9718 // int DieInDebugOr12(int* sideeffect) {
9719 //   if (sideeffect) {
9720 //     *sideeffect = 12;
9721 //   }
9722 //   LOG(DFATAL) << "death";
9723 //   return 12;
9724 // }
9725 //
9726 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
9727 //   int sideeffect = 0;
9728 //   // Only asserts in dbg.
9729 //   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
9730 //
9731 // #ifdef NDEBUG
9732 //   // opt-mode has sideeffect visible.
9733 //   EXPECT_EQ(12, sideeffect);
9734 // #else
9735 //   // dbg-mode no visible sideeffect.
9736 //   EXPECT_EQ(0, sideeffect);
9737 // #endif
9738 // }
9739 //
9740 // This will assert that DieInDebugReturn12InOpt() crashes in debug
9741 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
9742 // appropriate fallback value (12 in this case) in opt mode. If you
9743 // need to test that a function has appropriate side-effects in opt
9744 // mode, include assertions against the side-effects.  A general
9745 // pattern for this is:
9746 //
9747 // EXPECT_DEBUG_DEATH({
9748 //   // Side-effects here will have an effect after this statement in
9749 //   // opt mode, but none in debug mode.
9750 //   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
9751 // }, "death");
9752 //
9753 # ifdef NDEBUG
9754 
9755 #  define EXPECT_DEBUG_DEATH(statement, regex) \
9756   GTEST_EXECUTE_STATEMENT_(statement, regex)
9757 
9758 #  define ASSERT_DEBUG_DEATH(statement, regex) \
9759   GTEST_EXECUTE_STATEMENT_(statement, regex)
9760 
9761 # else
9762 
9763 #  define EXPECT_DEBUG_DEATH(statement, regex) \
9764   EXPECT_DEATH(statement, regex)
9765 
9766 #  define ASSERT_DEBUG_DEATH(statement, regex) \
9767   ASSERT_DEATH(statement, regex)
9768 
9769 # endif  // NDEBUG for EXPECT_DEBUG_DEATH
9770 #endif  // GTEST_HAS_DEATH_TEST
9771 
9772 // This macro is used for implementing macros such as
9773 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
9774 // death tests are not supported. Those macros must compile on such systems
9775 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
9776 // systems that support death tests. This allows one to write such a macro
9777 // on a system that does not support death tests and be sure that it will
9778 // compile on a death-test supporting system. It is exposed publicly so that
9779 // systems that have death-tests with stricter requirements than
9780 // GTEST_HAS_DEATH_TEST can write their own equivalent of
9781 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED.
9782 //
9783 // Parameters:
9784 //   statement -  A statement that a macro such as EXPECT_DEATH would test
9785 //                for program termination. This macro has to make sure this
9786 //                statement is compiled but not executed, to ensure that
9787 //                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
9788 //                parameter iff EXPECT_DEATH compiles with it.
9789 //   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
9790 //                the output of statement.  This parameter has to be
9791 //                compiled but not evaluated by this macro, to ensure that
9792 //                this macro only accepts expressions that a macro such as
9793 //                EXPECT_DEATH would accept.
9794 //   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
9795 //                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
9796 //                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
9797 //                compile inside functions where ASSERT_DEATH doesn't
9798 //                compile.
9799 //
9800 //  The branch that has an always false condition is used to ensure that
9801 //  statement and regex are compiled (and thus syntactically correct) but
9802 //  never executed. The unreachable code macro protects the terminator
9803 //  statement from generating an 'unreachable code' warning in case
9804 //  statement unconditionally returns or throws. The Message constructor at
9805 //  the end allows the syntax of streaming additional messages into the
9806 //  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
9807 # define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \
9808     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9809     if (::testing::internal::AlwaysTrue()) { \
9810       GTEST_LOG_(WARNING) \
9811           << "Death tests are not supported on this platform.\n" \
9812           << "Statement '" #statement "' cannot be verified."; \
9813     } else if (::testing::internal::AlwaysFalse()) { \
9814       ::testing::internal::RE::PartialMatch(".*", (regex)); \
9815       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9816       terminator; \
9817     } else \
9818       ::testing::Message()
9819 
9820 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
9821 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
9822 // death tests are supported; otherwise they just issue a warning.  This is
9823 // useful when you are combining death test assertions with normal test
9824 // assertions in one test.
9825 #if GTEST_HAS_DEATH_TEST
9826 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
9827     EXPECT_DEATH(statement, regex)
9828 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
9829     ASSERT_DEATH(statement, regex)
9830 #else
9831 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
9832     GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
9833 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
9834     GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, return)
9835 #endif
9836 
9837 }  // namespace testing
9838 
9839 #endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9840 // This file was GENERATED by command:
9841 //     pump.py gtest-param-test.h.pump
9842 // DO NOT EDIT BY HAND!!!
9843 
9844 // Copyright 2008, Google Inc.
9845 // All rights reserved.
9846 //
9847 // Redistribution and use in source and binary forms, with or without
9848 // modification, are permitted provided that the following conditions are
9849 // met:
9850 //
9851 //     * Redistributions of source code must retain the above copyright
9852 // notice, this list of conditions and the following disclaimer.
9853 //     * Redistributions in binary form must reproduce the above
9854 // copyright notice, this list of conditions and the following disclaimer
9855 // in the documentation and/or other materials provided with the
9856 // distribution.
9857 //     * Neither the name of Google Inc. nor the names of its
9858 // contributors may be used to endorse or promote products derived from
9859 // this software without specific prior written permission.
9860 //
9861 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9862 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9863 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9864 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9865 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9866 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9867 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9868 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9869 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9870 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9871 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9872 //
9873 // Macros and functions for implementing parameterized tests
9874 // in Google C++ Testing and Mocking Framework (Google Test)
9875 //
9876 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
9877 //
9878 // GOOGLETEST_CM0001 DO NOT DELETE
9879 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
9880 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
9881 
9882 
9883 // Value-parameterized tests allow you to test your code with different
9884 // parameters without writing multiple copies of the same test.
9885 //
9886 // Here is how you use value-parameterized tests:
9887 
9888 #if 0
9889 
9890 // To write value-parameterized tests, first you should define a fixture
9891 // class. It is usually derived from testing::TestWithParam<T> (see below for
9892 // another inheritance scheme that's sometimes useful in more complicated
9893 // class hierarchies), where the type of your parameter values.
9894 // TestWithParam<T> is itself derived from testing::Test. T can be any
9895 // copyable type. If it's a raw pointer, you are responsible for managing the
9896 // lifespan of the pointed values.
9897 
9898 class FooTest : public ::testing::TestWithParam<const char*> {
9899   // You can implement all the usual class fixture members here.
9900 };
9901 
9902 // Then, use the TEST_P macro to define as many parameterized tests
9903 // for this fixture as you want. The _P suffix is for "parameterized"
9904 // or "pattern", whichever you prefer to think.
9905 
9906 TEST_P(FooTest, DoesBlah) {
9907   // Inside a test, access the test parameter with the GetParam() method
9908   // of the TestWithParam<T> class:
9909   EXPECT_TRUE(foo.Blah(GetParam()));
9910   ...
9911 }
9912 
9913 TEST_P(FooTest, HasBlahBlah) {
9914   ...
9915 }
9916 
9917 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
9918 // case with any set of parameters you want. Google Test defines a number
9919 // of functions for generating test parameters. They return what we call
9920 // (surprise!) parameter generators. Here is a summary of them, which
9921 // are all in the testing namespace:
9922 //
9923 //
9924 //  Range(begin, end [, step]) - Yields values {begin, begin+step,
9925 //                               begin+step+step, ...}. The values do not
9926 //                               include end. step defaults to 1.
9927 //  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
9928 //  ValuesIn(container)        - Yields values from a C-style array, an STL
9929 //  ValuesIn(begin,end)          container, or an iterator range [begin, end).
9930 //  Bool()                     - Yields sequence {false, true}.
9931 //  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
9932 //                               for the math savvy) of the values generated
9933 //                               by the N generators.
9934 //
9935 // For more details, see comments at the definitions of these functions below
9936 // in this file.
9937 //
9938 // The following statement will instantiate tests from the FooTest test case
9939 // each with parameter values "meeny", "miny", and "moe".
9940 
9941 INSTANTIATE_TEST_CASE_P(InstantiationName,
9942                         FooTest,
9943                         Values("meeny", "miny", "moe"));
9944 
9945 // To distinguish different instances of the pattern, (yes, you
9946 // can instantiate it more then once) the first argument to the
9947 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
9948 // actual test case name. Remember to pick unique prefixes for different
9949 // instantiations. The tests from the instantiation above will have
9950 // these names:
9951 //
9952 //    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
9953 //    * InstantiationName/FooTest.DoesBlah/1 for "miny"
9954 //    * InstantiationName/FooTest.DoesBlah/2 for "moe"
9955 //    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
9956 //    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
9957 //    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
9958 //
9959 // You can use these names in --gtest_filter.
9960 //
9961 // This statement will instantiate all tests from FooTest again, each
9962 // with parameter values "cat" and "dog":
9963 
9964 const char* pets[] = {"cat", "dog"};
9965 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
9966 
9967 // The tests from the instantiation above will have these names:
9968 //
9969 //    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
9970 //    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
9971 //    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
9972 //    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
9973 //
9974 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
9975 // in the given test case, whether their definitions come before or
9976 // AFTER the INSTANTIATE_TEST_CASE_P statement.
9977 //
9978 // Please also note that generator expressions (including parameters to the
9979 // generators) are evaluated in InitGoogleTest(), after main() has started.
9980 // This allows the user on one hand, to adjust generator parameters in order
9981 // to dynamically determine a set of tests to run and on the other hand,
9982 // give the user a chance to inspect the generated tests with Google Test
9983 // reflection API before RUN_ALL_TESTS() is executed.
9984 //
9985 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
9986 // for more examples.
9987 //
9988 // In the future, we plan to publish the API for defining new parameter
9989 // generators. But for now this interface remains part of the internal
9990 // implementation and is subject to change.
9991 //
9992 //
9993 // A parameterized test fixture must be derived from testing::Test and from
9994 // testing::WithParamInterface<T>, where T is the type of the parameter
9995 // values. Inheriting from TestWithParam<T> satisfies that requirement because
9996 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
9997 // complicated hierarchies, however, it is occasionally useful to inherit
9998 // separately from Test and WithParamInterface. For example:
9999 
10000 class BaseTest : public ::testing::Test {
10001   // You can inherit all the usual members for a non-parameterized test
10002   // fixture here.
10003 };
10004 
10005 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
10006   // The usual test fixture members go here too.
10007 };
10008 
10009 TEST_F(BaseTest, HasFoo) {
10010   // This is an ordinary non-parameterized test.
10011 }
10012 
10013 TEST_P(DerivedTest, DoesBlah) {
10014   // GetParam works just the same here as if you inherit from TestWithParam.
10015   EXPECT_TRUE(foo.Blah(GetParam()));
10016 }
10017 
10018 #endif  // 0
10019 
10020 
10021 #if !GTEST_OS_SYMBIAN
10022 # include <utility>
10023 #endif
10024 
10025 // Copyright 2008 Google Inc.
10026 // All Rights Reserved.
10027 //
10028 // Redistribution and use in source and binary forms, with or without
10029 // modification, are permitted provided that the following conditions are
10030 // met:
10031 //
10032 //     * Redistributions of source code must retain the above copyright
10033 // notice, this list of conditions and the following disclaimer.
10034 //     * Redistributions in binary form must reproduce the above
10035 // copyright notice, this list of conditions and the following disclaimer
10036 // in the documentation and/or other materials provided with the
10037 // distribution.
10038 //     * Neither the name of Google Inc. nor the names of its
10039 // contributors may be used to endorse or promote products derived from
10040 // this software without specific prior written permission.
10041 //
10042 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10043 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10044 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10045 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10046 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10047 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10048 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10049 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10050 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10051 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10052 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10053 
10054 
10055 // Type and function utilities for implementing parameterized tests.
10056 
10057 // GOOGLETEST_CM0001 DO NOT DELETE
10058 
10059 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10060 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10061 
10062 #include <ctype.h>
10063 
10064 #include <iterator>
10065 #include <set>
10066 #include <utility>
10067 #include <vector>
10068 
10069 // Copyright 2003 Google Inc.
10070 // All rights reserved.
10071 //
10072 // Redistribution and use in source and binary forms, with or without
10073 // modification, are permitted provided that the following conditions are
10074 // met:
10075 //
10076 //     * Redistributions of source code must retain the above copyright
10077 // notice, this list of conditions and the following disclaimer.
10078 //     * Redistributions in binary form must reproduce the above
10079 // copyright notice, this list of conditions and the following disclaimer
10080 // in the documentation and/or other materials provided with the
10081 // distribution.
10082 //     * Neither the name of Google Inc. nor the names of its
10083 // contributors may be used to endorse or promote products derived from
10084 // this software without specific prior written permission.
10085 //
10086 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10087 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10088 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10089 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10090 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10091 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10092 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10093 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10094 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10095 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10096 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10097 //
10098 // A "smart" pointer type with reference tracking.  Every pointer to a
10099 // particular object is kept on a circular linked list.  When the last pointer
10100 // to an object is destroyed or reassigned, the object is deleted.
10101 //
10102 // Used properly, this deletes the object when the last reference goes away.
10103 // There are several caveats:
10104 // - Like all reference counting schemes, cycles lead to leaks.
10105 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
10106 // - Every time a pointer is assigned, the entire list of pointers to that
10107 //   object is traversed.  This class is therefore NOT SUITABLE when there
10108 //   will often be more than two or three pointers to a particular object.
10109 // - References are only tracked as long as linked_ptr<> objects are copied.
10110 //   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
10111 //   will happen (double deletion).
10112 //
10113 // A good use of this class is storing object references in STL containers.
10114 // You can safely put linked_ptr<> in a vector<>.
10115 // Other uses may not be as good.
10116 //
10117 // Note: If you use an incomplete type with linked_ptr<>, the class
10118 // *containing* linked_ptr<> must have a constructor and destructor (even
10119 // if they do nothing!).
10120 //
10121 // Bill Gibbons suggested we use something like this.
10122 //
10123 // Thread Safety:
10124 //   Unlike other linked_ptr implementations, in this implementation
10125 //   a linked_ptr object is thread-safe in the sense that:
10126 //     - it's safe to copy linked_ptr objects concurrently,
10127 //     - it's safe to copy *from* a linked_ptr and read its underlying
10128 //       raw pointer (e.g. via get()) concurrently, and
10129 //     - it's safe to write to two linked_ptrs that point to the same
10130 //       shared object concurrently.
10131 // FIXME: rename this to safe_linked_ptr to avoid
10132 // confusion with normal linked_ptr.
10133 
10134 // GOOGLETEST_CM0001 DO NOT DELETE
10135 
10136 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10137 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10138 
10139 #include <stdlib.h>
10140 #include <assert.h>
10141 
10142 
10143 namespace testing {
10144 namespace internal {
10145 
10146 // Protects copying of all linked_ptr objects.
10147 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
10148 
10149 // This is used internally by all instances of linked_ptr<>.  It needs to be
10150 // a non-template class because different types of linked_ptr<> can refer to
10151 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
10152 // So, it needs to be possible for different types of linked_ptr to participate
10153 // in the same circular linked list, so we need a single class type here.
10154 //
10155 // DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
10156 class linked_ptr_internal {
10157  public:
10158   // Create a new circle that includes only this instance.
10159   void join_new() {
10160     next_ = this;
10161   }
10162 
10163   // Many linked_ptr operations may change p.link_ for some linked_ptr
10164   // variable p in the same circle as this object.  Therefore we need
10165   // to prevent two such operations from occurring concurrently.
10166   //
10167   // Note that different types of linked_ptr objects can coexist in a
10168   // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
10169   // linked_ptr<Derived2>).  Therefore we must use a single mutex to
10170   // protect all linked_ptr objects.  This can create serious
10171   // contention in production code, but is acceptable in a testing
10172   // framework.
10173 
10174   // Join an existing circle.
10175   void join(linked_ptr_internal const* ptr)
10176       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
10177     MutexLock lock(&g_linked_ptr_mutex);
10178 
10179     linked_ptr_internal const* p = ptr;
10180     while (p->next_ != ptr) {
10181       assert(p->next_ != this &&
10182              "Trying to join() a linked ring we are already in. "
10183              "Is GMock thread safety enabled?");
10184       p = p->next_;
10185     }
10186     p->next_ = this;
10187     next_ = ptr;
10188   }
10189 
10190   // Leave whatever circle we're part of.  Returns true if we were the
10191   // last member of the circle.  Once this is done, you can join() another.
10192   bool depart()
10193       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
10194     MutexLock lock(&g_linked_ptr_mutex);
10195 
10196     if (next_ == this) return true;
10197     linked_ptr_internal const* p = next_;
10198     while (p->next_ != this) {
10199       assert(p->next_ != next_ &&
10200              "Trying to depart() a linked ring we are not in. "
10201              "Is GMock thread safety enabled?");
10202       p = p->next_;
10203     }
10204     p->next_ = next_;
10205     return false;
10206   }
10207 
10208  private:
10209   mutable linked_ptr_internal const* next_;
10210 };
10211 
10212 template <typename T>
10213 class linked_ptr {
10214  public:
10215   typedef T element_type;
10216 
10217   // Take over ownership of a raw pointer.  This should happen as soon as
10218   // possible after the object is created.
10219   explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
10220   ~linked_ptr() { depart(); }
10221 
10222   // Copy an existing linked_ptr<>, adding ourselves to the list of references.
10223   template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
10224   linked_ptr(linked_ptr const& ptr) {  // NOLINT
10225     assert(&ptr != this);
10226     copy(&ptr);
10227   }
10228 
10229   // Assignment releases the old value and acquires the new.
10230   template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
10231     depart();
10232     copy(&ptr);
10233     return *this;
10234   }
10235 
10236   linked_ptr& operator=(linked_ptr const& ptr) {
10237     if (&ptr != this) {
10238       depart();
10239       copy(&ptr);
10240     }
10241     return *this;
10242   }
10243 
10244   // Smart pointer members.
10245   void reset(T* ptr = NULL) {
10246     depart();
10247     capture(ptr);
10248   }
10249   T* get() const { return value_; }
10250   T* operator->() const { return value_; }
10251   T& operator*() const { return *value_; }
10252 
10253   bool operator==(T* p) const { return value_ == p; }
10254   bool operator!=(T* p) const { return value_ != p; }
10255   template <typename U>
10256   bool operator==(linked_ptr<U> const& ptr) const {
10257     return value_ == ptr.get();
10258   }
10259   template <typename U>
10260   bool operator!=(linked_ptr<U> const& ptr) const {
10261     return value_ != ptr.get();
10262   }
10263 
10264  private:
10265   template <typename U>
10266   friend class linked_ptr;
10267 
10268   T* value_;
10269   linked_ptr_internal link_;
10270 
10271   void depart() {
10272     if (link_.depart()) delete value_;
10273   }
10274 
10275   void capture(T* ptr) {
10276     value_ = ptr;
10277     link_.join_new();
10278   }
10279 
10280   template <typename U> void copy(linked_ptr<U> const* ptr) {
10281     value_ = ptr->get();
10282     if (value_)
10283       link_.join(&ptr->link_);
10284     else
10285       link_.join_new();
10286   }
10287 };
10288 
10289 template<typename T> inline
10290 bool operator==(T* ptr, const linked_ptr<T>& x) {
10291   return ptr == x.get();
10292 }
10293 
10294 template<typename T> inline
10295 bool operator!=(T* ptr, const linked_ptr<T>& x) {
10296   return ptr != x.get();
10297 }
10298 
10299 // A function to convert T* into linked_ptr<T>
10300 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
10301 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
10302 template <typename T>
10303 linked_ptr<T> make_linked_ptr(T* ptr) {
10304   return linked_ptr<T>(ptr);
10305 }
10306 
10307 }  // namespace internal
10308 }  // namespace testing
10309 
10310 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10311 // Copyright 2007, Google Inc.
10312 // All rights reserved.
10313 //
10314 // Redistribution and use in source and binary forms, with or without
10315 // modification, are permitted provided that the following conditions are
10316 // met:
10317 //
10318 //     * Redistributions of source code must retain the above copyright
10319 // notice, this list of conditions and the following disclaimer.
10320 //     * Redistributions in binary form must reproduce the above
10321 // copyright notice, this list of conditions and the following disclaimer
10322 // in the documentation and/or other materials provided with the
10323 // distribution.
10324 //     * Neither the name of Google Inc. nor the names of its
10325 // contributors may be used to endorse or promote products derived from
10326 // this software without specific prior written permission.
10327 //
10328 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10329 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10330 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10331 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10332 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10333 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10334 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10335 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10336 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10337 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10338 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10339 
10340 
10341 // Google Test - The Google C++ Testing and Mocking Framework
10342 //
10343 // This file implements a universal value printer that can print a
10344 // value of any type T:
10345 //
10346 //   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
10347 //
10348 // A user can teach this function how to print a class type T by
10349 // defining either operator<<() or PrintTo() in the namespace that
10350 // defines T.  More specifically, the FIRST defined function in the
10351 // following list will be used (assuming T is defined in namespace
10352 // foo):
10353 //
10354 //   1. foo::PrintTo(const T&, ostream*)
10355 //   2. operator<<(ostream&, const T&) defined in either foo or the
10356 //      global namespace.
10357 //
10358 // However if T is an STL-style container then it is printed element-wise
10359 // unless foo::PrintTo(const T&, ostream*) is defined. Note that
10360 // operator<<() is ignored for container types.
10361 //
10362 // If none of the above is defined, it will print the debug string of
10363 // the value if it is a protocol buffer, or print the raw bytes in the
10364 // value otherwise.
10365 //
10366 // To aid debugging: when T is a reference type, the address of the
10367 // value is also printed; when T is a (const) char pointer, both the
10368 // pointer value and the NUL-terminated string it points to are
10369 // printed.
10370 //
10371 // We also provide some convenient wrappers:
10372 //
10373 //   // Prints a value to a string.  For a (const or not) char
10374 //   // pointer, the NUL-terminated string (but not the pointer) is
10375 //   // printed.
10376 //   std::string ::testing::PrintToString(const T& value);
10377 //
10378 //   // Prints a value tersely: for a reference type, the referenced
10379 //   // value (but not the address) is printed; for a (const or not) char
10380 //   // pointer, the NUL-terminated string (but not the pointer) is
10381 //   // printed.
10382 //   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
10383 //
10384 //   // Prints value using the type inferred by the compiler.  The difference
10385 //   // from UniversalTersePrint() is that this function prints both the
10386 //   // pointer and the NUL-terminated string for a (const or not) char pointer.
10387 //   void ::testing::internal::UniversalPrint(const T& value, ostream*);
10388 //
10389 //   // Prints the fields of a tuple tersely to a string vector, one
10390 //   // element for each field. Tuple support must be enabled in
10391 //   // gtest-port.h.
10392 //   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
10393 //       const Tuple& value);
10394 //
10395 // Known limitation:
10396 //
10397 // The print primitives print the elements of an STL-style container
10398 // using the compiler-inferred type of *iter where iter is a
10399 // const_iterator of the container.  When const_iterator is an input
10400 // iterator but not a forward iterator, this inferred type may not
10401 // match value_type, and the print output may be incorrect.  In
10402 // practice, this is rarely a problem as for most containers
10403 // const_iterator is a forward iterator.  We'll fix this if there's an
10404 // actual need for it.  Note that this fix cannot rely on value_type
10405 // being defined as many user-defined container types don't have
10406 // value_type.
10407 
10408 // GOOGLETEST_CM0001 DO NOT DELETE
10409 
10410 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10411 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10412 
10413 #include <ostream>  // NOLINT
10414 #include <sstream>
10415 #include <string>
10416 #include <utility>
10417 #include <vector>
10418 
10419 #if GTEST_HAS_STD_TUPLE_
10420 # include <tuple>
10421 #endif
10422 
10423 #if GTEST_HAS_ABSL
10424 #include "absl/strings/string_view.h"
10425 #include "absl/types/optional.h"
10426 #include "absl/types/variant.h"
10427 #endif  // GTEST_HAS_ABSL
10428 
10429 namespace testing {
10430 
10431 // Definitions in the 'internal' and 'internal2' name spaces are
10432 // subject to change without notice.  DO NOT USE THEM IN USER CODE!
10433 namespace internal2 {
10434 
10435 // Prints the given number of bytes in the given object to the given
10436 // ostream.
10437 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
10438                                      size_t count,
10439                                      ::std::ostream* os);
10440 
10441 // For selecting which printer to use when a given type has neither <<
10442 // nor PrintTo().
10443 enum TypeKind {
10444   kProtobuf,              // a protobuf type
10445   kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
10446                           // (e.g. a named or unnamed enum type)
10447 #if GTEST_HAS_ABSL
10448   kConvertibleToStringView,  // a type implicitly convertible to
10449                              // absl::string_view
10450 #endif
10451   kOtherType  // anything else
10452 };
10453 
10454 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
10455 // by the universal printer to print a value of type T when neither
10456 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
10457 // "kind" of T as defined by enum TypeKind.
10458 template <typename T, TypeKind kTypeKind>
10459 class TypeWithoutFormatter {
10460  public:
10461   // This default version is called when kTypeKind is kOtherType.
10462   static void PrintValue(const T& value, ::std::ostream* os) {
10463     PrintBytesInObjectTo(static_cast<const unsigned char*>(
10464                              reinterpret_cast<const void*>(&value)),
10465                          sizeof(value), os);
10466   }
10467 };
10468 
10469 // We print a protobuf using its ShortDebugString() when the string
10470 // doesn't exceed this many characters; otherwise we print it using
10471 // DebugString() for better readability.
10472 const size_t kProtobufOneLinerMaxLength = 50;
10473 
10474 template <typename T>
10475 class TypeWithoutFormatter<T, kProtobuf> {
10476  public:
10477   static void PrintValue(const T& value, ::std::ostream* os) {
10478     std::string pretty_str = value.ShortDebugString();
10479     if (pretty_str.length() > kProtobufOneLinerMaxLength) {
10480       pretty_str = "\n" + value.DebugString();
10481     }
10482     *os << ("<" + pretty_str + ">");
10483   }
10484 };
10485 
10486 template <typename T>
10487 class TypeWithoutFormatter<T, kConvertibleToInteger> {
10488  public:
10489   // Since T has no << operator or PrintTo() but can be implicitly
10490   // converted to BiggestInt, we print it as a BiggestInt.
10491   //
10492   // Most likely T is an enum type (either named or unnamed), in which
10493   // case printing it as an integer is the desired behavior.  In case
10494   // T is not an enum, printing it as an integer is the best we can do
10495   // given that it has no user-defined printer.
10496   static void PrintValue(const T& value, ::std::ostream* os) {
10497     const internal::BiggestInt kBigInt = value;
10498     *os << kBigInt;
10499   }
10500 };
10501 
10502 #if GTEST_HAS_ABSL
10503 template <typename T>
10504 class TypeWithoutFormatter<T, kConvertibleToStringView> {
10505  public:
10506   // Since T has neither operator<< nor PrintTo() but can be implicitly
10507   // converted to absl::string_view, we print it as a absl::string_view.
10508   //
10509   // Note: the implementation is further below, as it depends on
10510   // internal::PrintTo symbol which is defined later in the file.
10511   static void PrintValue(const T& value, ::std::ostream* os);
10512 };
10513 #endif
10514 
10515 // Prints the given value to the given ostream.  If the value is a
10516 // protocol message, its debug string is printed; if it's an enum or
10517 // of a type implicitly convertible to BiggestInt, it's printed as an
10518 // integer; otherwise the bytes in the value are printed.  This is
10519 // what UniversalPrinter<T>::Print() does when it knows nothing about
10520 // type T and T has neither << operator nor PrintTo().
10521 //
10522 // A user can override this behavior for a class type Foo by defining
10523 // a << operator in the namespace where Foo is defined.
10524 //
10525 // We put this operator in namespace 'internal2' instead of 'internal'
10526 // to simplify the implementation, as much code in 'internal' needs to
10527 // use << in STL, which would conflict with our own << were it defined
10528 // in 'internal'.
10529 //
10530 // Note that this operator<< takes a generic std::basic_ostream<Char,
10531 // CharTraits> type instead of the more restricted std::ostream.  If
10532 // we define it to take an std::ostream instead, we'll get an
10533 // "ambiguous overloads" compiler error when trying to print a type
10534 // Foo that supports streaming to std::basic_ostream<Char,
10535 // CharTraits>, as the compiler cannot tell whether
10536 // operator<<(std::ostream&, const T&) or
10537 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
10538 // specific.
10539 template <typename Char, typename CharTraits, typename T>
10540 ::std::basic_ostream<Char, CharTraits>& operator<<(
10541     ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
10542   TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value
10543                                ? kProtobuf
10544                                : internal::ImplicitlyConvertible<
10545                                      const T&, internal::BiggestInt>::value
10546                                      ? kConvertibleToInteger
10547                                      :
10548 #if GTEST_HAS_ABSL
10549                                      internal::ImplicitlyConvertible<
10550                                          const T&, absl::string_view>::value
10551                                          ? kConvertibleToStringView
10552                                          :
10553 #endif
10554                                          kOtherType)>::PrintValue(x, &os);
10555   return os;
10556 }
10557 
10558 }  // namespace internal2
10559 }  // namespace testing
10560 
10561 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
10562 // magic needed for implementing UniversalPrinter won't work.
10563 namespace testing_internal {
10564 
10565 // Used to print a value that is not an STL-style container when the
10566 // user doesn't define PrintTo() for it.
10567 template <typename T>
10568 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
10569   // With the following statement, during unqualified name lookup,
10570   // testing::internal2::operator<< appears as if it was declared in
10571   // the nearest enclosing namespace that contains both
10572   // ::testing_internal and ::testing::internal2, i.e. the global
10573   // namespace.  For more details, refer to the C++ Standard section
10574   // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
10575   // testing::internal2::operator<< in case T doesn't come with a <<
10576   // operator.
10577   //
10578   // We cannot write 'using ::testing::internal2::operator<<;', which
10579   // gcc 3.3 fails to compile due to a compiler bug.
10580   using namespace ::testing::internal2;  // NOLINT
10581 
10582   // Assuming T is defined in namespace foo, in the next statement,
10583   // the compiler will consider all of:
10584   //
10585   //   1. foo::operator<< (thanks to Koenig look-up),
10586   //   2. ::operator<< (as the current namespace is enclosed in ::),
10587   //   3. testing::internal2::operator<< (thanks to the using statement above).
10588   //
10589   // The operator<< whose type matches T best will be picked.
10590   //
10591   // We deliberately allow #2 to be a candidate, as sometimes it's
10592   // impossible to define #1 (e.g. when foo is ::std, defining
10593   // anything in it is undefined behavior unless you are a compiler
10594   // vendor.).
10595   *os << value;
10596 }
10597 
10598 }  // namespace testing_internal
10599 
10600 namespace testing {
10601 namespace internal {
10602 
10603 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
10604 // value of type ToPrint that is an operand of a comparison assertion
10605 // (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
10606 // the comparison, and is used to help determine the best way to
10607 // format the value.  In particular, when the value is a C string
10608 // (char pointer) and the other operand is an STL string object, we
10609 // want to format the C string as a string, since we know it is
10610 // compared by value with the string object.  If the value is a char
10611 // pointer but the other operand is not an STL string object, we don't
10612 // know whether the pointer is supposed to point to a NUL-terminated
10613 // string, and thus want to print it as a pointer to be safe.
10614 //
10615 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
10616 
10617 // The default case.
10618 template <typename ToPrint, typename OtherOperand>
10619 class FormatForComparison {
10620  public:
10621   static ::std::string Format(const ToPrint& value) {
10622     return ::testing::PrintToString(value);
10623   }
10624 };
10625 
10626 // Array.
10627 template <typename ToPrint, size_t N, typename OtherOperand>
10628 class FormatForComparison<ToPrint[N], OtherOperand> {
10629  public:
10630   static ::std::string Format(const ToPrint* value) {
10631     return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
10632   }
10633 };
10634 
10635 // By default, print C string as pointers to be safe, as we don't know
10636 // whether they actually point to a NUL-terminated string.
10637 
10638 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
10639   template <typename OtherOperand>                                      \
10640   class FormatForComparison<CharType*, OtherOperand> {                  \
10641    public:                                                              \
10642     static ::std::string Format(CharType* value) {                      \
10643       return ::testing::PrintToString(static_cast<const void*>(value)); \
10644     }                                                                   \
10645   }
10646 
10647 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
10648 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
10649 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
10650 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
10651 
10652 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
10653 
10654 // If a C string is compared with an STL string object, we know it's meant
10655 // to point to a NUL-terminated string, and thus can print it as a string.
10656 
10657 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
10658   template <>                                                           \
10659   class FormatForComparison<CharType*, OtherStringType> {               \
10660    public:                                                              \
10661     static ::std::string Format(CharType* value) {                      \
10662       return ::testing::PrintToString(value);                           \
10663     }                                                                   \
10664   }
10665 
10666 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
10667 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
10668 
10669 #if GTEST_HAS_GLOBAL_STRING
10670 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
10671 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
10672 #endif
10673 
10674 #if GTEST_HAS_GLOBAL_WSTRING
10675 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
10676 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
10677 #endif
10678 
10679 #if GTEST_HAS_STD_WSTRING
10680 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
10681 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
10682 #endif
10683 
10684 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
10685 
10686 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
10687 // operand to be used in a failure message.  The type (but not value)
10688 // of the other operand may affect the format.  This allows us to
10689 // print a char* as a raw pointer when it is compared against another
10690 // char* or void*, and print it as a C string when it is compared
10691 // against an std::string object, for example.
10692 //
10693 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
10694 template <typename T1, typename T2>
10695 std::string FormatForComparisonFailureMessage(
10696     const T1& value, const T2& /* other_operand */) {
10697   return FormatForComparison<T1, T2>::Format(value);
10698 }
10699 
10700 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
10701 // value to the given ostream.  The caller must ensure that
10702 // 'ostream_ptr' is not NULL, or the behavior is undefined.
10703 //
10704 // We define UniversalPrinter as a class template (as opposed to a
10705 // function template), as we need to partially specialize it for
10706 // reference types, which cannot be done with function templates.
10707 template <typename T>
10708 class UniversalPrinter;
10709 
10710 template <typename T>
10711 void UniversalPrint(const T& value, ::std::ostream* os);
10712 
10713 enum DefaultPrinterType {
10714   kPrintContainer,
10715   kPrintPointer,
10716   kPrintFunctionPointer,
10717   kPrintOther,
10718 };
10719 template <DefaultPrinterType type> struct WrapPrinterType {};
10720 
10721 // Used to print an STL-style container when the user doesn't define
10722 // a PrintTo() for it.
10723 template <typename C>
10724 void DefaultPrintTo(WrapPrinterType<kPrintContainer> /* dummy */,
10725                     const C& container, ::std::ostream* os) {
10726   const size_t kMaxCount = 32;  // The maximum number of elements to print.
10727   *os << '{';
10728   size_t count = 0;
10729   for (typename C::const_iterator it = container.begin();
10730        it != container.end(); ++it, ++count) {
10731     if (count > 0) {
10732       *os << ',';
10733       if (count == kMaxCount) {  // Enough has been printed.
10734         *os << " ...";
10735         break;
10736       }
10737     }
10738     *os << ' ';
10739     // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
10740     // handle *it being a native array.
10741     internal::UniversalPrint(*it, os);
10742   }
10743 
10744   if (count > 0) {
10745     *os << ' ';
10746   }
10747   *os << '}';
10748 }
10749 
10750 // Used to print a pointer that is neither a char pointer nor a member
10751 // pointer, when the user doesn't define PrintTo() for it.  (A member
10752 // variable pointer or member function pointer doesn't really point to
10753 // a location in the address space.  Their representation is
10754 // implementation-defined.  Therefore they will be printed as raw
10755 // bytes.)
10756 template <typename T>
10757 void DefaultPrintTo(WrapPrinterType<kPrintPointer> /* dummy */,
10758                     T* p, ::std::ostream* os) {
10759   if (p == NULL) {
10760     *os << "NULL";
10761   } else {
10762     // T is not a function type.  We just call << to print p,
10763     // relying on ADL to pick up user-defined << for their pointer
10764     // types, if any.
10765     *os << p;
10766   }
10767 }
10768 template <typename T>
10769 void DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,
10770                     T* p, ::std::ostream* os) {
10771   if (p == NULL) {
10772     *os << "NULL";
10773   } else {
10774     // T is a function type, so '*os << p' doesn't do what we want
10775     // (it just prints p as bool).  We want to print p as a const
10776     // void*.
10777     *os << reinterpret_cast<const void*>(p);
10778   }
10779 }
10780 
10781 // Used to print a non-container, non-pointer value when the user
10782 // doesn't define PrintTo() for it.
10783 template <typename T>
10784 void DefaultPrintTo(WrapPrinterType<kPrintOther> /* dummy */,
10785                     const T& value, ::std::ostream* os) {
10786   ::testing_internal::DefaultPrintNonContainerTo(value, os);
10787 }
10788 
10789 // Prints the given value using the << operator if it has one;
10790 // otherwise prints the bytes in it.  This is what
10791 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
10792 // or overloaded for type T.
10793 //
10794 // A user can override this behavior for a class type Foo by defining
10795 // an overload of PrintTo() in the namespace where Foo is defined.  We
10796 // give the user this option as sometimes defining a << operator for
10797 // Foo is not desirable (e.g. the coding style may prevent doing it,
10798 // or there is already a << operator but it doesn't do what the user
10799 // wants).
10800 template <typename T>
10801 void PrintTo(const T& value, ::std::ostream* os) {
10802   // DefaultPrintTo() is overloaded.  The type of its first argument
10803   // determines which version will be picked.
10804   //
10805   // Note that we check for container types here, prior to we check
10806   // for protocol message types in our operator<<.  The rationale is:
10807   //
10808   // For protocol messages, we want to give people a chance to
10809   // override Google Mock's format by defining a PrintTo() or
10810   // operator<<.  For STL containers, other formats can be
10811   // incompatible with Google Mock's format for the container
10812   // elements; therefore we check for container types here to ensure
10813   // that our format is used.
10814   //
10815   // Note that MSVC and clang-cl do allow an implicit conversion from
10816   // pointer-to-function to pointer-to-object, but clang-cl warns on it.
10817   // So don't use ImplicitlyConvertible if it can be helped since it will
10818   // cause this warning, and use a separate overload of DefaultPrintTo for
10819   // function pointers so that the `*os << p` in the object pointer overload
10820   // doesn't cause that warning either.
10821   DefaultPrintTo(
10822       WrapPrinterType <
10823                   (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
10824               !IsRecursiveContainer<T>::value
10825           ? kPrintContainer
10826           : !is_pointer<T>::value
10827                 ? kPrintOther
10828 #if GTEST_LANG_CXX11
10829                 : std::is_function<typename std::remove_pointer<T>::type>::value
10830 #else
10831                 : !internal::ImplicitlyConvertible<T, const void*>::value
10832 #endif
10833                       ? kPrintFunctionPointer
10834                       : kPrintPointer > (),
10835       value, os);
10836 }
10837 
10838 // The following list of PrintTo() overloads tells
10839 // UniversalPrinter<T>::Print() how to print standard types (built-in
10840 // types, strings, plain arrays, and pointers).
10841 
10842 // Overloads for various char types.
10843 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
10844 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
10845 inline void PrintTo(char c, ::std::ostream* os) {
10846   // When printing a plain char, we always treat it as unsigned.  This
10847   // way, the output won't be affected by whether the compiler thinks
10848   // char is signed or not.
10849   PrintTo(static_cast<unsigned char>(c), os);
10850 }
10851 
10852 // Overloads for other simple built-in types.
10853 inline void PrintTo(bool x, ::std::ostream* os) {
10854   *os << (x ? "true" : "false");
10855 }
10856 
10857 // Overload for wchar_t type.
10858 // Prints a wchar_t as a symbol if it is printable or as its internal
10859 // code otherwise and also as its decimal code (except for L'\0').
10860 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
10861 // as signed integer when wchar_t is implemented by the compiler
10862 // as a signed type and is printed as an unsigned integer when wchar_t
10863 // is implemented as an unsigned type.
10864 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
10865 
10866 // Overloads for C strings.
10867 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
10868 inline void PrintTo(char* s, ::std::ostream* os) {
10869   PrintTo(ImplicitCast_<const char*>(s), os);
10870 }
10871 
10872 // signed/unsigned char is often used for representing binary data, so
10873 // we print pointers to it as void* to be safe.
10874 inline void PrintTo(const signed char* s, ::std::ostream* os) {
10875   PrintTo(ImplicitCast_<const void*>(s), os);
10876 }
10877 inline void PrintTo(signed char* s, ::std::ostream* os) {
10878   PrintTo(ImplicitCast_<const void*>(s), os);
10879 }
10880 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
10881   PrintTo(ImplicitCast_<const void*>(s), os);
10882 }
10883 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
10884   PrintTo(ImplicitCast_<const void*>(s), os);
10885 }
10886 
10887 // MSVC can be configured to define wchar_t as a typedef of unsigned
10888 // short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
10889 // type.  When wchar_t is a typedef, defining an overload for const
10890 // wchar_t* would cause unsigned short* be printed as a wide string,
10891 // possibly causing invalid memory accesses.
10892 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
10893 // Overloads for wide C strings
10894 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
10895 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
10896   PrintTo(ImplicitCast_<const wchar_t*>(s), os);
10897 }
10898 #endif
10899 
10900 // Overload for C arrays.  Multi-dimensional arrays are printed
10901 // properly.
10902 
10903 // Prints the given number of elements in an array, without printing
10904 // the curly braces.
10905 template <typename T>
10906 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
10907   UniversalPrint(a[0], os);
10908   for (size_t i = 1; i != count; i++) {
10909     *os << ", ";
10910     UniversalPrint(a[i], os);
10911   }
10912 }
10913 
10914 // Overloads for ::string and ::std::string.
10915 #if GTEST_HAS_GLOBAL_STRING
10916 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
10917 inline void PrintTo(const ::string& s, ::std::ostream* os) {
10918   PrintStringTo(s, os);
10919 }
10920 #endif  // GTEST_HAS_GLOBAL_STRING
10921 
10922 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
10923 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
10924   PrintStringTo(s, os);
10925 }
10926 
10927 // Overloads for ::wstring and ::std::wstring.
10928 #if GTEST_HAS_GLOBAL_WSTRING
10929 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
10930 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
10931   PrintWideStringTo(s, os);
10932 }
10933 #endif  // GTEST_HAS_GLOBAL_WSTRING
10934 
10935 #if GTEST_HAS_STD_WSTRING
10936 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
10937 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
10938   PrintWideStringTo(s, os);
10939 }
10940 #endif  // GTEST_HAS_STD_WSTRING
10941 
10942 #if GTEST_HAS_ABSL
10943 // Overload for absl::string_view.
10944 inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
10945   PrintTo(::std::string(sp), os);
10946 }
10947 #endif  // GTEST_HAS_ABSL
10948 
10949 #if GTEST_LANG_CXX11
10950 inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
10951 #endif  // GTEST_LANG_CXX11
10952 
10953 #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10954 // Helper function for printing a tuple.  T must be instantiated with
10955 // a tuple type.
10956 template <typename T>
10957 void PrintTupleTo(const T& t, ::std::ostream* os);
10958 #endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10959 
10960 #if GTEST_HAS_TR1_TUPLE
10961 // Overload for ::std::tr1::tuple.  Needed for printing function arguments,
10962 // which are packed as tuples.
10963 
10964 // Overloaded PrintTo() for tuples of various arities.  We support
10965 // tuples of up-to 10 fields.  The following implementation works
10966 // regardless of whether tr1::tuple is implemented using the
10967 // non-standard variadic template feature or not.
10968 
10969 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
10970   PrintTupleTo(t, os);
10971 }
10972 
10973 template <typename T1>
10974 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
10975   PrintTupleTo(t, os);
10976 }
10977 
10978 template <typename T1, typename T2>
10979 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
10980   PrintTupleTo(t, os);
10981 }
10982 
10983 template <typename T1, typename T2, typename T3>
10984 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
10985   PrintTupleTo(t, os);
10986 }
10987 
10988 template <typename T1, typename T2, typename T3, typename T4>
10989 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
10990   PrintTupleTo(t, os);
10991 }
10992 
10993 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10994 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
10995              ::std::ostream* os) {
10996   PrintTupleTo(t, os);
10997 }
10998 
10999 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11000           typename T6>
11001 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
11002              ::std::ostream* os) {
11003   PrintTupleTo(t, os);
11004 }
11005 
11006 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11007           typename T6, typename T7>
11008 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
11009              ::std::ostream* os) {
11010   PrintTupleTo(t, os);
11011 }
11012 
11013 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11014           typename T6, typename T7, typename T8>
11015 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
11016              ::std::ostream* os) {
11017   PrintTupleTo(t, os);
11018 }
11019 
11020 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11021           typename T6, typename T7, typename T8, typename T9>
11022 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
11023              ::std::ostream* os) {
11024   PrintTupleTo(t, os);
11025 }
11026 
11027 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11028           typename T6, typename T7, typename T8, typename T9, typename T10>
11029 void PrintTo(
11030     const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
11031     ::std::ostream* os) {
11032   PrintTupleTo(t, os);
11033 }
11034 #endif  // GTEST_HAS_TR1_TUPLE
11035 
11036 #if GTEST_HAS_STD_TUPLE_
11037 template <typename... Types>
11038 void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
11039   PrintTupleTo(t, os);
11040 }
11041 #endif  // GTEST_HAS_STD_TUPLE_
11042 
11043 // Overload for std::pair.
11044 template <typename T1, typename T2>
11045 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
11046   *os << '(';
11047   // We cannot use UniversalPrint(value.first, os) here, as T1 may be
11048   // a reference type.  The same for printing value.second.
11049   UniversalPrinter<T1>::Print(value.first, os);
11050   *os << ", ";
11051   UniversalPrinter<T2>::Print(value.second, os);
11052   *os << ')';
11053 }
11054 
11055 // Implements printing a non-reference type T by letting the compiler
11056 // pick the right overload of PrintTo() for T.
11057 template <typename T>
11058 class UniversalPrinter {
11059  public:
11060   // MSVC warns about adding const to a function type, so we want to
11061   // disable the warning.
11062   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
11063 
11064   // Note: we deliberately don't call this PrintTo(), as that name
11065   // conflicts with ::testing::internal::PrintTo in the body of the
11066   // function.
11067   static void Print(const T& value, ::std::ostream* os) {
11068     // By default, ::testing::internal::PrintTo() is used for printing
11069     // the value.
11070     //
11071     // Thanks to Koenig look-up, if T is a class and has its own
11072     // PrintTo() function defined in its namespace, that function will
11073     // be visible here.  Since it is more specific than the generic ones
11074     // in ::testing::internal, it will be picked by the compiler in the
11075     // following statement - exactly what we want.
11076     PrintTo(value, os);
11077   }
11078 
11079   GTEST_DISABLE_MSC_WARNINGS_POP_()
11080 };
11081 
11082 #if GTEST_HAS_ABSL
11083 
11084 // Printer for absl::optional
11085 
11086 template <typename T>
11087 class UniversalPrinter<::absl::optional<T>> {
11088  public:
11089   static void Print(const ::absl::optional<T>& value, ::std::ostream* os) {
11090     *os << '(';
11091     if (!value) {
11092       *os << "nullopt";
11093     } else {
11094       UniversalPrint(*value, os);
11095     }
11096     *os << ')';
11097   }
11098 };
11099 
11100 // Printer for absl::variant
11101 
11102 template <typename... T>
11103 class UniversalPrinter<::absl::variant<T...>> {
11104  public:
11105   static void Print(const ::absl::variant<T...>& value, ::std::ostream* os) {
11106     *os << '(';
11107     absl::visit(Visitor{os}, value);
11108     *os << ')';
11109   }
11110 
11111  private:
11112   struct Visitor {
11113     template <typename U>
11114     void operator()(const U& u) const {
11115       *os << "'" << GetTypeName<U>() << "' with value ";
11116       UniversalPrint(u, os);
11117     }
11118     ::std::ostream* os;
11119   };
11120 };
11121 
11122 #endif  // GTEST_HAS_ABSL
11123 
11124 // UniversalPrintArray(begin, len, os) prints an array of 'len'
11125 // elements, starting at address 'begin'.
11126 template <typename T>
11127 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
11128   if (len == 0) {
11129     *os << "{}";
11130   } else {
11131     *os << "{ ";
11132     const size_t kThreshold = 18;
11133     const size_t kChunkSize = 8;
11134     // If the array has more than kThreshold elements, we'll have to
11135     // omit some details by printing only the first and the last
11136     // kChunkSize elements.
11137     // FIXME: let the user control the threshold using a flag.
11138     if (len <= kThreshold) {
11139       PrintRawArrayTo(begin, len, os);
11140     } else {
11141       PrintRawArrayTo(begin, kChunkSize, os);
11142       *os << ", ..., ";
11143       PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
11144     }
11145     *os << " }";
11146   }
11147 }
11148 // This overload prints a (const) char array compactly.
11149 GTEST_API_ void UniversalPrintArray(
11150     const char* begin, size_t len, ::std::ostream* os);
11151 
11152 // This overload prints a (const) wchar_t array compactly.
11153 GTEST_API_ void UniversalPrintArray(
11154     const wchar_t* begin, size_t len, ::std::ostream* os);
11155 
11156 // Implements printing an array type T[N].
11157 template <typename T, size_t N>
11158 class UniversalPrinter<T[N]> {
11159  public:
11160   // Prints the given array, omitting some elements when there are too
11161   // many.
11162   static void Print(const T (&a)[N], ::std::ostream* os) {
11163     UniversalPrintArray(a, N, os);
11164   }
11165 };
11166 
11167 // Implements printing a reference type T&.
11168 template <typename T>
11169 class UniversalPrinter<T&> {
11170  public:
11171   // MSVC warns about adding const to a function type, so we want to
11172   // disable the warning.
11173   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
11174 
11175   static void Print(const T& value, ::std::ostream* os) {
11176     // Prints the address of the value.  We use reinterpret_cast here
11177     // as static_cast doesn't compile when T is a function type.
11178     *os << "@" << reinterpret_cast<const void*>(&value) << " ";
11179 
11180     // Then prints the value itself.
11181     UniversalPrint(value, os);
11182   }
11183 
11184   GTEST_DISABLE_MSC_WARNINGS_POP_()
11185 };
11186 
11187 // Prints a value tersely: for a reference type, the referenced value
11188 // (but not the address) is printed; for a (const) char pointer, the
11189 // NUL-terminated string (but not the pointer) is printed.
11190 
11191 template <typename T>
11192 class UniversalTersePrinter {
11193  public:
11194   static void Print(const T& value, ::std::ostream* os) {
11195     UniversalPrint(value, os);
11196   }
11197 };
11198 template <typename T>
11199 class UniversalTersePrinter<T&> {
11200  public:
11201   static void Print(const T& value, ::std::ostream* os) {
11202     UniversalPrint(value, os);
11203   }
11204 };
11205 template <typename T, size_t N>
11206 class UniversalTersePrinter<T[N]> {
11207  public:
11208   static void Print(const T (&value)[N], ::std::ostream* os) {
11209     UniversalPrinter<T[N]>::Print(value, os);
11210   }
11211 };
11212 template <>
11213 class UniversalTersePrinter<const char*> {
11214  public:
11215   static void Print(const char* str, ::std::ostream* os) {
11216     if (str == NULL) {
11217       *os << "NULL";
11218     } else {
11219       UniversalPrint(std::string(str), os);
11220     }
11221   }
11222 };
11223 template <>
11224 class UniversalTersePrinter<char*> {
11225  public:
11226   static void Print(char* str, ::std::ostream* os) {
11227     UniversalTersePrinter<const char*>::Print(str, os);
11228   }
11229 };
11230 
11231 #if GTEST_HAS_STD_WSTRING
11232 template <>
11233 class UniversalTersePrinter<const wchar_t*> {
11234  public:
11235   static void Print(const wchar_t* str, ::std::ostream* os) {
11236     if (str == NULL) {
11237       *os << "NULL";
11238     } else {
11239       UniversalPrint(::std::wstring(str), os);
11240     }
11241   }
11242 };
11243 #endif
11244 
11245 template <>
11246 class UniversalTersePrinter<wchar_t*> {
11247  public:
11248   static void Print(wchar_t* str, ::std::ostream* os) {
11249     UniversalTersePrinter<const wchar_t*>::Print(str, os);
11250   }
11251 };
11252 
11253 template <typename T>
11254 void UniversalTersePrint(const T& value, ::std::ostream* os) {
11255   UniversalTersePrinter<T>::Print(value, os);
11256 }
11257 
11258 // Prints a value using the type inferred by the compiler.  The
11259 // difference between this and UniversalTersePrint() is that for a
11260 // (const) char pointer, this prints both the pointer and the
11261 // NUL-terminated string.
11262 template <typename T>
11263 void UniversalPrint(const T& value, ::std::ostream* os) {
11264   // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
11265   // UniversalPrinter with T directly.
11266   typedef T T1;
11267   UniversalPrinter<T1>::Print(value, os);
11268 }
11269 
11270 typedef ::std::vector< ::std::string> Strings;
11271 
11272 // TuplePolicy<TupleT> must provide:
11273 // - tuple_size
11274 //     size of tuple TupleT.
11275 // - get<size_t I>(const TupleT& t)
11276 //     static function extracting element I of tuple TupleT.
11277 // - tuple_element<size_t I>::type
11278 //     type of element I of tuple TupleT.
11279 template <typename TupleT>
11280 struct TuplePolicy;
11281 
11282 #if GTEST_HAS_TR1_TUPLE
11283 template <typename TupleT>
11284 struct TuplePolicy {
11285   typedef TupleT Tuple;
11286   static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
11287 
11288   template <size_t I>
11289   struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
11290   };
11291 
11292   template <size_t I>
11293   static typename AddReference<const typename ::std::tr1::tuple_element<
11294       static_cast<int>(I), Tuple>::type>::type
11295   get(const Tuple& tuple) {
11296     return ::std::tr1::get<I>(tuple);
11297   }
11298 };
11299 template <typename TupleT>
11300 const size_t TuplePolicy<TupleT>::tuple_size;
11301 #endif  // GTEST_HAS_TR1_TUPLE
11302 
11303 #if GTEST_HAS_STD_TUPLE_
11304 template <typename... Types>
11305 struct TuplePolicy< ::std::tuple<Types...> > {
11306   typedef ::std::tuple<Types...> Tuple;
11307   static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
11308 
11309   template <size_t I>
11310   struct tuple_element : ::std::tuple_element<I, Tuple> {};
11311 
11312   template <size_t I>
11313   static const typename ::std::tuple_element<I, Tuple>::type& get(
11314       const Tuple& tuple) {
11315     return ::std::get<I>(tuple);
11316   }
11317 };
11318 template <typename... Types>
11319 const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
11320 #endif  // GTEST_HAS_STD_TUPLE_
11321 
11322 #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
11323 // This helper template allows PrintTo() for tuples and
11324 // UniversalTersePrintTupleFieldsToStrings() to be defined by
11325 // induction on the number of tuple fields.  The idea is that
11326 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
11327 // fields in tuple t, and can be defined in terms of
11328 // TuplePrefixPrinter<N - 1>.
11329 //
11330 // The inductive case.
11331 template <size_t N>
11332 struct TuplePrefixPrinter {
11333   // Prints the first N fields of a tuple.
11334   template <typename Tuple>
11335   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
11336     TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
11337     GTEST_INTENTIONAL_CONST_COND_PUSH_()
11338     if (N > 1) {
11339     GTEST_INTENTIONAL_CONST_COND_POP_()
11340       *os << ", ";
11341     }
11342     UniversalPrinter<
11343         typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
11344         ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
11345   }
11346 
11347   // Tersely prints the first N fields of a tuple to a string vector,
11348   // one element for each field.
11349   template <typename Tuple>
11350   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
11351     TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
11352     ::std::stringstream ss;
11353     UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
11354     strings->push_back(ss.str());
11355   }
11356 };
11357 
11358 // Base case.
11359 template <>
11360 struct TuplePrefixPrinter<0> {
11361   template <typename Tuple>
11362   static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
11363 
11364   template <typename Tuple>
11365   static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
11366 };
11367 
11368 // Helper function for printing a tuple.
11369 // Tuple must be either std::tr1::tuple or std::tuple type.
11370 template <typename Tuple>
11371 void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
11372   *os << "(";
11373   TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
11374   *os << ")";
11375 }
11376 
11377 // Prints the fields of a tuple tersely to a string vector, one
11378 // element for each field.  See the comment before
11379 // UniversalTersePrint() for how we define "tersely".
11380 template <typename Tuple>
11381 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
11382   Strings result;
11383   TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
11384       TersePrintPrefixToStrings(value, &result);
11385   return result;
11386 }
11387 #endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
11388 
11389 }  // namespace internal
11390 
11391 #if GTEST_HAS_ABSL
11392 namespace internal2 {
11393 template <typename T>
11394 void TypeWithoutFormatter<T, kConvertibleToStringView>::PrintValue(
11395     const T& value, ::std::ostream* os) {
11396   internal::PrintTo(absl::string_view(value), os);
11397 }
11398 }  // namespace internal2
11399 #endif
11400 
11401 template <typename T>
11402 ::std::string PrintToString(const T& value) {
11403   ::std::stringstream ss;
11404   internal::UniversalTersePrinter<T>::Print(value, &ss);
11405   return ss.str();
11406 }
11407 
11408 }  // namespace testing
11409 
11410 // Include any custom printer added by the local installation.
11411 // We must include this header at the end to make sure it can use the
11412 // declarations from this file.
11413 // Copyright 2015, Google Inc.
11414 // All rights reserved.
11415 //
11416 // Redistribution and use in source and binary forms, with or without
11417 // modification, are permitted provided that the following conditions are
11418 // met:
11419 //
11420 //     * Redistributions of source code must retain the above copyright
11421 // notice, this list of conditions and the following disclaimer.
11422 //     * Redistributions in binary form must reproduce the above
11423 // copyright notice, this list of conditions and the following disclaimer
11424 // in the documentation and/or other materials provided with the
11425 // distribution.
11426 //     * Neither the name of Google Inc. nor the names of its
11427 // contributors may be used to endorse or promote products derived from
11428 // this software without specific prior written permission.
11429 //
11430 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
11431 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11432 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
11433 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
11434 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11435 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11436 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11437 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11438 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
11439 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11440 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11441 //
11442 // This file provides an injection point for custom printers in a local
11443 // installation of gTest.
11444 // It will be included from gtest-printers.h and the overrides in this file
11445 // will be visible to everyone.
11446 //
11447 // Injection point for custom user configurations. See README for details
11448 //
11449 // ** Custom implementation starts here **
11450 
11451 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11452 #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11453 
11454 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11455 
11456 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
11457 
11458 namespace testing {
11459 
11460 // Input to a parameterized test name generator, describing a test parameter.
11461 // Consists of the parameter value and the integer parameter index.
11462 template <class ParamType>
11463 struct TestParamInfo {
11464   TestParamInfo(const ParamType& a_param, size_t an_index) :
11465     param(a_param),
11466     index(an_index) {}
11467   ParamType param;
11468   size_t index;
11469 };
11470 
11471 // A builtin parameterized test name generator which returns the result of
11472 // testing::PrintToString.
11473 struct PrintToStringParamName {
11474   template <class ParamType>
11475   std::string operator()(const TestParamInfo<ParamType>& info) const {
11476     return PrintToString(info.param);
11477   }
11478 };
11479 
11480 namespace internal {
11481 
11482 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11483 //
11484 // Outputs a message explaining invalid registration of different
11485 // fixture class for the same test case. This may happen when
11486 // TEST_P macro is used to define two tests with the same name
11487 // but in different namespaces.
11488 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
11489                                           CodeLocation code_location);
11490 
11491 template <typename> class ParamGeneratorInterface;
11492 template <typename> class ParamGenerator;
11493 
11494 // Interface for iterating over elements provided by an implementation
11495 // of ParamGeneratorInterface<T>.
11496 template <typename T>
11497 class ParamIteratorInterface {
11498  public:
11499   virtual ~ParamIteratorInterface() {}
11500   // A pointer to the base generator instance.
11501   // Used only for the purposes of iterator comparison
11502   // to make sure that two iterators belong to the same generator.
11503   virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
11504   // Advances iterator to point to the next element
11505   // provided by the generator. The caller is responsible
11506   // for not calling Advance() on an iterator equal to
11507   // BaseGenerator()->End().
11508   virtual void Advance() = 0;
11509   // Clones the iterator object. Used for implementing copy semantics
11510   // of ParamIterator<T>.
11511   virtual ParamIteratorInterface* Clone() const = 0;
11512   // Dereferences the current iterator and provides (read-only) access
11513   // to the pointed value. It is the caller's responsibility not to call
11514   // Current() on an iterator equal to BaseGenerator()->End().
11515   // Used for implementing ParamGenerator<T>::operator*().
11516   virtual const T* Current() const = 0;
11517   // Determines whether the given iterator and other point to the same
11518   // element in the sequence generated by the generator.
11519   // Used for implementing ParamGenerator<T>::operator==().
11520   virtual bool Equals(const ParamIteratorInterface& other) const = 0;
11521 };
11522 
11523 // Class iterating over elements provided by an implementation of
11524 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
11525 // and implements the const forward iterator concept.
11526 template <typename T>
11527 class ParamIterator {
11528  public:
11529   typedef T value_type;
11530   typedef const T& reference;
11531   typedef ptrdiff_t difference_type;
11532 
11533   // ParamIterator assumes ownership of the impl_ pointer.
11534   ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
11535   ParamIterator& operator=(const ParamIterator& other) {
11536     if (this != &other)
11537       impl_.reset(other.impl_->Clone());
11538     return *this;
11539   }
11540 
11541   const T& operator*() const { return *impl_->Current(); }
11542   const T* operator->() const { return impl_->Current(); }
11543   // Prefix version of operator++.
11544   ParamIterator& operator++() {
11545     impl_->Advance();
11546     return *this;
11547   }
11548   // Postfix version of operator++.
11549   ParamIterator operator++(int /*unused*/) {
11550     ParamIteratorInterface<T>* clone = impl_->Clone();
11551     impl_->Advance();
11552     return ParamIterator(clone);
11553   }
11554   bool operator==(const ParamIterator& other) const {
11555     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
11556   }
11557   bool operator!=(const ParamIterator& other) const {
11558     return !(*this == other);
11559   }
11560 
11561  private:
11562   friend class ParamGenerator<T>;
11563   explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
11564   scoped_ptr<ParamIteratorInterface<T> > impl_;
11565 };
11566 
11567 // ParamGeneratorInterface<T> is the binary interface to access generators
11568 // defined in other translation units.
11569 template <typename T>
11570 class ParamGeneratorInterface {
11571  public:
11572   typedef T ParamType;
11573 
11574   virtual ~ParamGeneratorInterface() {}
11575 
11576   // Generator interface definition
11577   virtual ParamIteratorInterface<T>* Begin() const = 0;
11578   virtual ParamIteratorInterface<T>* End() const = 0;
11579 };
11580 
11581 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
11582 // compatible with the STL Container concept.
11583 // This class implements copy initialization semantics and the contained
11584 // ParamGeneratorInterface<T> instance is shared among all copies
11585 // of the original object. This is possible because that instance is immutable.
11586 template<typename T>
11587 class ParamGenerator {
11588  public:
11589   typedef ParamIterator<T> iterator;
11590 
11591   explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
11592   ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
11593 
11594   ParamGenerator& operator=(const ParamGenerator& other) {
11595     impl_ = other.impl_;
11596     return *this;
11597   }
11598 
11599   iterator begin() const { return iterator(impl_->Begin()); }
11600   iterator end() const { return iterator(impl_->End()); }
11601 
11602  private:
11603   linked_ptr<const ParamGeneratorInterface<T> > impl_;
11604 };
11605 
11606 // Generates values from a range of two comparable values. Can be used to
11607 // generate sequences of user-defined types that implement operator+() and
11608 // operator<().
11609 // This class is used in the Range() function.
11610 template <typename T, typename IncrementT>
11611 class RangeGenerator : public ParamGeneratorInterface<T> {
11612  public:
11613   RangeGenerator(T begin, T end, IncrementT step)
11614       : begin_(begin), end_(end),
11615         step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
11616   virtual ~RangeGenerator() {}
11617 
11618   virtual ParamIteratorInterface<T>* Begin() const {
11619     return new Iterator(this, begin_, 0, step_);
11620   }
11621   virtual ParamIteratorInterface<T>* End() const {
11622     return new Iterator(this, end_, end_index_, step_);
11623   }
11624 
11625  private:
11626   class Iterator : public ParamIteratorInterface<T> {
11627    public:
11628     Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
11629              IncrementT step)
11630         : base_(base), value_(value), index_(index), step_(step) {}
11631     virtual ~Iterator() {}
11632 
11633     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
11634       return base_;
11635     }
11636     virtual void Advance() {
11637       value_ = static_cast<T>(value_ + step_);
11638       index_++;
11639     }
11640     virtual ParamIteratorInterface<T>* Clone() const {
11641       return new Iterator(*this);
11642     }
11643     virtual const T* Current() const { return &value_; }
11644     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
11645       // Having the same base generator guarantees that the other
11646       // iterator is of the same type and we can downcast.
11647       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
11648           << "The program attempted to compare iterators "
11649           << "from different generators." << std::endl;
11650       const int other_index =
11651           CheckedDowncastToActualType<const Iterator>(&other)->index_;
11652       return index_ == other_index;
11653     }
11654 
11655    private:
11656     Iterator(const Iterator& other)
11657         : ParamIteratorInterface<T>(),
11658           base_(other.base_), value_(other.value_), index_(other.index_),
11659           step_(other.step_) {}
11660 
11661     // No implementation - assignment is unsupported.
11662     void operator=(const Iterator& other);
11663 
11664     const ParamGeneratorInterface<T>* const base_;
11665     T value_;
11666     int index_;
11667     const IncrementT step_;
11668   };  // class RangeGenerator::Iterator
11669 
11670   static int CalculateEndIndex(const T& begin,
11671                                const T& end,
11672                                const IncrementT& step) {
11673     int end_index = 0;
11674     for (T i = begin; i < end; i = static_cast<T>(i + step))
11675       end_index++;
11676     return end_index;
11677   }
11678 
11679   // No implementation - assignment is unsupported.
11680   void operator=(const RangeGenerator& other);
11681 
11682   const T begin_;
11683   const T end_;
11684   const IncrementT step_;
11685   // The index for the end() iterator. All the elements in the generated
11686   // sequence are indexed (0-based) to aid iterator comparison.
11687   const int end_index_;
11688 };  // class RangeGenerator
11689 
11690 
11691 // Generates values from a pair of STL-style iterators. Used in the
11692 // ValuesIn() function. The elements are copied from the source range
11693 // since the source can be located on the stack, and the generator
11694 // is likely to persist beyond that stack frame.
11695 template <typename T>
11696 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
11697  public:
11698   template <typename ForwardIterator>
11699   ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
11700       : container_(begin, end) {}
11701   virtual ~ValuesInIteratorRangeGenerator() {}
11702 
11703   virtual ParamIteratorInterface<T>* Begin() const {
11704     return new Iterator(this, container_.begin());
11705   }
11706   virtual ParamIteratorInterface<T>* End() const {
11707     return new Iterator(this, container_.end());
11708   }
11709 
11710  private:
11711   typedef typename ::std::vector<T> ContainerType;
11712 
11713   class Iterator : public ParamIteratorInterface<T> {
11714    public:
11715     Iterator(const ParamGeneratorInterface<T>* base,
11716              typename ContainerType::const_iterator iterator)
11717         : base_(base), iterator_(iterator) {}
11718     virtual ~Iterator() {}
11719 
11720     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
11721       return base_;
11722     }
11723     virtual void Advance() {
11724       ++iterator_;
11725       value_.reset();
11726     }
11727     virtual ParamIteratorInterface<T>* Clone() const {
11728       return new Iterator(*this);
11729     }
11730     // We need to use cached value referenced by iterator_ because *iterator_
11731     // can return a temporary object (and of type other then T), so just
11732     // having "return &*iterator_;" doesn't work.
11733     // value_ is updated here and not in Advance() because Advance()
11734     // can advance iterator_ beyond the end of the range, and we cannot
11735     // detect that fact. The client code, on the other hand, is
11736     // responsible for not calling Current() on an out-of-range iterator.
11737     virtual const T* Current() const {
11738       if (value_.get() == NULL)
11739         value_.reset(new T(*iterator_));
11740       return value_.get();
11741     }
11742     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
11743       // Having the same base generator guarantees that the other
11744       // iterator is of the same type and we can downcast.
11745       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
11746           << "The program attempted to compare iterators "
11747           << "from different generators." << std::endl;
11748       return iterator_ ==
11749           CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
11750     }
11751 
11752    private:
11753     Iterator(const Iterator& other)
11754           // The explicit constructor call suppresses a false warning
11755           // emitted by gcc when supplied with the -Wextra option.
11756         : ParamIteratorInterface<T>(),
11757           base_(other.base_),
11758           iterator_(other.iterator_) {}
11759 
11760     const ParamGeneratorInterface<T>* const base_;
11761     typename ContainerType::const_iterator iterator_;
11762     // A cached value of *iterator_. We keep it here to allow access by
11763     // pointer in the wrapping iterator's operator->().
11764     // value_ needs to be mutable to be accessed in Current().
11765     // Use of scoped_ptr helps manage cached value's lifetime,
11766     // which is bound by the lifespan of the iterator itself.
11767     mutable scoped_ptr<const T> value_;
11768   };  // class ValuesInIteratorRangeGenerator::Iterator
11769 
11770   // No implementation - assignment is unsupported.
11771   void operator=(const ValuesInIteratorRangeGenerator& other);
11772 
11773   const ContainerType container_;
11774 };  // class ValuesInIteratorRangeGenerator
11775 
11776 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11777 //
11778 // Default parameterized test name generator, returns a string containing the
11779 // integer test parameter index.
11780 template <class ParamType>
11781 std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
11782   Message name_stream;
11783   name_stream << info.index;
11784   return name_stream.GetString();
11785 }
11786 
11787 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11788 //
11789 // Parameterized test name overload helpers, which help the
11790 // INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
11791 // test name generator and user param name generator.
11792 template <class ParamType, class ParamNameGenFunctor>
11793 ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
11794   return func;
11795 }
11796 
11797 template <class ParamType>
11798 struct ParamNameGenFunc {
11799   typedef std::string Type(const TestParamInfo<ParamType>&);
11800 };
11801 
11802 template <class ParamType>
11803 typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
11804   return DefaultParamName;
11805 }
11806 
11807 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11808 //
11809 // Stores a parameter value and later creates tests parameterized with that
11810 // value.
11811 template <class TestClass>
11812 class ParameterizedTestFactory : public TestFactoryBase {
11813  public:
11814   typedef typename TestClass::ParamType ParamType;
11815   explicit ParameterizedTestFactory(ParamType parameter) :
11816       parameter_(parameter) {}
11817   virtual Test* CreateTest() {
11818     TestClass::SetParam(&parameter_);
11819     return new TestClass();
11820   }
11821 
11822  private:
11823   const ParamType parameter_;
11824 
11825   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
11826 };
11827 
11828 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11829 //
11830 // TestMetaFactoryBase is a base class for meta-factories that create
11831 // test factories for passing into MakeAndRegisterTestInfo function.
11832 template <class ParamType>
11833 class TestMetaFactoryBase {
11834  public:
11835   virtual ~TestMetaFactoryBase() {}
11836 
11837   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
11838 };
11839 
11840 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11841 //
11842 // TestMetaFactory creates test factories for passing into
11843 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
11844 // ownership of test factory pointer, same factory object cannot be passed
11845 // into that method twice. But ParameterizedTestCaseInfo is going to call
11846 // it for each Test/Parameter value combination. Thus it needs meta factory
11847 // creator class.
11848 template <class TestCase>
11849 class TestMetaFactory
11850     : public TestMetaFactoryBase<typename TestCase::ParamType> {
11851  public:
11852   typedef typename TestCase::ParamType ParamType;
11853 
11854   TestMetaFactory() {}
11855 
11856   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
11857     return new ParameterizedTestFactory<TestCase>(parameter);
11858   }
11859 
11860  private:
11861   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
11862 };
11863 
11864 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11865 //
11866 // ParameterizedTestCaseInfoBase is a generic interface
11867 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
11868 // accumulates test information provided by TEST_P macro invocations
11869 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
11870 // and uses that information to register all resulting test instances
11871 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
11872 // a collection of pointers to the ParameterizedTestCaseInfo objects
11873 // and calls RegisterTests() on each of them when asked.
11874 class ParameterizedTestCaseInfoBase {
11875  public:
11876   virtual ~ParameterizedTestCaseInfoBase() {}
11877 
11878   // Base part of test case name for display purposes.
11879   virtual const std::string& GetTestCaseName() const = 0;
11880   // Test case id to verify identity.
11881   virtual TypeId GetTestCaseTypeId() const = 0;
11882   // UnitTest class invokes this method to register tests in this
11883   // test case right before running them in RUN_ALL_TESTS macro.
11884   // This method should not be called more then once on any single
11885   // instance of a ParameterizedTestCaseInfoBase derived class.
11886   virtual void RegisterTests() = 0;
11887 
11888  protected:
11889   ParameterizedTestCaseInfoBase() {}
11890 
11891  private:
11892   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
11893 };
11894 
11895 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11896 //
11897 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
11898 // macro invocations for a particular test case and generators
11899 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
11900 // test case. It registers tests with all values generated by all
11901 // generators when asked.
11902 template <class TestCase>
11903 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
11904  public:
11905   // ParamType and GeneratorCreationFunc are private types but are required
11906   // for declarations of public methods AddTestPattern() and
11907   // AddTestCaseInstantiation().
11908   typedef typename TestCase::ParamType ParamType;
11909   // A function that returns an instance of appropriate generator type.
11910   typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
11911   typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
11912 
11913   explicit ParameterizedTestCaseInfo(
11914       const char* name, CodeLocation code_location)
11915       : test_case_name_(name), code_location_(code_location) {}
11916 
11917   // Test case base name for display purposes.
11918   virtual const std::string& GetTestCaseName() const { return test_case_name_; }
11919   // Test case id to verify identity.
11920   virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
11921   // TEST_P macro uses AddTestPattern() to record information
11922   // about a single test in a LocalTestInfo structure.
11923   // test_case_name is the base name of the test case (without invocation
11924   // prefix). test_base_name is the name of an individual test without
11925   // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
11926   // test case base name and DoBar is test base name.
11927   void AddTestPattern(const char* test_case_name,
11928                       const char* test_base_name,
11929                       TestMetaFactoryBase<ParamType>* meta_factory) {
11930     tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
11931                                                        test_base_name,
11932                                                        meta_factory)));
11933   }
11934   // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
11935   // about a generator.
11936   int AddTestCaseInstantiation(const std::string& instantiation_name,
11937                                GeneratorCreationFunc* func,
11938                                ParamNameGeneratorFunc* name_func,
11939                                const char* file, int line) {
11940     instantiations_.push_back(
11941         InstantiationInfo(instantiation_name, func, name_func, file, line));
11942     return 0;  // Return value used only to run this method in namespace scope.
11943   }
11944   // UnitTest class invokes this method to register tests in this test case
11945   // test cases right before running tests in RUN_ALL_TESTS macro.
11946   // This method should not be called more then once on any single
11947   // instance of a ParameterizedTestCaseInfoBase derived class.
11948   // UnitTest has a guard to prevent from calling this method more then once.
11949   virtual void RegisterTests() {
11950     for (typename TestInfoContainer::iterator test_it = tests_.begin();
11951          test_it != tests_.end(); ++test_it) {
11952       linked_ptr<TestInfo> test_info = *test_it;
11953       for (typename InstantiationContainer::iterator gen_it =
11954                instantiations_.begin(); gen_it != instantiations_.end();
11955                ++gen_it) {
11956         const std::string& instantiation_name = gen_it->name;
11957         ParamGenerator<ParamType> generator((*gen_it->generator)());
11958         ParamNameGeneratorFunc* name_func = gen_it->name_func;
11959         const char* file = gen_it->file;
11960         int line = gen_it->line;
11961 
11962         std::string test_case_name;
11963         if ( !instantiation_name.empty() )
11964           test_case_name = instantiation_name + "/";
11965         test_case_name += test_info->test_case_base_name;
11966 
11967         size_t i = 0;
11968         std::set<std::string> test_param_names;
11969         for (typename ParamGenerator<ParamType>::iterator param_it =
11970                  generator.begin();
11971              param_it != generator.end(); ++param_it, ++i) {
11972           Message test_name_stream;
11973 
11974           std::string param_name = name_func(
11975               TestParamInfo<ParamType>(*param_it, i));
11976 
11977           GTEST_CHECK_(IsValidParamName(param_name))
11978               << "Parameterized test name '" << param_name
11979               << "' is invalid, in " << file
11980               << " line " << line << std::endl;
11981 
11982           GTEST_CHECK_(test_param_names.count(param_name) == 0)
11983               << "Duplicate parameterized test name '" << param_name
11984               << "', in " << file << " line " << line << std::endl;
11985 
11986           test_param_names.insert(param_name);
11987 
11988           test_name_stream << test_info->test_base_name << "/" << param_name;
11989           MakeAndRegisterTestInfo(
11990               test_case_name.c_str(),
11991               test_name_stream.GetString().c_str(),
11992               NULL,  // No type parameter.
11993               PrintToString(*param_it).c_str(),
11994               code_location_,
11995               GetTestCaseTypeId(),
11996               TestCase::SetUpTestCase,
11997               TestCase::TearDownTestCase,
11998               test_info->test_meta_factory->CreateTestFactory(*param_it));
11999         }  // for param_it
12000       }  // for gen_it
12001     }  // for test_it
12002   }  // RegisterTests
12003 
12004  private:
12005   // LocalTestInfo structure keeps information about a single test registered
12006   // with TEST_P macro.
12007   struct TestInfo {
12008     TestInfo(const char* a_test_case_base_name,
12009              const char* a_test_base_name,
12010              TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
12011         test_case_base_name(a_test_case_base_name),
12012         test_base_name(a_test_base_name),
12013         test_meta_factory(a_test_meta_factory) {}
12014 
12015     const std::string test_case_base_name;
12016     const std::string test_base_name;
12017     const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
12018   };
12019   typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
12020   // Records data received from INSTANTIATE_TEST_CASE_P macros:
12021   //  <Instantiation name, Sequence generator creation function,
12022   //     Name generator function, Source file, Source line>
12023   struct InstantiationInfo {
12024       InstantiationInfo(const std::string &name_in,
12025                         GeneratorCreationFunc* generator_in,
12026                         ParamNameGeneratorFunc* name_func_in,
12027                         const char* file_in,
12028                         int line_in)
12029           : name(name_in),
12030             generator(generator_in),
12031             name_func(name_func_in),
12032             file(file_in),
12033             line(line_in) {}
12034 
12035       std::string name;
12036       GeneratorCreationFunc* generator;
12037       ParamNameGeneratorFunc* name_func;
12038       const char* file;
12039       int line;
12040   };
12041   typedef ::std::vector<InstantiationInfo> InstantiationContainer;
12042 
12043   static bool IsValidParamName(const std::string& name) {
12044     // Check for empty string
12045     if (name.empty())
12046       return false;
12047 
12048     // Check for invalid characters
12049     for (std::string::size_type index = 0; index < name.size(); ++index) {
12050       if (!isalnum(name[index]) && name[index] != '_')
12051         return false;
12052     }
12053 
12054     return true;
12055   }
12056 
12057   const std::string test_case_name_;
12058   CodeLocation code_location_;
12059   TestInfoContainer tests_;
12060   InstantiationContainer instantiations_;
12061 
12062   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
12063 };  // class ParameterizedTestCaseInfo
12064 
12065 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
12066 //
12067 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
12068 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
12069 // macros use it to locate their corresponding ParameterizedTestCaseInfo
12070 // descriptors.
12071 class ParameterizedTestCaseRegistry {
12072  public:
12073   ParameterizedTestCaseRegistry() {}
12074   ~ParameterizedTestCaseRegistry() {
12075     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
12076          it != test_case_infos_.end(); ++it) {
12077       delete *it;
12078     }
12079   }
12080 
12081   // Looks up or creates and returns a structure containing information about
12082   // tests and instantiations of a particular test case.
12083   template <class TestCase>
12084   ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
12085       const char* test_case_name,
12086       CodeLocation code_location) {
12087     ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
12088     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
12089          it != test_case_infos_.end(); ++it) {
12090       if ((*it)->GetTestCaseName() == test_case_name) {
12091         if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
12092           // Complain about incorrect usage of Google Test facilities
12093           // and terminate the program since we cannot guaranty correct
12094           // test case setup and tear-down in this case.
12095           ReportInvalidTestCaseType(test_case_name, code_location);
12096           posix::Abort();
12097         } else {
12098           // At this point we are sure that the object we found is of the same
12099           // type we are looking for, so we downcast it to that type
12100           // without further checks.
12101           typed_test_info = CheckedDowncastToActualType<
12102               ParameterizedTestCaseInfo<TestCase> >(*it);
12103         }
12104         break;
12105       }
12106     }
12107     if (typed_test_info == NULL) {
12108       typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
12109           test_case_name, code_location);
12110       test_case_infos_.push_back(typed_test_info);
12111     }
12112     return typed_test_info;
12113   }
12114   void RegisterTests() {
12115     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
12116          it != test_case_infos_.end(); ++it) {
12117       (*it)->RegisterTests();
12118     }
12119   }
12120 
12121  private:
12122   typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
12123 
12124   TestCaseInfoContainer test_case_infos_;
12125 
12126   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
12127 };
12128 
12129 }  // namespace internal
12130 }  // namespace testing
12131 
12132 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
12133 // This file was GENERATED by command:
12134 //     pump.py gtest-param-util-generated.h.pump
12135 // DO NOT EDIT BY HAND!!!
12136 
12137 // Copyright 2008 Google Inc.
12138 // All Rights Reserved.
12139 //
12140 // Redistribution and use in source and binary forms, with or without
12141 // modification, are permitted provided that the following conditions are
12142 // met:
12143 //
12144 //     * Redistributions of source code must retain the above copyright
12145 // notice, this list of conditions and the following disclaimer.
12146 //     * Redistributions in binary form must reproduce the above
12147 // copyright notice, this list of conditions and the following disclaimer
12148 // in the documentation and/or other materials provided with the
12149 // distribution.
12150 //     * Neither the name of Google Inc. nor the names of its
12151 // contributors may be used to endorse or promote products derived from
12152 // this software without specific prior written permission.
12153 //
12154 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12155 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
12156 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
12157 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
12158 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
12159 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
12160 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12161 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12162 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12163 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
12164 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12165 
12166 
12167 // Type and function utilities for implementing parameterized tests.
12168 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
12169 //
12170 // Currently Google Test supports at most 50 arguments in Values,
12171 // and at most 10 arguments in Combine. Please contact
12172 // googletestframework@googlegroups.com if you need more.
12173 // Please note that the number of arguments to Combine is limited
12174 // by the maximum arity of the implementation of tuple which is
12175 // currently set at 10.
12176 
12177 // GOOGLETEST_CM0001 DO NOT DELETE
12178 
12179 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
12180 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
12181 
12182 
12183 namespace testing {
12184 
12185 // Forward declarations of ValuesIn(), which is implemented in
12186 // include/gtest/gtest-param-test.h.
12187 template <typename ForwardIterator>
12188 internal::ParamGenerator<
12189   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
12190 ValuesIn(ForwardIterator begin, ForwardIterator end);
12191 
12192 template <typename T, size_t N>
12193 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
12194 
12195 template <class Container>
12196 internal::ParamGenerator<typename Container::value_type> ValuesIn(
12197     const Container& container);
12198 
12199 namespace internal {
12200 
12201 // Used in the Values() function to provide polymorphic capabilities.
12202 template <typename T1>
12203 class ValueArray1 {
12204  public:
12205   explicit ValueArray1(T1 v1) : v1_(v1) {}
12206 
12207   template <typename T>
12208   operator ParamGenerator<T>() const {
12209     const T array[] = {static_cast<T>(v1_)};
12210     return ValuesIn(array);
12211   }
12212 
12213   ValueArray1(const ValueArray1& other) : v1_(other.v1_) {}
12214 
12215  private:
12216   // No implementation - assignment is unsupported.
12217   void operator=(const ValueArray1& other);
12218 
12219   const T1 v1_;
12220 };
12221 
12222 template <typename T1, typename T2>
12223 class ValueArray2 {
12224  public:
12225   ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
12226 
12227   template <typename T>
12228   operator ParamGenerator<T>() const {
12229     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
12230     return ValuesIn(array);
12231   }
12232 
12233   ValueArray2(const ValueArray2& other) : v1_(other.v1_), v2_(other.v2_) {}
12234 
12235  private:
12236   // No implementation - assignment is unsupported.
12237   void operator=(const ValueArray2& other);
12238 
12239   const T1 v1_;
12240   const T2 v2_;
12241 };
12242 
12243 template <typename T1, typename T2, typename T3>
12244 class ValueArray3 {
12245  public:
12246   ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
12247 
12248   template <typename T>
12249   operator ParamGenerator<T>() const {
12250     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12251         static_cast<T>(v3_)};
12252     return ValuesIn(array);
12253   }
12254 
12255   ValueArray3(const ValueArray3& other) : v1_(other.v1_), v2_(other.v2_),
12256       v3_(other.v3_) {}
12257 
12258  private:
12259   // No implementation - assignment is unsupported.
12260   void operator=(const ValueArray3& other);
12261 
12262   const T1 v1_;
12263   const T2 v2_;
12264   const T3 v3_;
12265 };
12266 
12267 template <typename T1, typename T2, typename T3, typename T4>
12268 class ValueArray4 {
12269  public:
12270   ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
12271       v4_(v4) {}
12272 
12273   template <typename T>
12274   operator ParamGenerator<T>() const {
12275     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12276         static_cast<T>(v3_), static_cast<T>(v4_)};
12277     return ValuesIn(array);
12278   }
12279 
12280   ValueArray4(const ValueArray4& other) : v1_(other.v1_), v2_(other.v2_),
12281       v3_(other.v3_), v4_(other.v4_) {}
12282 
12283  private:
12284   // No implementation - assignment is unsupported.
12285   void operator=(const ValueArray4& other);
12286 
12287   const T1 v1_;
12288   const T2 v2_;
12289   const T3 v3_;
12290   const T4 v4_;
12291 };
12292 
12293 template <typename T1, typename T2, typename T3, typename T4, typename T5>
12294 class ValueArray5 {
12295  public:
12296   ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
12297       v4_(v4), v5_(v5) {}
12298 
12299   template <typename T>
12300   operator ParamGenerator<T>() const {
12301     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12302         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
12303     return ValuesIn(array);
12304   }
12305 
12306   ValueArray5(const ValueArray5& other) : v1_(other.v1_), v2_(other.v2_),
12307       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_) {}
12308 
12309  private:
12310   // No implementation - assignment is unsupported.
12311   void operator=(const ValueArray5& other);
12312 
12313   const T1 v1_;
12314   const T2 v2_;
12315   const T3 v3_;
12316   const T4 v4_;
12317   const T5 v5_;
12318 };
12319 
12320 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12321     typename T6>
12322 class ValueArray6 {
12323  public:
12324   ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
12325       v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
12326 
12327   template <typename T>
12328   operator ParamGenerator<T>() const {
12329     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12330         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12331         static_cast<T>(v6_)};
12332     return ValuesIn(array);
12333   }
12334 
12335   ValueArray6(const ValueArray6& other) : v1_(other.v1_), v2_(other.v2_),
12336       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_) {}
12337 
12338  private:
12339   // No implementation - assignment is unsupported.
12340   void operator=(const ValueArray6& other);
12341 
12342   const T1 v1_;
12343   const T2 v2_;
12344   const T3 v3_;
12345   const T4 v4_;
12346   const T5 v5_;
12347   const T6 v6_;
12348 };
12349 
12350 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12351     typename T6, typename T7>
12352 class ValueArray7 {
12353  public:
12354   ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
12355       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
12356 
12357   template <typename T>
12358   operator ParamGenerator<T>() const {
12359     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12360         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12361         static_cast<T>(v6_), static_cast<T>(v7_)};
12362     return ValuesIn(array);
12363   }
12364 
12365   ValueArray7(const ValueArray7& other) : v1_(other.v1_), v2_(other.v2_),
12366       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12367       v7_(other.v7_) {}
12368 
12369  private:
12370   // No implementation - assignment is unsupported.
12371   void operator=(const ValueArray7& other);
12372 
12373   const T1 v1_;
12374   const T2 v2_;
12375   const T3 v3_;
12376   const T4 v4_;
12377   const T5 v5_;
12378   const T6 v6_;
12379   const T7 v7_;
12380 };
12381 
12382 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12383     typename T6, typename T7, typename T8>
12384 class ValueArray8 {
12385  public:
12386   ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
12387       T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12388       v8_(v8) {}
12389 
12390   template <typename T>
12391   operator ParamGenerator<T>() const {
12392     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12393         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12394         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
12395     return ValuesIn(array);
12396   }
12397 
12398   ValueArray8(const ValueArray8& other) : v1_(other.v1_), v2_(other.v2_),
12399       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12400       v7_(other.v7_), v8_(other.v8_) {}
12401 
12402  private:
12403   // No implementation - assignment is unsupported.
12404   void operator=(const ValueArray8& other);
12405 
12406   const T1 v1_;
12407   const T2 v2_;
12408   const T3 v3_;
12409   const T4 v4_;
12410   const T5 v5_;
12411   const T6 v6_;
12412   const T7 v7_;
12413   const T8 v8_;
12414 };
12415 
12416 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12417     typename T6, typename T7, typename T8, typename T9>
12418 class ValueArray9 {
12419  public:
12420   ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
12421       T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12422       v8_(v8), v9_(v9) {}
12423 
12424   template <typename T>
12425   operator ParamGenerator<T>() const {
12426     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12427         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12428         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12429         static_cast<T>(v9_)};
12430     return ValuesIn(array);
12431   }
12432 
12433   ValueArray9(const ValueArray9& other) : v1_(other.v1_), v2_(other.v2_),
12434       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12435       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_) {}
12436 
12437  private:
12438   // No implementation - assignment is unsupported.
12439   void operator=(const ValueArray9& other);
12440 
12441   const T1 v1_;
12442   const T2 v2_;
12443   const T3 v3_;
12444   const T4 v4_;
12445   const T5 v5_;
12446   const T6 v6_;
12447   const T7 v7_;
12448   const T8 v8_;
12449   const T9 v9_;
12450 };
12451 
12452 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12453     typename T6, typename T7, typename T8, typename T9, typename T10>
12454 class ValueArray10 {
12455  public:
12456   ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12457       T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12458       v8_(v8), v9_(v9), v10_(v10) {}
12459 
12460   template <typename T>
12461   operator ParamGenerator<T>() const {
12462     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12463         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12464         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12465         static_cast<T>(v9_), static_cast<T>(v10_)};
12466     return ValuesIn(array);
12467   }
12468 
12469   ValueArray10(const ValueArray10& other) : v1_(other.v1_), v2_(other.v2_),
12470       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12471       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_) {}
12472 
12473  private:
12474   // No implementation - assignment is unsupported.
12475   void operator=(const ValueArray10& other);
12476 
12477   const T1 v1_;
12478   const T2 v2_;
12479   const T3 v3_;
12480   const T4 v4_;
12481   const T5 v5_;
12482   const T6 v6_;
12483   const T7 v7_;
12484   const T8 v8_;
12485   const T9 v9_;
12486   const T10 v10_;
12487 };
12488 
12489 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12490     typename T6, typename T7, typename T8, typename T9, typename T10,
12491     typename T11>
12492 class ValueArray11 {
12493  public:
12494   ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12495       T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12496       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
12497 
12498   template <typename T>
12499   operator ParamGenerator<T>() const {
12500     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12501         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12502         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12503         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
12504     return ValuesIn(array);
12505   }
12506 
12507   ValueArray11(const ValueArray11& other) : v1_(other.v1_), v2_(other.v2_),
12508       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12509       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12510       v11_(other.v11_) {}
12511 
12512  private:
12513   // No implementation - assignment is unsupported.
12514   void operator=(const ValueArray11& other);
12515 
12516   const T1 v1_;
12517   const T2 v2_;
12518   const T3 v3_;
12519   const T4 v4_;
12520   const T5 v5_;
12521   const T6 v6_;
12522   const T7 v7_;
12523   const T8 v8_;
12524   const T9 v9_;
12525   const T10 v10_;
12526   const T11 v11_;
12527 };
12528 
12529 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12530     typename T6, typename T7, typename T8, typename T9, typename T10,
12531     typename T11, typename T12>
12532 class ValueArray12 {
12533  public:
12534   ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12535       T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12536       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
12537 
12538   template <typename T>
12539   operator ParamGenerator<T>() const {
12540     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12541         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12542         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12543         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12544         static_cast<T>(v12_)};
12545     return ValuesIn(array);
12546   }
12547 
12548   ValueArray12(const ValueArray12& other) : v1_(other.v1_), v2_(other.v2_),
12549       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12550       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12551       v11_(other.v11_), v12_(other.v12_) {}
12552 
12553  private:
12554   // No implementation - assignment is unsupported.
12555   void operator=(const ValueArray12& other);
12556 
12557   const T1 v1_;
12558   const T2 v2_;
12559   const T3 v3_;
12560   const T4 v4_;
12561   const T5 v5_;
12562   const T6 v6_;
12563   const T7 v7_;
12564   const T8 v8_;
12565   const T9 v9_;
12566   const T10 v10_;
12567   const T11 v11_;
12568   const T12 v12_;
12569 };
12570 
12571 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12572     typename T6, typename T7, typename T8, typename T9, typename T10,
12573     typename T11, typename T12, typename T13>
12574 class ValueArray13 {
12575  public:
12576   ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12577       T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12578       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12579       v12_(v12), v13_(v13) {}
12580 
12581   template <typename T>
12582   operator ParamGenerator<T>() const {
12583     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12584         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12585         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12586         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12587         static_cast<T>(v12_), static_cast<T>(v13_)};
12588     return ValuesIn(array);
12589   }
12590 
12591   ValueArray13(const ValueArray13& other) : v1_(other.v1_), v2_(other.v2_),
12592       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12593       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12594       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_) {}
12595 
12596  private:
12597   // No implementation - assignment is unsupported.
12598   void operator=(const ValueArray13& other);
12599 
12600   const T1 v1_;
12601   const T2 v2_;
12602   const T3 v3_;
12603   const T4 v4_;
12604   const T5 v5_;
12605   const T6 v6_;
12606   const T7 v7_;
12607   const T8 v8_;
12608   const T9 v9_;
12609   const T10 v10_;
12610   const T11 v11_;
12611   const T12 v12_;
12612   const T13 v13_;
12613 };
12614 
12615 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12616     typename T6, typename T7, typename T8, typename T9, typename T10,
12617     typename T11, typename T12, typename T13, typename T14>
12618 class ValueArray14 {
12619  public:
12620   ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12621       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
12622       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12623       v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
12624 
12625   template <typename T>
12626   operator ParamGenerator<T>() const {
12627     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12628         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12629         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12630         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12631         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
12632     return ValuesIn(array);
12633   }
12634 
12635   ValueArray14(const ValueArray14& other) : v1_(other.v1_), v2_(other.v2_),
12636       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12637       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12638       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_) {}
12639 
12640  private:
12641   // No implementation - assignment is unsupported.
12642   void operator=(const ValueArray14& other);
12643 
12644   const T1 v1_;
12645   const T2 v2_;
12646   const T3 v3_;
12647   const T4 v4_;
12648   const T5 v5_;
12649   const T6 v6_;
12650   const T7 v7_;
12651   const T8 v8_;
12652   const T9 v9_;
12653   const T10 v10_;
12654   const T11 v11_;
12655   const T12 v12_;
12656   const T13 v13_;
12657   const T14 v14_;
12658 };
12659 
12660 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12661     typename T6, typename T7, typename T8, typename T9, typename T10,
12662     typename T11, typename T12, typename T13, typename T14, typename T15>
12663 class ValueArray15 {
12664  public:
12665   ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12666       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
12667       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12668       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
12669 
12670   template <typename T>
12671   operator ParamGenerator<T>() const {
12672     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12673         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12674         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12675         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12676         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12677         static_cast<T>(v15_)};
12678     return ValuesIn(array);
12679   }
12680 
12681   ValueArray15(const ValueArray15& other) : v1_(other.v1_), v2_(other.v2_),
12682       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12683       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12684       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12685       v15_(other.v15_) {}
12686 
12687  private:
12688   // No implementation - assignment is unsupported.
12689   void operator=(const ValueArray15& other);
12690 
12691   const T1 v1_;
12692   const T2 v2_;
12693   const T3 v3_;
12694   const T4 v4_;
12695   const T5 v5_;
12696   const T6 v6_;
12697   const T7 v7_;
12698   const T8 v8_;
12699   const T9 v9_;
12700   const T10 v10_;
12701   const T11 v11_;
12702   const T12 v12_;
12703   const T13 v13_;
12704   const T14 v14_;
12705   const T15 v15_;
12706 };
12707 
12708 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12709     typename T6, typename T7, typename T8, typename T9, typename T10,
12710     typename T11, typename T12, typename T13, typename T14, typename T15,
12711     typename T16>
12712 class ValueArray16 {
12713  public:
12714   ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12715       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
12716       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12717       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12718       v16_(v16) {}
12719 
12720   template <typename T>
12721   operator ParamGenerator<T>() const {
12722     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12723         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12724         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12725         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12726         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12727         static_cast<T>(v15_), static_cast<T>(v16_)};
12728     return ValuesIn(array);
12729   }
12730 
12731   ValueArray16(const ValueArray16& other) : v1_(other.v1_), v2_(other.v2_),
12732       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12733       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12734       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12735       v15_(other.v15_), v16_(other.v16_) {}
12736 
12737  private:
12738   // No implementation - assignment is unsupported.
12739   void operator=(const ValueArray16& other);
12740 
12741   const T1 v1_;
12742   const T2 v2_;
12743   const T3 v3_;
12744   const T4 v4_;
12745   const T5 v5_;
12746   const T6 v6_;
12747   const T7 v7_;
12748   const T8 v8_;
12749   const T9 v9_;
12750   const T10 v10_;
12751   const T11 v11_;
12752   const T12 v12_;
12753   const T13 v13_;
12754   const T14 v14_;
12755   const T15 v15_;
12756   const T16 v16_;
12757 };
12758 
12759 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12760     typename T6, typename T7, typename T8, typename T9, typename T10,
12761     typename T11, typename T12, typename T13, typename T14, typename T15,
12762     typename T16, typename T17>
12763 class ValueArray17 {
12764  public:
12765   ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12766       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
12767       T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12768       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12769       v15_(v15), v16_(v16), v17_(v17) {}
12770 
12771   template <typename T>
12772   operator ParamGenerator<T>() const {
12773     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12774         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12775         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12776         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12777         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12778         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
12779     return ValuesIn(array);
12780   }
12781 
12782   ValueArray17(const ValueArray17& other) : v1_(other.v1_), v2_(other.v2_),
12783       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12784       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12785       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12786       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_) {}
12787 
12788  private:
12789   // No implementation - assignment is unsupported.
12790   void operator=(const ValueArray17& other);
12791 
12792   const T1 v1_;
12793   const T2 v2_;
12794   const T3 v3_;
12795   const T4 v4_;
12796   const T5 v5_;
12797   const T6 v6_;
12798   const T7 v7_;
12799   const T8 v8_;
12800   const T9 v9_;
12801   const T10 v10_;
12802   const T11 v11_;
12803   const T12 v12_;
12804   const T13 v13_;
12805   const T14 v14_;
12806   const T15 v15_;
12807   const T16 v16_;
12808   const T17 v17_;
12809 };
12810 
12811 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12812     typename T6, typename T7, typename T8, typename T9, typename T10,
12813     typename T11, typename T12, typename T13, typename T14, typename T15,
12814     typename T16, typename T17, typename T18>
12815 class ValueArray18 {
12816  public:
12817   ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12818       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12819       T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12820       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12821       v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
12822 
12823   template <typename T>
12824   operator ParamGenerator<T>() const {
12825     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12826         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12827         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12828         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12829         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12830         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12831         static_cast<T>(v18_)};
12832     return ValuesIn(array);
12833   }
12834 
12835   ValueArray18(const ValueArray18& other) : v1_(other.v1_), v2_(other.v2_),
12836       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12837       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12838       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12839       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_) {}
12840 
12841  private:
12842   // No implementation - assignment is unsupported.
12843   void operator=(const ValueArray18& other);
12844 
12845   const T1 v1_;
12846   const T2 v2_;
12847   const T3 v3_;
12848   const T4 v4_;
12849   const T5 v5_;
12850   const T6 v6_;
12851   const T7 v7_;
12852   const T8 v8_;
12853   const T9 v9_;
12854   const T10 v10_;
12855   const T11 v11_;
12856   const T12 v12_;
12857   const T13 v13_;
12858   const T14 v14_;
12859   const T15 v15_;
12860   const T16 v16_;
12861   const T17 v17_;
12862   const T18 v18_;
12863 };
12864 
12865 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12866     typename T6, typename T7, typename T8, typename T9, typename T10,
12867     typename T11, typename T12, typename T13, typename T14, typename T15,
12868     typename T16, typename T17, typename T18, typename T19>
12869 class ValueArray19 {
12870  public:
12871   ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12872       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12873       T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12874       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12875       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
12876 
12877   template <typename T>
12878   operator ParamGenerator<T>() const {
12879     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12880         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12881         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12882         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12883         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12884         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12885         static_cast<T>(v18_), static_cast<T>(v19_)};
12886     return ValuesIn(array);
12887   }
12888 
12889   ValueArray19(const ValueArray19& other) : v1_(other.v1_), v2_(other.v2_),
12890       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12891       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12892       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12893       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
12894       v19_(other.v19_) {}
12895 
12896  private:
12897   // No implementation - assignment is unsupported.
12898   void operator=(const ValueArray19& other);
12899 
12900   const T1 v1_;
12901   const T2 v2_;
12902   const T3 v3_;
12903   const T4 v4_;
12904   const T5 v5_;
12905   const T6 v6_;
12906   const T7 v7_;
12907   const T8 v8_;
12908   const T9 v9_;
12909   const T10 v10_;
12910   const T11 v11_;
12911   const T12 v12_;
12912   const T13 v13_;
12913   const T14 v14_;
12914   const T15 v15_;
12915   const T16 v16_;
12916   const T17 v17_;
12917   const T18 v18_;
12918   const T19 v19_;
12919 };
12920 
12921 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12922     typename T6, typename T7, typename T8, typename T9, typename T10,
12923     typename T11, typename T12, typename T13, typename T14, typename T15,
12924     typename T16, typename T17, typename T18, typename T19, typename T20>
12925 class ValueArray20 {
12926  public:
12927   ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12928       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12929       T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12930       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12931       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12932       v19_(v19), v20_(v20) {}
12933 
12934   template <typename T>
12935   operator ParamGenerator<T>() const {
12936     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12937         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12938         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12939         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12940         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12941         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12942         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
12943     return ValuesIn(array);
12944   }
12945 
12946   ValueArray20(const ValueArray20& other) : v1_(other.v1_), v2_(other.v2_),
12947       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
12948       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
12949       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
12950       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
12951       v19_(other.v19_), v20_(other.v20_) {}
12952 
12953  private:
12954   // No implementation - assignment is unsupported.
12955   void operator=(const ValueArray20& other);
12956 
12957   const T1 v1_;
12958   const T2 v2_;
12959   const T3 v3_;
12960   const T4 v4_;
12961   const T5 v5_;
12962   const T6 v6_;
12963   const T7 v7_;
12964   const T8 v8_;
12965   const T9 v9_;
12966   const T10 v10_;
12967   const T11 v11_;
12968   const T12 v12_;
12969   const T13 v13_;
12970   const T14 v14_;
12971   const T15 v15_;
12972   const T16 v16_;
12973   const T17 v17_;
12974   const T18 v18_;
12975   const T19 v19_;
12976   const T20 v20_;
12977 };
12978 
12979 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12980     typename T6, typename T7, typename T8, typename T9, typename T10,
12981     typename T11, typename T12, typename T13, typename T14, typename T15,
12982     typename T16, typename T17, typename T18, typename T19, typename T20,
12983     typename T21>
12984 class ValueArray21 {
12985  public:
12986   ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12987       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12988       T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12989       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12990       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12991       v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
12992 
12993   template <typename T>
12994   operator ParamGenerator<T>() const {
12995     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12996         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12997         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12998         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12999         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13000         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13001         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13002         static_cast<T>(v21_)};
13003     return ValuesIn(array);
13004   }
13005 
13006   ValueArray21(const ValueArray21& other) : v1_(other.v1_), v2_(other.v2_),
13007       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13008       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13009       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13010       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13011       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_) {}
13012 
13013  private:
13014   // No implementation - assignment is unsupported.
13015   void operator=(const ValueArray21& other);
13016 
13017   const T1 v1_;
13018   const T2 v2_;
13019   const T3 v3_;
13020   const T4 v4_;
13021   const T5 v5_;
13022   const T6 v6_;
13023   const T7 v7_;
13024   const T8 v8_;
13025   const T9 v9_;
13026   const T10 v10_;
13027   const T11 v11_;
13028   const T12 v12_;
13029   const T13 v13_;
13030   const T14 v14_;
13031   const T15 v15_;
13032   const T16 v16_;
13033   const T17 v17_;
13034   const T18 v18_;
13035   const T19 v19_;
13036   const T20 v20_;
13037   const T21 v21_;
13038 };
13039 
13040 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13041     typename T6, typename T7, typename T8, typename T9, typename T10,
13042     typename T11, typename T12, typename T13, typename T14, typename T15,
13043     typename T16, typename T17, typename T18, typename T19, typename T20,
13044     typename T21, typename T22>
13045 class ValueArray22 {
13046  public:
13047   ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13048       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13049       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
13050       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13051       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13052       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
13053 
13054   template <typename T>
13055   operator ParamGenerator<T>() const {
13056     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13057         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13058         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13059         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13060         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13061         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13062         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13063         static_cast<T>(v21_), static_cast<T>(v22_)};
13064     return ValuesIn(array);
13065   }
13066 
13067   ValueArray22(const ValueArray22& other) : v1_(other.v1_), v2_(other.v2_),
13068       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13069       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13070       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13071       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13072       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_) {}
13073 
13074  private:
13075   // No implementation - assignment is unsupported.
13076   void operator=(const ValueArray22& other);
13077 
13078   const T1 v1_;
13079   const T2 v2_;
13080   const T3 v3_;
13081   const T4 v4_;
13082   const T5 v5_;
13083   const T6 v6_;
13084   const T7 v7_;
13085   const T8 v8_;
13086   const T9 v9_;
13087   const T10 v10_;
13088   const T11 v11_;
13089   const T12 v12_;
13090   const T13 v13_;
13091   const T14 v14_;
13092   const T15 v15_;
13093   const T16 v16_;
13094   const T17 v17_;
13095   const T18 v18_;
13096   const T19 v19_;
13097   const T20 v20_;
13098   const T21 v21_;
13099   const T22 v22_;
13100 };
13101 
13102 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13103     typename T6, typename T7, typename T8, typename T9, typename T10,
13104     typename T11, typename T12, typename T13, typename T14, typename T15,
13105     typename T16, typename T17, typename T18, typename T19, typename T20,
13106     typename T21, typename T22, typename T23>
13107 class ValueArray23 {
13108  public:
13109   ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13110       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13111       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
13112       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13113       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13114       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13115       v23_(v23) {}
13116 
13117   template <typename T>
13118   operator ParamGenerator<T>() const {
13119     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13120         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13121         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13122         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13123         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13124         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13125         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13126         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
13127     return ValuesIn(array);
13128   }
13129 
13130   ValueArray23(const ValueArray23& other) : v1_(other.v1_), v2_(other.v2_),
13131       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13132       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13133       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13134       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13135       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13136       v23_(other.v23_) {}
13137 
13138  private:
13139   // No implementation - assignment is unsupported.
13140   void operator=(const ValueArray23& other);
13141 
13142   const T1 v1_;
13143   const T2 v2_;
13144   const T3 v3_;
13145   const T4 v4_;
13146   const T5 v5_;
13147   const T6 v6_;
13148   const T7 v7_;
13149   const T8 v8_;
13150   const T9 v9_;
13151   const T10 v10_;
13152   const T11 v11_;
13153   const T12 v12_;
13154   const T13 v13_;
13155   const T14 v14_;
13156   const T15 v15_;
13157   const T16 v16_;
13158   const T17 v17_;
13159   const T18 v18_;
13160   const T19 v19_;
13161   const T20 v20_;
13162   const T21 v21_;
13163   const T22 v22_;
13164   const T23 v23_;
13165 };
13166 
13167 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13168     typename T6, typename T7, typename T8, typename T9, typename T10,
13169     typename T11, typename T12, typename T13, typename T14, typename T15,
13170     typename T16, typename T17, typename T18, typename T19, typename T20,
13171     typename T21, typename T22, typename T23, typename T24>
13172 class ValueArray24 {
13173  public:
13174   ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13175       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13176       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
13177       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13178       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13179       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13180       v22_(v22), v23_(v23), v24_(v24) {}
13181 
13182   template <typename T>
13183   operator ParamGenerator<T>() const {
13184     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13185         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13186         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13187         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13188         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13189         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13190         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13191         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13192         static_cast<T>(v24_)};
13193     return ValuesIn(array);
13194   }
13195 
13196   ValueArray24(const ValueArray24& other) : v1_(other.v1_), v2_(other.v2_),
13197       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13198       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13199       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13200       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13201       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13202       v23_(other.v23_), v24_(other.v24_) {}
13203 
13204  private:
13205   // No implementation - assignment is unsupported.
13206   void operator=(const ValueArray24& other);
13207 
13208   const T1 v1_;
13209   const T2 v2_;
13210   const T3 v3_;
13211   const T4 v4_;
13212   const T5 v5_;
13213   const T6 v6_;
13214   const T7 v7_;
13215   const T8 v8_;
13216   const T9 v9_;
13217   const T10 v10_;
13218   const T11 v11_;
13219   const T12 v12_;
13220   const T13 v13_;
13221   const T14 v14_;
13222   const T15 v15_;
13223   const T16 v16_;
13224   const T17 v17_;
13225   const T18 v18_;
13226   const T19 v19_;
13227   const T20 v20_;
13228   const T21 v21_;
13229   const T22 v22_;
13230   const T23 v23_;
13231   const T24 v24_;
13232 };
13233 
13234 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13235     typename T6, typename T7, typename T8, typename T9, typename T10,
13236     typename T11, typename T12, typename T13, typename T14, typename T15,
13237     typename T16, typename T17, typename T18, typename T19, typename T20,
13238     typename T21, typename T22, typename T23, typename T24, typename T25>
13239 class ValueArray25 {
13240  public:
13241   ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13242       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13243       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
13244       T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13245       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13246       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13247       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
13248 
13249   template <typename T>
13250   operator ParamGenerator<T>() const {
13251     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13252         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13253         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13254         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13255         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13256         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13257         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13258         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13259         static_cast<T>(v24_), static_cast<T>(v25_)};
13260     return ValuesIn(array);
13261   }
13262 
13263   ValueArray25(const ValueArray25& other) : v1_(other.v1_), v2_(other.v2_),
13264       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13265       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13266       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13267       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13268       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13269       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_) {}
13270 
13271  private:
13272   // No implementation - assignment is unsupported.
13273   void operator=(const ValueArray25& other);
13274 
13275   const T1 v1_;
13276   const T2 v2_;
13277   const T3 v3_;
13278   const T4 v4_;
13279   const T5 v5_;
13280   const T6 v6_;
13281   const T7 v7_;
13282   const T8 v8_;
13283   const T9 v9_;
13284   const T10 v10_;
13285   const T11 v11_;
13286   const T12 v12_;
13287   const T13 v13_;
13288   const T14 v14_;
13289   const T15 v15_;
13290   const T16 v16_;
13291   const T17 v17_;
13292   const T18 v18_;
13293   const T19 v19_;
13294   const T20 v20_;
13295   const T21 v21_;
13296   const T22 v22_;
13297   const T23 v23_;
13298   const T24 v24_;
13299   const T25 v25_;
13300 };
13301 
13302 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13303     typename T6, typename T7, typename T8, typename T9, typename T10,
13304     typename T11, typename T12, typename T13, typename T14, typename T15,
13305     typename T16, typename T17, typename T18, typename T19, typename T20,
13306     typename T21, typename T22, typename T23, typename T24, typename T25,
13307     typename T26>
13308 class ValueArray26 {
13309  public:
13310   ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13311       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13312       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13313       T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13314       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13315       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13316       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
13317 
13318   template <typename T>
13319   operator ParamGenerator<T>() const {
13320     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13321         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13322         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13323         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13324         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13325         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13326         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13327         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13328         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
13329     return ValuesIn(array);
13330   }
13331 
13332   ValueArray26(const ValueArray26& other) : v1_(other.v1_), v2_(other.v2_),
13333       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13334       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13335       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13336       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13337       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13338       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_) {}
13339 
13340  private:
13341   // No implementation - assignment is unsupported.
13342   void operator=(const ValueArray26& other);
13343 
13344   const T1 v1_;
13345   const T2 v2_;
13346   const T3 v3_;
13347   const T4 v4_;
13348   const T5 v5_;
13349   const T6 v6_;
13350   const T7 v7_;
13351   const T8 v8_;
13352   const T9 v9_;
13353   const T10 v10_;
13354   const T11 v11_;
13355   const T12 v12_;
13356   const T13 v13_;
13357   const T14 v14_;
13358   const T15 v15_;
13359   const T16 v16_;
13360   const T17 v17_;
13361   const T18 v18_;
13362   const T19 v19_;
13363   const T20 v20_;
13364   const T21 v21_;
13365   const T22 v22_;
13366   const T23 v23_;
13367   const T24 v24_;
13368   const T25 v25_;
13369   const T26 v26_;
13370 };
13371 
13372 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13373     typename T6, typename T7, typename T8, typename T9, typename T10,
13374     typename T11, typename T12, typename T13, typename T14, typename T15,
13375     typename T16, typename T17, typename T18, typename T19, typename T20,
13376     typename T21, typename T22, typename T23, typename T24, typename T25,
13377     typename T26, typename T27>
13378 class ValueArray27 {
13379  public:
13380   ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13381       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13382       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13383       T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
13384       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
13385       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
13386       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
13387       v26_(v26), v27_(v27) {}
13388 
13389   template <typename T>
13390   operator ParamGenerator<T>() const {
13391     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13392         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13393         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13394         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13395         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13396         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13397         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13398         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13399         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13400         static_cast<T>(v27_)};
13401     return ValuesIn(array);
13402   }
13403 
13404   ValueArray27(const ValueArray27& other) : v1_(other.v1_), v2_(other.v2_),
13405       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13406       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13407       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13408       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13409       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13410       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13411       v27_(other.v27_) {}
13412 
13413  private:
13414   // No implementation - assignment is unsupported.
13415   void operator=(const ValueArray27& other);
13416 
13417   const T1 v1_;
13418   const T2 v2_;
13419   const T3 v3_;
13420   const T4 v4_;
13421   const T5 v5_;
13422   const T6 v6_;
13423   const T7 v7_;
13424   const T8 v8_;
13425   const T9 v9_;
13426   const T10 v10_;
13427   const T11 v11_;
13428   const T12 v12_;
13429   const T13 v13_;
13430   const T14 v14_;
13431   const T15 v15_;
13432   const T16 v16_;
13433   const T17 v17_;
13434   const T18 v18_;
13435   const T19 v19_;
13436   const T20 v20_;
13437   const T21 v21_;
13438   const T22 v22_;
13439   const T23 v23_;
13440   const T24 v24_;
13441   const T25 v25_;
13442   const T26 v26_;
13443   const T27 v27_;
13444 };
13445 
13446 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13447     typename T6, typename T7, typename T8, typename T9, typename T10,
13448     typename T11, typename T12, typename T13, typename T14, typename T15,
13449     typename T16, typename T17, typename T18, typename T19, typename T20,
13450     typename T21, typename T22, typename T23, typename T24, typename T25,
13451     typename T26, typename T27, typename T28>
13452 class ValueArray28 {
13453  public:
13454   ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13455       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13456       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13457       T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13458       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13459       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13460       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13461       v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
13462 
13463   template <typename T>
13464   operator ParamGenerator<T>() const {
13465     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13466         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13467         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13468         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13469         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13470         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13471         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13472         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13473         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13474         static_cast<T>(v27_), static_cast<T>(v28_)};
13475     return ValuesIn(array);
13476   }
13477 
13478   ValueArray28(const ValueArray28& other) : v1_(other.v1_), v2_(other.v2_),
13479       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13480       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13481       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13482       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13483       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13484       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13485       v27_(other.v27_), v28_(other.v28_) {}
13486 
13487  private:
13488   // No implementation - assignment is unsupported.
13489   void operator=(const ValueArray28& other);
13490 
13491   const T1 v1_;
13492   const T2 v2_;
13493   const T3 v3_;
13494   const T4 v4_;
13495   const T5 v5_;
13496   const T6 v6_;
13497   const T7 v7_;
13498   const T8 v8_;
13499   const T9 v9_;
13500   const T10 v10_;
13501   const T11 v11_;
13502   const T12 v12_;
13503   const T13 v13_;
13504   const T14 v14_;
13505   const T15 v15_;
13506   const T16 v16_;
13507   const T17 v17_;
13508   const T18 v18_;
13509   const T19 v19_;
13510   const T20 v20_;
13511   const T21 v21_;
13512   const T22 v22_;
13513   const T23 v23_;
13514   const T24 v24_;
13515   const T25 v25_;
13516   const T26 v26_;
13517   const T27 v27_;
13518   const T28 v28_;
13519 };
13520 
13521 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13522     typename T6, typename T7, typename T8, typename T9, typename T10,
13523     typename T11, typename T12, typename T13, typename T14, typename T15,
13524     typename T16, typename T17, typename T18, typename T19, typename T20,
13525     typename T21, typename T22, typename T23, typename T24, typename T25,
13526     typename T26, typename T27, typename T28, typename T29>
13527 class ValueArray29 {
13528  public:
13529   ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13530       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13531       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13532       T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13533       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13534       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13535       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13536       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
13537 
13538   template <typename T>
13539   operator ParamGenerator<T>() const {
13540     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13541         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13542         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13543         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13544         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13545         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13546         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13547         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13548         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13549         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
13550     return ValuesIn(array);
13551   }
13552 
13553   ValueArray29(const ValueArray29& other) : v1_(other.v1_), v2_(other.v2_),
13554       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13555       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13556       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13557       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13558       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13559       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13560       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_) {}
13561 
13562  private:
13563   // No implementation - assignment is unsupported.
13564   void operator=(const ValueArray29& other);
13565 
13566   const T1 v1_;
13567   const T2 v2_;
13568   const T3 v3_;
13569   const T4 v4_;
13570   const T5 v5_;
13571   const T6 v6_;
13572   const T7 v7_;
13573   const T8 v8_;
13574   const T9 v9_;
13575   const T10 v10_;
13576   const T11 v11_;
13577   const T12 v12_;
13578   const T13 v13_;
13579   const T14 v14_;
13580   const T15 v15_;
13581   const T16 v16_;
13582   const T17 v17_;
13583   const T18 v18_;
13584   const T19 v19_;
13585   const T20 v20_;
13586   const T21 v21_;
13587   const T22 v22_;
13588   const T23 v23_;
13589   const T24 v24_;
13590   const T25 v25_;
13591   const T26 v26_;
13592   const T27 v27_;
13593   const T28 v28_;
13594   const T29 v29_;
13595 };
13596 
13597 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13598     typename T6, typename T7, typename T8, typename T9, typename T10,
13599     typename T11, typename T12, typename T13, typename T14, typename T15,
13600     typename T16, typename T17, typename T18, typename T19, typename T20,
13601     typename T21, typename T22, typename T23, typename T24, typename T25,
13602     typename T26, typename T27, typename T28, typename T29, typename T30>
13603 class ValueArray30 {
13604  public:
13605   ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13606       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13607       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13608       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
13609       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13610       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13611       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13612       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13613       v29_(v29), v30_(v30) {}
13614 
13615   template <typename T>
13616   operator ParamGenerator<T>() const {
13617     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13618         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13619         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13620         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13621         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13622         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13623         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13624         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13625         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13626         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13627         static_cast<T>(v30_)};
13628     return ValuesIn(array);
13629   }
13630 
13631   ValueArray30(const ValueArray30& other) : v1_(other.v1_), v2_(other.v2_),
13632       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13633       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13634       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13635       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13636       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13637       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13638       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_) {}
13639 
13640  private:
13641   // No implementation - assignment is unsupported.
13642   void operator=(const ValueArray30& other);
13643 
13644   const T1 v1_;
13645   const T2 v2_;
13646   const T3 v3_;
13647   const T4 v4_;
13648   const T5 v5_;
13649   const T6 v6_;
13650   const T7 v7_;
13651   const T8 v8_;
13652   const T9 v9_;
13653   const T10 v10_;
13654   const T11 v11_;
13655   const T12 v12_;
13656   const T13 v13_;
13657   const T14 v14_;
13658   const T15 v15_;
13659   const T16 v16_;
13660   const T17 v17_;
13661   const T18 v18_;
13662   const T19 v19_;
13663   const T20 v20_;
13664   const T21 v21_;
13665   const T22 v22_;
13666   const T23 v23_;
13667   const T24 v24_;
13668   const T25 v25_;
13669   const T26 v26_;
13670   const T27 v27_;
13671   const T28 v28_;
13672   const T29 v29_;
13673   const T30 v30_;
13674 };
13675 
13676 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13677     typename T6, typename T7, typename T8, typename T9, typename T10,
13678     typename T11, typename T12, typename T13, typename T14, typename T15,
13679     typename T16, typename T17, typename T18, typename T19, typename T20,
13680     typename T21, typename T22, typename T23, typename T24, typename T25,
13681     typename T26, typename T27, typename T28, typename T29, typename T30,
13682     typename T31>
13683 class ValueArray31 {
13684  public:
13685   ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13686       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13687       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13688       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
13689       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13690       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13691       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13692       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13693       v29_(v29), v30_(v30), v31_(v31) {}
13694 
13695   template <typename T>
13696   operator ParamGenerator<T>() const {
13697     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13698         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13699         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13700         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13701         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13702         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13703         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13704         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13705         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13706         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13707         static_cast<T>(v30_), static_cast<T>(v31_)};
13708     return ValuesIn(array);
13709   }
13710 
13711   ValueArray31(const ValueArray31& other) : v1_(other.v1_), v2_(other.v2_),
13712       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13713       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13714       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13715       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13716       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13717       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13718       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13719       v31_(other.v31_) {}
13720 
13721  private:
13722   // No implementation - assignment is unsupported.
13723   void operator=(const ValueArray31& other);
13724 
13725   const T1 v1_;
13726   const T2 v2_;
13727   const T3 v3_;
13728   const T4 v4_;
13729   const T5 v5_;
13730   const T6 v6_;
13731   const T7 v7_;
13732   const T8 v8_;
13733   const T9 v9_;
13734   const T10 v10_;
13735   const T11 v11_;
13736   const T12 v12_;
13737   const T13 v13_;
13738   const T14 v14_;
13739   const T15 v15_;
13740   const T16 v16_;
13741   const T17 v17_;
13742   const T18 v18_;
13743   const T19 v19_;
13744   const T20 v20_;
13745   const T21 v21_;
13746   const T22 v22_;
13747   const T23 v23_;
13748   const T24 v24_;
13749   const T25 v25_;
13750   const T26 v26_;
13751   const T27 v27_;
13752   const T28 v28_;
13753   const T29 v29_;
13754   const T30 v30_;
13755   const T31 v31_;
13756 };
13757 
13758 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13759     typename T6, typename T7, typename T8, typename T9, typename T10,
13760     typename T11, typename T12, typename T13, typename T14, typename T15,
13761     typename T16, typename T17, typename T18, typename T19, typename T20,
13762     typename T21, typename T22, typename T23, typename T24, typename T25,
13763     typename T26, typename T27, typename T28, typename T29, typename T30,
13764     typename T31, typename T32>
13765 class ValueArray32 {
13766  public:
13767   ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13768       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13769       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13770       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
13771       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13772       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13773       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13774       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13775       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
13776 
13777   template <typename T>
13778   operator ParamGenerator<T>() const {
13779     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13780         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13781         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13782         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13783         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13784         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13785         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13786         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13787         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13788         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13789         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
13790     return ValuesIn(array);
13791   }
13792 
13793   ValueArray32(const ValueArray32& other) : v1_(other.v1_), v2_(other.v2_),
13794       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13795       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13796       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13797       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13798       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13799       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13800       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13801       v31_(other.v31_), v32_(other.v32_) {}
13802 
13803  private:
13804   // No implementation - assignment is unsupported.
13805   void operator=(const ValueArray32& other);
13806 
13807   const T1 v1_;
13808   const T2 v2_;
13809   const T3 v3_;
13810   const T4 v4_;
13811   const T5 v5_;
13812   const T6 v6_;
13813   const T7 v7_;
13814   const T8 v8_;
13815   const T9 v9_;
13816   const T10 v10_;
13817   const T11 v11_;
13818   const T12 v12_;
13819   const T13 v13_;
13820   const T14 v14_;
13821   const T15 v15_;
13822   const T16 v16_;
13823   const T17 v17_;
13824   const T18 v18_;
13825   const T19 v19_;
13826   const T20 v20_;
13827   const T21 v21_;
13828   const T22 v22_;
13829   const T23 v23_;
13830   const T24 v24_;
13831   const T25 v25_;
13832   const T26 v26_;
13833   const T27 v27_;
13834   const T28 v28_;
13835   const T29 v29_;
13836   const T30 v30_;
13837   const T31 v31_;
13838   const T32 v32_;
13839 };
13840 
13841 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13842     typename T6, typename T7, typename T8, typename T9, typename T10,
13843     typename T11, typename T12, typename T13, typename T14, typename T15,
13844     typename T16, typename T17, typename T18, typename T19, typename T20,
13845     typename T21, typename T22, typename T23, typename T24, typename T25,
13846     typename T26, typename T27, typename T28, typename T29, typename T30,
13847     typename T31, typename T32, typename T33>
13848 class ValueArray33 {
13849  public:
13850   ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13851       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13852       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13853       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
13854       T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13855       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13856       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13857       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13858       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13859       v33_(v33) {}
13860 
13861   template <typename T>
13862   operator ParamGenerator<T>() const {
13863     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13864         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13865         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13866         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13867         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13868         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13869         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13870         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13871         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13872         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13873         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13874         static_cast<T>(v33_)};
13875     return ValuesIn(array);
13876   }
13877 
13878   ValueArray33(const ValueArray33& other) : v1_(other.v1_), v2_(other.v2_),
13879       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13880       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13881       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13882       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13883       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13884       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13885       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13886       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_) {}
13887 
13888  private:
13889   // No implementation - assignment is unsupported.
13890   void operator=(const ValueArray33& other);
13891 
13892   const T1 v1_;
13893   const T2 v2_;
13894   const T3 v3_;
13895   const T4 v4_;
13896   const T5 v5_;
13897   const T6 v6_;
13898   const T7 v7_;
13899   const T8 v8_;
13900   const T9 v9_;
13901   const T10 v10_;
13902   const T11 v11_;
13903   const T12 v12_;
13904   const T13 v13_;
13905   const T14 v14_;
13906   const T15 v15_;
13907   const T16 v16_;
13908   const T17 v17_;
13909   const T18 v18_;
13910   const T19 v19_;
13911   const T20 v20_;
13912   const T21 v21_;
13913   const T22 v22_;
13914   const T23 v23_;
13915   const T24 v24_;
13916   const T25 v25_;
13917   const T26 v26_;
13918   const T27 v27_;
13919   const T28 v28_;
13920   const T29 v29_;
13921   const T30 v30_;
13922   const T31 v31_;
13923   const T32 v32_;
13924   const T33 v33_;
13925 };
13926 
13927 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13928     typename T6, typename T7, typename T8, typename T9, typename T10,
13929     typename T11, typename T12, typename T13, typename T14, typename T15,
13930     typename T16, typename T17, typename T18, typename T19, typename T20,
13931     typename T21, typename T22, typename T23, typename T24, typename T25,
13932     typename T26, typename T27, typename T28, typename T29, typename T30,
13933     typename T31, typename T32, typename T33, typename T34>
13934 class ValueArray34 {
13935  public:
13936   ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13937       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13938       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13939       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13940       T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13941       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13942       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13943       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13944       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13945       v33_(v33), v34_(v34) {}
13946 
13947   template <typename T>
13948   operator ParamGenerator<T>() const {
13949     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13950         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13951         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13952         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13953         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13954         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13955         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13956         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13957         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13958         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13959         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13960         static_cast<T>(v33_), static_cast<T>(v34_)};
13961     return ValuesIn(array);
13962   }
13963 
13964   ValueArray34(const ValueArray34& other) : v1_(other.v1_), v2_(other.v2_),
13965       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
13966       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
13967       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
13968       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
13969       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
13970       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
13971       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
13972       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_) {}
13973 
13974  private:
13975   // No implementation - assignment is unsupported.
13976   void operator=(const ValueArray34& other);
13977 
13978   const T1 v1_;
13979   const T2 v2_;
13980   const T3 v3_;
13981   const T4 v4_;
13982   const T5 v5_;
13983   const T6 v6_;
13984   const T7 v7_;
13985   const T8 v8_;
13986   const T9 v9_;
13987   const T10 v10_;
13988   const T11 v11_;
13989   const T12 v12_;
13990   const T13 v13_;
13991   const T14 v14_;
13992   const T15 v15_;
13993   const T16 v16_;
13994   const T17 v17_;
13995   const T18 v18_;
13996   const T19 v19_;
13997   const T20 v20_;
13998   const T21 v21_;
13999   const T22 v22_;
14000   const T23 v23_;
14001   const T24 v24_;
14002   const T25 v25_;
14003   const T26 v26_;
14004   const T27 v27_;
14005   const T28 v28_;
14006   const T29 v29_;
14007   const T30 v30_;
14008   const T31 v31_;
14009   const T32 v32_;
14010   const T33 v33_;
14011   const T34 v34_;
14012 };
14013 
14014 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14015     typename T6, typename T7, typename T8, typename T9, typename T10,
14016     typename T11, typename T12, typename T13, typename T14, typename T15,
14017     typename T16, typename T17, typename T18, typename T19, typename T20,
14018     typename T21, typename T22, typename T23, typename T24, typename T25,
14019     typename T26, typename T27, typename T28, typename T29, typename T30,
14020     typename T31, typename T32, typename T33, typename T34, typename T35>
14021 class ValueArray35 {
14022  public:
14023   ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14024       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14025       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14026       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14027       T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
14028       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
14029       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
14030       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
14031       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
14032       v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
14033 
14034   template <typename T>
14035   operator ParamGenerator<T>() const {
14036     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14037         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14038         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14039         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14040         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14041         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14042         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14043         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14044         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14045         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14046         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14047         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
14048     return ValuesIn(array);
14049   }
14050 
14051   ValueArray35(const ValueArray35& other) : v1_(other.v1_), v2_(other.v2_),
14052       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14053       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14054       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14055       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14056       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14057       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14058       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14059       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14060       v35_(other.v35_) {}
14061 
14062  private:
14063   // No implementation - assignment is unsupported.
14064   void operator=(const ValueArray35& other);
14065 
14066   const T1 v1_;
14067   const T2 v2_;
14068   const T3 v3_;
14069   const T4 v4_;
14070   const T5 v5_;
14071   const T6 v6_;
14072   const T7 v7_;
14073   const T8 v8_;
14074   const T9 v9_;
14075   const T10 v10_;
14076   const T11 v11_;
14077   const T12 v12_;
14078   const T13 v13_;
14079   const T14 v14_;
14080   const T15 v15_;
14081   const T16 v16_;
14082   const T17 v17_;
14083   const T18 v18_;
14084   const T19 v19_;
14085   const T20 v20_;
14086   const T21 v21_;
14087   const T22 v22_;
14088   const T23 v23_;
14089   const T24 v24_;
14090   const T25 v25_;
14091   const T26 v26_;
14092   const T27 v27_;
14093   const T28 v28_;
14094   const T29 v29_;
14095   const T30 v30_;
14096   const T31 v31_;
14097   const T32 v32_;
14098   const T33 v33_;
14099   const T34 v34_;
14100   const T35 v35_;
14101 };
14102 
14103 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14104     typename T6, typename T7, typename T8, typename T9, typename T10,
14105     typename T11, typename T12, typename T13, typename T14, typename T15,
14106     typename T16, typename T17, typename T18, typename T19, typename T20,
14107     typename T21, typename T22, typename T23, typename T24, typename T25,
14108     typename T26, typename T27, typename T28, typename T29, typename T30,
14109     typename T31, typename T32, typename T33, typename T34, typename T35,
14110     typename T36>
14111 class ValueArray36 {
14112  public:
14113   ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14114       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14115       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14116       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14117       T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
14118       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
14119       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
14120       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
14121       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
14122       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
14123 
14124   template <typename T>
14125   operator ParamGenerator<T>() const {
14126     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14127         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14128         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14129         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14130         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14131         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14132         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14133         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14134         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14135         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14136         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14137         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14138         static_cast<T>(v36_)};
14139     return ValuesIn(array);
14140   }
14141 
14142   ValueArray36(const ValueArray36& other) : v1_(other.v1_), v2_(other.v2_),
14143       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14144       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14145       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14146       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14147       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14148       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14149       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14150       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14151       v35_(other.v35_), v36_(other.v36_) {}
14152 
14153  private:
14154   // No implementation - assignment is unsupported.
14155   void operator=(const ValueArray36& other);
14156 
14157   const T1 v1_;
14158   const T2 v2_;
14159   const T3 v3_;
14160   const T4 v4_;
14161   const T5 v5_;
14162   const T6 v6_;
14163   const T7 v7_;
14164   const T8 v8_;
14165   const T9 v9_;
14166   const T10 v10_;
14167   const T11 v11_;
14168   const T12 v12_;
14169   const T13 v13_;
14170   const T14 v14_;
14171   const T15 v15_;
14172   const T16 v16_;
14173   const T17 v17_;
14174   const T18 v18_;
14175   const T19 v19_;
14176   const T20 v20_;
14177   const T21 v21_;
14178   const T22 v22_;
14179   const T23 v23_;
14180   const T24 v24_;
14181   const T25 v25_;
14182   const T26 v26_;
14183   const T27 v27_;
14184   const T28 v28_;
14185   const T29 v29_;
14186   const T30 v30_;
14187   const T31 v31_;
14188   const T32 v32_;
14189   const T33 v33_;
14190   const T34 v34_;
14191   const T35 v35_;
14192   const T36 v36_;
14193 };
14194 
14195 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14196     typename T6, typename T7, typename T8, typename T9, typename T10,
14197     typename T11, typename T12, typename T13, typename T14, typename T15,
14198     typename T16, typename T17, typename T18, typename T19, typename T20,
14199     typename T21, typename T22, typename T23, typename T24, typename T25,
14200     typename T26, typename T27, typename T28, typename T29, typename T30,
14201     typename T31, typename T32, typename T33, typename T34, typename T35,
14202     typename T36, typename T37>
14203 class ValueArray37 {
14204  public:
14205   ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14206       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14207       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14208       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14209       T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
14210       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
14211       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
14212       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
14213       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
14214       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
14215       v36_(v36), v37_(v37) {}
14216 
14217   template <typename T>
14218   operator ParamGenerator<T>() const {
14219     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14220         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14221         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14222         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14223         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14224         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14225         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14226         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14227         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14228         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14229         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14230         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14231         static_cast<T>(v36_), static_cast<T>(v37_)};
14232     return ValuesIn(array);
14233   }
14234 
14235   ValueArray37(const ValueArray37& other) : v1_(other.v1_), v2_(other.v2_),
14236       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14237       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14238       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14239       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14240       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14241       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14242       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14243       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14244       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_) {}
14245 
14246  private:
14247   // No implementation - assignment is unsupported.
14248   void operator=(const ValueArray37& other);
14249 
14250   const T1 v1_;
14251   const T2 v2_;
14252   const T3 v3_;
14253   const T4 v4_;
14254   const T5 v5_;
14255   const T6 v6_;
14256   const T7 v7_;
14257   const T8 v8_;
14258   const T9 v9_;
14259   const T10 v10_;
14260   const T11 v11_;
14261   const T12 v12_;
14262   const T13 v13_;
14263   const T14 v14_;
14264   const T15 v15_;
14265   const T16 v16_;
14266   const T17 v17_;
14267   const T18 v18_;
14268   const T19 v19_;
14269   const T20 v20_;
14270   const T21 v21_;
14271   const T22 v22_;
14272   const T23 v23_;
14273   const T24 v24_;
14274   const T25 v25_;
14275   const T26 v26_;
14276   const T27 v27_;
14277   const T28 v28_;
14278   const T29 v29_;
14279   const T30 v30_;
14280   const T31 v31_;
14281   const T32 v32_;
14282   const T33 v33_;
14283   const T34 v34_;
14284   const T35 v35_;
14285   const T36 v36_;
14286   const T37 v37_;
14287 };
14288 
14289 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14290     typename T6, typename T7, typename T8, typename T9, typename T10,
14291     typename T11, typename T12, typename T13, typename T14, typename T15,
14292     typename T16, typename T17, typename T18, typename T19, typename T20,
14293     typename T21, typename T22, typename T23, typename T24, typename T25,
14294     typename T26, typename T27, typename T28, typename T29, typename T30,
14295     typename T31, typename T32, typename T33, typename T34, typename T35,
14296     typename T36, typename T37, typename T38>
14297 class ValueArray38 {
14298  public:
14299   ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14300       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14301       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14302       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14303       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
14304       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
14305       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
14306       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
14307       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
14308       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
14309       v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
14310 
14311   template <typename T>
14312   operator ParamGenerator<T>() const {
14313     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14314         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14315         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14316         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14317         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14318         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14319         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14320         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14321         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14322         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14323         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14324         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14325         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
14326     return ValuesIn(array);
14327   }
14328 
14329   ValueArray38(const ValueArray38& other) : v1_(other.v1_), v2_(other.v2_),
14330       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14331       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14332       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14333       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14334       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14335       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14336       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14337       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14338       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_) {}
14339 
14340  private:
14341   // No implementation - assignment is unsupported.
14342   void operator=(const ValueArray38& other);
14343 
14344   const T1 v1_;
14345   const T2 v2_;
14346   const T3 v3_;
14347   const T4 v4_;
14348   const T5 v5_;
14349   const T6 v6_;
14350   const T7 v7_;
14351   const T8 v8_;
14352   const T9 v9_;
14353   const T10 v10_;
14354   const T11 v11_;
14355   const T12 v12_;
14356   const T13 v13_;
14357   const T14 v14_;
14358   const T15 v15_;
14359   const T16 v16_;
14360   const T17 v17_;
14361   const T18 v18_;
14362   const T19 v19_;
14363   const T20 v20_;
14364   const T21 v21_;
14365   const T22 v22_;
14366   const T23 v23_;
14367   const T24 v24_;
14368   const T25 v25_;
14369   const T26 v26_;
14370   const T27 v27_;
14371   const T28 v28_;
14372   const T29 v29_;
14373   const T30 v30_;
14374   const T31 v31_;
14375   const T32 v32_;
14376   const T33 v33_;
14377   const T34 v34_;
14378   const T35 v35_;
14379   const T36 v36_;
14380   const T37 v37_;
14381   const T38 v38_;
14382 };
14383 
14384 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14385     typename T6, typename T7, typename T8, typename T9, typename T10,
14386     typename T11, typename T12, typename T13, typename T14, typename T15,
14387     typename T16, typename T17, typename T18, typename T19, typename T20,
14388     typename T21, typename T22, typename T23, typename T24, typename T25,
14389     typename T26, typename T27, typename T28, typename T29, typename T30,
14390     typename T31, typename T32, typename T33, typename T34, typename T35,
14391     typename T36, typename T37, typename T38, typename T39>
14392 class ValueArray39 {
14393  public:
14394   ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14395       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14396       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14397       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14398       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
14399       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
14400       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
14401       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
14402       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
14403       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
14404       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
14405 
14406   template <typename T>
14407   operator ParamGenerator<T>() const {
14408     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14409         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14410         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14411         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14412         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14413         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14414         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14415         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14416         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14417         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14418         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14419         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14420         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14421         static_cast<T>(v39_)};
14422     return ValuesIn(array);
14423   }
14424 
14425   ValueArray39(const ValueArray39& other) : v1_(other.v1_), v2_(other.v2_),
14426       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14427       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14428       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14429       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14430       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14431       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14432       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14433       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14434       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14435       v39_(other.v39_) {}
14436 
14437  private:
14438   // No implementation - assignment is unsupported.
14439   void operator=(const ValueArray39& other);
14440 
14441   const T1 v1_;
14442   const T2 v2_;
14443   const T3 v3_;
14444   const T4 v4_;
14445   const T5 v5_;
14446   const T6 v6_;
14447   const T7 v7_;
14448   const T8 v8_;
14449   const T9 v9_;
14450   const T10 v10_;
14451   const T11 v11_;
14452   const T12 v12_;
14453   const T13 v13_;
14454   const T14 v14_;
14455   const T15 v15_;
14456   const T16 v16_;
14457   const T17 v17_;
14458   const T18 v18_;
14459   const T19 v19_;
14460   const T20 v20_;
14461   const T21 v21_;
14462   const T22 v22_;
14463   const T23 v23_;
14464   const T24 v24_;
14465   const T25 v25_;
14466   const T26 v26_;
14467   const T27 v27_;
14468   const T28 v28_;
14469   const T29 v29_;
14470   const T30 v30_;
14471   const T31 v31_;
14472   const T32 v32_;
14473   const T33 v33_;
14474   const T34 v34_;
14475   const T35 v35_;
14476   const T36 v36_;
14477   const T37 v37_;
14478   const T38 v38_;
14479   const T39 v39_;
14480 };
14481 
14482 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14483     typename T6, typename T7, typename T8, typename T9, typename T10,
14484     typename T11, typename T12, typename T13, typename T14, typename T15,
14485     typename T16, typename T17, typename T18, typename T19, typename T20,
14486     typename T21, typename T22, typename T23, typename T24, typename T25,
14487     typename T26, typename T27, typename T28, typename T29, typename T30,
14488     typename T31, typename T32, typename T33, typename T34, typename T35,
14489     typename T36, typename T37, typename T38, typename T39, typename T40>
14490 class ValueArray40 {
14491  public:
14492   ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14493       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14494       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14495       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14496       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
14497       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
14498       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
14499       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
14500       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
14501       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
14502       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
14503       v40_(v40) {}
14504 
14505   template <typename T>
14506   operator ParamGenerator<T>() const {
14507     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14508         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14509         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14510         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14511         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14512         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14513         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14514         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14515         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14516         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14517         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14518         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14519         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14520         static_cast<T>(v39_), static_cast<T>(v40_)};
14521     return ValuesIn(array);
14522   }
14523 
14524   ValueArray40(const ValueArray40& other) : v1_(other.v1_), v2_(other.v2_),
14525       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14526       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14527       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14528       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14529       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14530       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14531       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14532       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14533       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14534       v39_(other.v39_), v40_(other.v40_) {}
14535 
14536  private:
14537   // No implementation - assignment is unsupported.
14538   void operator=(const ValueArray40& other);
14539 
14540   const T1 v1_;
14541   const T2 v2_;
14542   const T3 v3_;
14543   const T4 v4_;
14544   const T5 v5_;
14545   const T6 v6_;
14546   const T7 v7_;
14547   const T8 v8_;
14548   const T9 v9_;
14549   const T10 v10_;
14550   const T11 v11_;
14551   const T12 v12_;
14552   const T13 v13_;
14553   const T14 v14_;
14554   const T15 v15_;
14555   const T16 v16_;
14556   const T17 v17_;
14557   const T18 v18_;
14558   const T19 v19_;
14559   const T20 v20_;
14560   const T21 v21_;
14561   const T22 v22_;
14562   const T23 v23_;
14563   const T24 v24_;
14564   const T25 v25_;
14565   const T26 v26_;
14566   const T27 v27_;
14567   const T28 v28_;
14568   const T29 v29_;
14569   const T30 v30_;
14570   const T31 v31_;
14571   const T32 v32_;
14572   const T33 v33_;
14573   const T34 v34_;
14574   const T35 v35_;
14575   const T36 v36_;
14576   const T37 v37_;
14577   const T38 v38_;
14578   const T39 v39_;
14579   const T40 v40_;
14580 };
14581 
14582 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14583     typename T6, typename T7, typename T8, typename T9, typename T10,
14584     typename T11, typename T12, typename T13, typename T14, typename T15,
14585     typename T16, typename T17, typename T18, typename T19, typename T20,
14586     typename T21, typename T22, typename T23, typename T24, typename T25,
14587     typename T26, typename T27, typename T28, typename T29, typename T30,
14588     typename T31, typename T32, typename T33, typename T34, typename T35,
14589     typename T36, typename T37, typename T38, typename T39, typename T40,
14590     typename T41>
14591 class ValueArray41 {
14592  public:
14593   ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14594       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14595       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14596       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14597       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
14598       T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14599       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14600       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14601       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14602       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14603       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14604       v39_(v39), v40_(v40), v41_(v41) {}
14605 
14606   template <typename T>
14607   operator ParamGenerator<T>() const {
14608     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14609         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14610         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14611         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14612         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14613         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14614         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14615         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14616         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14617         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14618         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14619         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14620         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14621         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
14622     return ValuesIn(array);
14623   }
14624 
14625   ValueArray41(const ValueArray41& other) : v1_(other.v1_), v2_(other.v2_),
14626       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14627       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14628       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14629       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14630       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14631       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14632       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14633       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14634       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14635       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_) {}
14636 
14637  private:
14638   // No implementation - assignment is unsupported.
14639   void operator=(const ValueArray41& other);
14640 
14641   const T1 v1_;
14642   const T2 v2_;
14643   const T3 v3_;
14644   const T4 v4_;
14645   const T5 v5_;
14646   const T6 v6_;
14647   const T7 v7_;
14648   const T8 v8_;
14649   const T9 v9_;
14650   const T10 v10_;
14651   const T11 v11_;
14652   const T12 v12_;
14653   const T13 v13_;
14654   const T14 v14_;
14655   const T15 v15_;
14656   const T16 v16_;
14657   const T17 v17_;
14658   const T18 v18_;
14659   const T19 v19_;
14660   const T20 v20_;
14661   const T21 v21_;
14662   const T22 v22_;
14663   const T23 v23_;
14664   const T24 v24_;
14665   const T25 v25_;
14666   const T26 v26_;
14667   const T27 v27_;
14668   const T28 v28_;
14669   const T29 v29_;
14670   const T30 v30_;
14671   const T31 v31_;
14672   const T32 v32_;
14673   const T33 v33_;
14674   const T34 v34_;
14675   const T35 v35_;
14676   const T36 v36_;
14677   const T37 v37_;
14678   const T38 v38_;
14679   const T39 v39_;
14680   const T40 v40_;
14681   const T41 v41_;
14682 };
14683 
14684 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14685     typename T6, typename T7, typename T8, typename T9, typename T10,
14686     typename T11, typename T12, typename T13, typename T14, typename T15,
14687     typename T16, typename T17, typename T18, typename T19, typename T20,
14688     typename T21, typename T22, typename T23, typename T24, typename T25,
14689     typename T26, typename T27, typename T28, typename T29, typename T30,
14690     typename T31, typename T32, typename T33, typename T34, typename T35,
14691     typename T36, typename T37, typename T38, typename T39, typename T40,
14692     typename T41, typename T42>
14693 class ValueArray42 {
14694  public:
14695   ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14696       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14697       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14698       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14699       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14700       T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14701       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14702       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14703       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14704       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14705       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14706       v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
14707 
14708   template <typename T>
14709   operator ParamGenerator<T>() const {
14710     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14711         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14712         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14713         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14714         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14715         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14716         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14717         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14718         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14719         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14720         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14721         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14722         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14723         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14724         static_cast<T>(v42_)};
14725     return ValuesIn(array);
14726   }
14727 
14728   ValueArray42(const ValueArray42& other) : v1_(other.v1_), v2_(other.v2_),
14729       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14730       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14731       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14732       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14733       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14734       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14735       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14736       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14737       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14738       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_) {}
14739 
14740  private:
14741   // No implementation - assignment is unsupported.
14742   void operator=(const ValueArray42& other);
14743 
14744   const T1 v1_;
14745   const T2 v2_;
14746   const T3 v3_;
14747   const T4 v4_;
14748   const T5 v5_;
14749   const T6 v6_;
14750   const T7 v7_;
14751   const T8 v8_;
14752   const T9 v9_;
14753   const T10 v10_;
14754   const T11 v11_;
14755   const T12 v12_;
14756   const T13 v13_;
14757   const T14 v14_;
14758   const T15 v15_;
14759   const T16 v16_;
14760   const T17 v17_;
14761   const T18 v18_;
14762   const T19 v19_;
14763   const T20 v20_;
14764   const T21 v21_;
14765   const T22 v22_;
14766   const T23 v23_;
14767   const T24 v24_;
14768   const T25 v25_;
14769   const T26 v26_;
14770   const T27 v27_;
14771   const T28 v28_;
14772   const T29 v29_;
14773   const T30 v30_;
14774   const T31 v31_;
14775   const T32 v32_;
14776   const T33 v33_;
14777   const T34 v34_;
14778   const T35 v35_;
14779   const T36 v36_;
14780   const T37 v37_;
14781   const T38 v38_;
14782   const T39 v39_;
14783   const T40 v40_;
14784   const T41 v41_;
14785   const T42 v42_;
14786 };
14787 
14788 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14789     typename T6, typename T7, typename T8, typename T9, typename T10,
14790     typename T11, typename T12, typename T13, typename T14, typename T15,
14791     typename T16, typename T17, typename T18, typename T19, typename T20,
14792     typename T21, typename T22, typename T23, typename T24, typename T25,
14793     typename T26, typename T27, typename T28, typename T29, typename T30,
14794     typename T31, typename T32, typename T33, typename T34, typename T35,
14795     typename T36, typename T37, typename T38, typename T39, typename T40,
14796     typename T41, typename T42, typename T43>
14797 class ValueArray43 {
14798  public:
14799   ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14800       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14801       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14802       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14803       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14804       T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
14805       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
14806       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
14807       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
14808       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
14809       v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
14810       v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
14811 
14812   template <typename T>
14813   operator ParamGenerator<T>() const {
14814     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14815         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14816         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14817         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14818         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14819         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14820         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14821         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14822         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14823         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14824         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14825         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14826         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14827         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14828         static_cast<T>(v42_), static_cast<T>(v43_)};
14829     return ValuesIn(array);
14830   }
14831 
14832   ValueArray43(const ValueArray43& other) : v1_(other.v1_), v2_(other.v2_),
14833       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14834       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14835       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14836       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14837       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14838       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14839       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14840       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14841       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14842       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
14843       v43_(other.v43_) {}
14844 
14845  private:
14846   // No implementation - assignment is unsupported.
14847   void operator=(const ValueArray43& other);
14848 
14849   const T1 v1_;
14850   const T2 v2_;
14851   const T3 v3_;
14852   const T4 v4_;
14853   const T5 v5_;
14854   const T6 v6_;
14855   const T7 v7_;
14856   const T8 v8_;
14857   const T9 v9_;
14858   const T10 v10_;
14859   const T11 v11_;
14860   const T12 v12_;
14861   const T13 v13_;
14862   const T14 v14_;
14863   const T15 v15_;
14864   const T16 v16_;
14865   const T17 v17_;
14866   const T18 v18_;
14867   const T19 v19_;
14868   const T20 v20_;
14869   const T21 v21_;
14870   const T22 v22_;
14871   const T23 v23_;
14872   const T24 v24_;
14873   const T25 v25_;
14874   const T26 v26_;
14875   const T27 v27_;
14876   const T28 v28_;
14877   const T29 v29_;
14878   const T30 v30_;
14879   const T31 v31_;
14880   const T32 v32_;
14881   const T33 v33_;
14882   const T34 v34_;
14883   const T35 v35_;
14884   const T36 v36_;
14885   const T37 v37_;
14886   const T38 v38_;
14887   const T39 v39_;
14888   const T40 v40_;
14889   const T41 v41_;
14890   const T42 v42_;
14891   const T43 v43_;
14892 };
14893 
14894 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14895     typename T6, typename T7, typename T8, typename T9, typename T10,
14896     typename T11, typename T12, typename T13, typename T14, typename T15,
14897     typename T16, typename T17, typename T18, typename T19, typename T20,
14898     typename T21, typename T22, typename T23, typename T24, typename T25,
14899     typename T26, typename T27, typename T28, typename T29, typename T30,
14900     typename T31, typename T32, typename T33, typename T34, typename T35,
14901     typename T36, typename T37, typename T38, typename T39, typename T40,
14902     typename T41, typename T42, typename T43, typename T44>
14903 class ValueArray44 {
14904  public:
14905   ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14906       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14907       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14908       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14909       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14910       T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
14911       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
14912       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
14913       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
14914       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
14915       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
14916       v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
14917       v43_(v43), v44_(v44) {}
14918 
14919   template <typename T>
14920   operator ParamGenerator<T>() const {
14921     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14922         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14923         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14924         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14925         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14926         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14927         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14928         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14929         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14930         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14931         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14932         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14933         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14934         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14935         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
14936     return ValuesIn(array);
14937   }
14938 
14939   ValueArray44(const ValueArray44& other) : v1_(other.v1_), v2_(other.v2_),
14940       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
14941       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
14942       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
14943       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
14944       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
14945       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
14946       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
14947       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
14948       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
14949       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
14950       v43_(other.v43_), v44_(other.v44_) {}
14951 
14952  private:
14953   // No implementation - assignment is unsupported.
14954   void operator=(const ValueArray44& other);
14955 
14956   const T1 v1_;
14957   const T2 v2_;
14958   const T3 v3_;
14959   const T4 v4_;
14960   const T5 v5_;
14961   const T6 v6_;
14962   const T7 v7_;
14963   const T8 v8_;
14964   const T9 v9_;
14965   const T10 v10_;
14966   const T11 v11_;
14967   const T12 v12_;
14968   const T13 v13_;
14969   const T14 v14_;
14970   const T15 v15_;
14971   const T16 v16_;
14972   const T17 v17_;
14973   const T18 v18_;
14974   const T19 v19_;
14975   const T20 v20_;
14976   const T21 v21_;
14977   const T22 v22_;
14978   const T23 v23_;
14979   const T24 v24_;
14980   const T25 v25_;
14981   const T26 v26_;
14982   const T27 v27_;
14983   const T28 v28_;
14984   const T29 v29_;
14985   const T30 v30_;
14986   const T31 v31_;
14987   const T32 v32_;
14988   const T33 v33_;
14989   const T34 v34_;
14990   const T35 v35_;
14991   const T36 v36_;
14992   const T37 v37_;
14993   const T38 v38_;
14994   const T39 v39_;
14995   const T40 v40_;
14996   const T41 v41_;
14997   const T42 v42_;
14998   const T43 v43_;
14999   const T44 v44_;
15000 };
15001 
15002 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15003     typename T6, typename T7, typename T8, typename T9, typename T10,
15004     typename T11, typename T12, typename T13, typename T14, typename T15,
15005     typename T16, typename T17, typename T18, typename T19, typename T20,
15006     typename T21, typename T22, typename T23, typename T24, typename T25,
15007     typename T26, typename T27, typename T28, typename T29, typename T30,
15008     typename T31, typename T32, typename T33, typename T34, typename T35,
15009     typename T36, typename T37, typename T38, typename T39, typename T40,
15010     typename T41, typename T42, typename T43, typename T44, typename T45>
15011 class ValueArray45 {
15012  public:
15013   ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15014       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15015       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15016       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15017       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15018       T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
15019       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
15020       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
15021       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
15022       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
15023       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
15024       v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
15025       v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
15026 
15027   template <typename T>
15028   operator ParamGenerator<T>() const {
15029     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15030         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15031         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15032         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15033         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15034         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15035         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15036         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15037         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15038         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15039         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15040         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15041         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15042         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15043         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15044         static_cast<T>(v45_)};
15045     return ValuesIn(array);
15046   }
15047 
15048   ValueArray45(const ValueArray45& other) : v1_(other.v1_), v2_(other.v2_),
15049       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15050       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15051       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15052       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15053       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15054       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15055       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15056       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15057       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15058       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15059       v43_(other.v43_), v44_(other.v44_), v45_(other.v45_) {}
15060 
15061  private:
15062   // No implementation - assignment is unsupported.
15063   void operator=(const ValueArray45& other);
15064 
15065   const T1 v1_;
15066   const T2 v2_;
15067   const T3 v3_;
15068   const T4 v4_;
15069   const T5 v5_;
15070   const T6 v6_;
15071   const T7 v7_;
15072   const T8 v8_;
15073   const T9 v9_;
15074   const T10 v10_;
15075   const T11 v11_;
15076   const T12 v12_;
15077   const T13 v13_;
15078   const T14 v14_;
15079   const T15 v15_;
15080   const T16 v16_;
15081   const T17 v17_;
15082   const T18 v18_;
15083   const T19 v19_;
15084   const T20 v20_;
15085   const T21 v21_;
15086   const T22 v22_;
15087   const T23 v23_;
15088   const T24 v24_;
15089   const T25 v25_;
15090   const T26 v26_;
15091   const T27 v27_;
15092   const T28 v28_;
15093   const T29 v29_;
15094   const T30 v30_;
15095   const T31 v31_;
15096   const T32 v32_;
15097   const T33 v33_;
15098   const T34 v34_;
15099   const T35 v35_;
15100   const T36 v36_;
15101   const T37 v37_;
15102   const T38 v38_;
15103   const T39 v39_;
15104   const T40 v40_;
15105   const T41 v41_;
15106   const T42 v42_;
15107   const T43 v43_;
15108   const T44 v44_;
15109   const T45 v45_;
15110 };
15111 
15112 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15113     typename T6, typename T7, typename T8, typename T9, typename T10,
15114     typename T11, typename T12, typename T13, typename T14, typename T15,
15115     typename T16, typename T17, typename T18, typename T19, typename T20,
15116     typename T21, typename T22, typename T23, typename T24, typename T25,
15117     typename T26, typename T27, typename T28, typename T29, typename T30,
15118     typename T31, typename T32, typename T33, typename T34, typename T35,
15119     typename T36, typename T37, typename T38, typename T39, typename T40,
15120     typename T41, typename T42, typename T43, typename T44, typename T45,
15121     typename T46>
15122 class ValueArray46 {
15123  public:
15124   ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15125       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15126       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15127       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15128       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15129       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
15130       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
15131       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
15132       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
15133       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
15134       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
15135       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
15136       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
15137 
15138   template <typename T>
15139   operator ParamGenerator<T>() const {
15140     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15141         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15142         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15143         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15144         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15145         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15146         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15147         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15148         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15149         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15150         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15151         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15152         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15153         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15154         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15155         static_cast<T>(v45_), static_cast<T>(v46_)};
15156     return ValuesIn(array);
15157   }
15158 
15159   ValueArray46(const ValueArray46& other) : v1_(other.v1_), v2_(other.v2_),
15160       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15161       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15162       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15163       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15164       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15165       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15166       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15167       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15168       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15169       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15170       v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_) {}
15171 
15172  private:
15173   // No implementation - assignment is unsupported.
15174   void operator=(const ValueArray46& other);
15175 
15176   const T1 v1_;
15177   const T2 v2_;
15178   const T3 v3_;
15179   const T4 v4_;
15180   const T5 v5_;
15181   const T6 v6_;
15182   const T7 v7_;
15183   const T8 v8_;
15184   const T9 v9_;
15185   const T10 v10_;
15186   const T11 v11_;
15187   const T12 v12_;
15188   const T13 v13_;
15189   const T14 v14_;
15190   const T15 v15_;
15191   const T16 v16_;
15192   const T17 v17_;
15193   const T18 v18_;
15194   const T19 v19_;
15195   const T20 v20_;
15196   const T21 v21_;
15197   const T22 v22_;
15198   const T23 v23_;
15199   const T24 v24_;
15200   const T25 v25_;
15201   const T26 v26_;
15202   const T27 v27_;
15203   const T28 v28_;
15204   const T29 v29_;
15205   const T30 v30_;
15206   const T31 v31_;
15207   const T32 v32_;
15208   const T33 v33_;
15209   const T34 v34_;
15210   const T35 v35_;
15211   const T36 v36_;
15212   const T37 v37_;
15213   const T38 v38_;
15214   const T39 v39_;
15215   const T40 v40_;
15216   const T41 v41_;
15217   const T42 v42_;
15218   const T43 v43_;
15219   const T44 v44_;
15220   const T45 v45_;
15221   const T46 v46_;
15222 };
15223 
15224 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15225     typename T6, typename T7, typename T8, typename T9, typename T10,
15226     typename T11, typename T12, typename T13, typename T14, typename T15,
15227     typename T16, typename T17, typename T18, typename T19, typename T20,
15228     typename T21, typename T22, typename T23, typename T24, typename T25,
15229     typename T26, typename T27, typename T28, typename T29, typename T30,
15230     typename T31, typename T32, typename T33, typename T34, typename T35,
15231     typename T36, typename T37, typename T38, typename T39, typename T40,
15232     typename T41, typename T42, typename T43, typename T44, typename T45,
15233     typename T46, typename T47>
15234 class ValueArray47 {
15235  public:
15236   ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15237       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15238       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15239       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15240       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15241       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
15242       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
15243       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
15244       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
15245       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
15246       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
15247       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
15248       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
15249       v47_(v47) {}
15250 
15251   template <typename T>
15252   operator ParamGenerator<T>() const {
15253     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15254         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15255         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15256         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15257         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15258         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15259         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15260         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15261         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15262         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15263         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15264         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15265         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15266         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15267         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15268         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
15269     return ValuesIn(array);
15270   }
15271 
15272   ValueArray47(const ValueArray47& other) : v1_(other.v1_), v2_(other.v2_),
15273       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15274       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15275       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15276       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15277       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15278       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15279       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15280       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15281       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15282       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15283       v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15284       v47_(other.v47_) {}
15285 
15286  private:
15287   // No implementation - assignment is unsupported.
15288   void operator=(const ValueArray47& other);
15289 
15290   const T1 v1_;
15291   const T2 v2_;
15292   const T3 v3_;
15293   const T4 v4_;
15294   const T5 v5_;
15295   const T6 v6_;
15296   const T7 v7_;
15297   const T8 v8_;
15298   const T9 v9_;
15299   const T10 v10_;
15300   const T11 v11_;
15301   const T12 v12_;
15302   const T13 v13_;
15303   const T14 v14_;
15304   const T15 v15_;
15305   const T16 v16_;
15306   const T17 v17_;
15307   const T18 v18_;
15308   const T19 v19_;
15309   const T20 v20_;
15310   const T21 v21_;
15311   const T22 v22_;
15312   const T23 v23_;
15313   const T24 v24_;
15314   const T25 v25_;
15315   const T26 v26_;
15316   const T27 v27_;
15317   const T28 v28_;
15318   const T29 v29_;
15319   const T30 v30_;
15320   const T31 v31_;
15321   const T32 v32_;
15322   const T33 v33_;
15323   const T34 v34_;
15324   const T35 v35_;
15325   const T36 v36_;
15326   const T37 v37_;
15327   const T38 v38_;
15328   const T39 v39_;
15329   const T40 v40_;
15330   const T41 v41_;
15331   const T42 v42_;
15332   const T43 v43_;
15333   const T44 v44_;
15334   const T45 v45_;
15335   const T46 v46_;
15336   const T47 v47_;
15337 };
15338 
15339 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15340     typename T6, typename T7, typename T8, typename T9, typename T10,
15341     typename T11, typename T12, typename T13, typename T14, typename T15,
15342     typename T16, typename T17, typename T18, typename T19, typename T20,
15343     typename T21, typename T22, typename T23, typename T24, typename T25,
15344     typename T26, typename T27, typename T28, typename T29, typename T30,
15345     typename T31, typename T32, typename T33, typename T34, typename T35,
15346     typename T36, typename T37, typename T38, typename T39, typename T40,
15347     typename T41, typename T42, typename T43, typename T44, typename T45,
15348     typename T46, typename T47, typename T48>
15349 class ValueArray48 {
15350  public:
15351   ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15352       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15353       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15354       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15355       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15356       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
15357       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
15358       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
15359       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
15360       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
15361       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
15362       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
15363       v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
15364       v46_(v46), v47_(v47), v48_(v48) {}
15365 
15366   template <typename T>
15367   operator ParamGenerator<T>() const {
15368     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15369         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15370         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15371         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15372         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15373         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15374         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15375         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15376         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15377         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15378         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15379         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15380         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15381         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15382         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15383         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
15384         static_cast<T>(v48_)};
15385     return ValuesIn(array);
15386   }
15387 
15388   ValueArray48(const ValueArray48& other) : v1_(other.v1_), v2_(other.v2_),
15389       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15390       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15391       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15392       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15393       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15394       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15395       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15396       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15397       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15398       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15399       v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15400       v47_(other.v47_), v48_(other.v48_) {}
15401 
15402  private:
15403   // No implementation - assignment is unsupported.
15404   void operator=(const ValueArray48& other);
15405 
15406   const T1 v1_;
15407   const T2 v2_;
15408   const T3 v3_;
15409   const T4 v4_;
15410   const T5 v5_;
15411   const T6 v6_;
15412   const T7 v7_;
15413   const T8 v8_;
15414   const T9 v9_;
15415   const T10 v10_;
15416   const T11 v11_;
15417   const T12 v12_;
15418   const T13 v13_;
15419   const T14 v14_;
15420   const T15 v15_;
15421   const T16 v16_;
15422   const T17 v17_;
15423   const T18 v18_;
15424   const T19 v19_;
15425   const T20 v20_;
15426   const T21 v21_;
15427   const T22 v22_;
15428   const T23 v23_;
15429   const T24 v24_;
15430   const T25 v25_;
15431   const T26 v26_;
15432   const T27 v27_;
15433   const T28 v28_;
15434   const T29 v29_;
15435   const T30 v30_;
15436   const T31 v31_;
15437   const T32 v32_;
15438   const T33 v33_;
15439   const T34 v34_;
15440   const T35 v35_;
15441   const T36 v36_;
15442   const T37 v37_;
15443   const T38 v38_;
15444   const T39 v39_;
15445   const T40 v40_;
15446   const T41 v41_;
15447   const T42 v42_;
15448   const T43 v43_;
15449   const T44 v44_;
15450   const T45 v45_;
15451   const T46 v46_;
15452   const T47 v47_;
15453   const T48 v48_;
15454 };
15455 
15456 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15457     typename T6, typename T7, typename T8, typename T9, typename T10,
15458     typename T11, typename T12, typename T13, typename T14, typename T15,
15459     typename T16, typename T17, typename T18, typename T19, typename T20,
15460     typename T21, typename T22, typename T23, typename T24, typename T25,
15461     typename T26, typename T27, typename T28, typename T29, typename T30,
15462     typename T31, typename T32, typename T33, typename T34, typename T35,
15463     typename T36, typename T37, typename T38, typename T39, typename T40,
15464     typename T41, typename T42, typename T43, typename T44, typename T45,
15465     typename T46, typename T47, typename T48, typename T49>
15466 class ValueArray49 {
15467  public:
15468   ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15469       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15470       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15471       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15472       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15473       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
15474       T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
15475       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
15476       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
15477       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
15478       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
15479       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
15480       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
15481       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
15482 
15483   template <typename T>
15484   operator ParamGenerator<T>() const {
15485     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15486         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15487         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15488         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15489         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15490         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15491         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15492         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15493         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15494         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15495         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15496         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15497         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15498         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15499         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15500         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
15501         static_cast<T>(v48_), static_cast<T>(v49_)};
15502     return ValuesIn(array);
15503   }
15504 
15505   ValueArray49(const ValueArray49& other) : v1_(other.v1_), v2_(other.v2_),
15506       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15507       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15508       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15509       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15510       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15511       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15512       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15513       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15514       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15515       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15516       v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15517       v47_(other.v47_), v48_(other.v48_), v49_(other.v49_) {}
15518 
15519  private:
15520   // No implementation - assignment is unsupported.
15521   void operator=(const ValueArray49& other);
15522 
15523   const T1 v1_;
15524   const T2 v2_;
15525   const T3 v3_;
15526   const T4 v4_;
15527   const T5 v5_;
15528   const T6 v6_;
15529   const T7 v7_;
15530   const T8 v8_;
15531   const T9 v9_;
15532   const T10 v10_;
15533   const T11 v11_;
15534   const T12 v12_;
15535   const T13 v13_;
15536   const T14 v14_;
15537   const T15 v15_;
15538   const T16 v16_;
15539   const T17 v17_;
15540   const T18 v18_;
15541   const T19 v19_;
15542   const T20 v20_;
15543   const T21 v21_;
15544   const T22 v22_;
15545   const T23 v23_;
15546   const T24 v24_;
15547   const T25 v25_;
15548   const T26 v26_;
15549   const T27 v27_;
15550   const T28 v28_;
15551   const T29 v29_;
15552   const T30 v30_;
15553   const T31 v31_;
15554   const T32 v32_;
15555   const T33 v33_;
15556   const T34 v34_;
15557   const T35 v35_;
15558   const T36 v36_;
15559   const T37 v37_;
15560   const T38 v38_;
15561   const T39 v39_;
15562   const T40 v40_;
15563   const T41 v41_;
15564   const T42 v42_;
15565   const T43 v43_;
15566   const T44 v44_;
15567   const T45 v45_;
15568   const T46 v46_;
15569   const T47 v47_;
15570   const T48 v48_;
15571   const T49 v49_;
15572 };
15573 
15574 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15575     typename T6, typename T7, typename T8, typename T9, typename T10,
15576     typename T11, typename T12, typename T13, typename T14, typename T15,
15577     typename T16, typename T17, typename T18, typename T19, typename T20,
15578     typename T21, typename T22, typename T23, typename T24, typename T25,
15579     typename T26, typename T27, typename T28, typename T29, typename T30,
15580     typename T31, typename T32, typename T33, typename T34, typename T35,
15581     typename T36, typename T37, typename T38, typename T39, typename T40,
15582     typename T41, typename T42, typename T43, typename T44, typename T45,
15583     typename T46, typename T47, typename T48, typename T49, typename T50>
15584 class ValueArray50 {
15585  public:
15586   ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15587       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15588       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15589       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
15590       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
15591       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
15592       T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
15593       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
15594       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
15595       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
15596       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
15597       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
15598       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
15599       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
15600 
15601   template <typename T>
15602   operator ParamGenerator<T>() const {
15603     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
15604         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
15605         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
15606         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
15607         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
15608         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
15609         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
15610         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
15611         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
15612         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
15613         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
15614         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
15615         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
15616         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
15617         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
15618         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
15619         static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
15620     return ValuesIn(array);
15621   }
15622 
15623   ValueArray50(const ValueArray50& other) : v1_(other.v1_), v2_(other.v2_),
15624       v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),
15625       v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),
15626       v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),
15627       v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),
15628       v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),
15629       v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),
15630       v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),
15631       v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),
15632       v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),
15633       v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),
15634       v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),
15635       v47_(other.v47_), v48_(other.v48_), v49_(other.v49_), v50_(other.v50_) {}
15636 
15637  private:
15638   // No implementation - assignment is unsupported.
15639   void operator=(const ValueArray50& other);
15640 
15641   const T1 v1_;
15642   const T2 v2_;
15643   const T3 v3_;
15644   const T4 v4_;
15645   const T5 v5_;
15646   const T6 v6_;
15647   const T7 v7_;
15648   const T8 v8_;
15649   const T9 v9_;
15650   const T10 v10_;
15651   const T11 v11_;
15652   const T12 v12_;
15653   const T13 v13_;
15654   const T14 v14_;
15655   const T15 v15_;
15656   const T16 v16_;
15657   const T17 v17_;
15658   const T18 v18_;
15659   const T19 v19_;
15660   const T20 v20_;
15661   const T21 v21_;
15662   const T22 v22_;
15663   const T23 v23_;
15664   const T24 v24_;
15665   const T25 v25_;
15666   const T26 v26_;
15667   const T27 v27_;
15668   const T28 v28_;
15669   const T29 v29_;
15670   const T30 v30_;
15671   const T31 v31_;
15672   const T32 v32_;
15673   const T33 v33_;
15674   const T34 v34_;
15675   const T35 v35_;
15676   const T36 v36_;
15677   const T37 v37_;
15678   const T38 v38_;
15679   const T39 v39_;
15680   const T40 v40_;
15681   const T41 v41_;
15682   const T42 v42_;
15683   const T43 v43_;
15684   const T44 v44_;
15685   const T45 v45_;
15686   const T46 v46_;
15687   const T47 v47_;
15688   const T48 v48_;
15689   const T49 v49_;
15690   const T50 v50_;
15691 };
15692 
15693 # if GTEST_HAS_COMBINE
15694 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15695 //
15696 // Generates values from the Cartesian product of values produced
15697 // by the argument generators.
15698 //
15699 template <typename T1, typename T2>
15700 class CartesianProductGenerator2
15701     : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
15702  public:
15703   typedef ::testing::tuple<T1, T2> ParamType;
15704 
15705   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
15706       const ParamGenerator<T2>& g2)
15707       : g1_(g1), g2_(g2) {}
15708   virtual ~CartesianProductGenerator2() {}
15709 
15710   virtual ParamIteratorInterface<ParamType>* Begin() const {
15711     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
15712   }
15713   virtual ParamIteratorInterface<ParamType>* End() const {
15714     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
15715   }
15716 
15717  private:
15718   class Iterator : public ParamIteratorInterface<ParamType> {
15719    public:
15720     Iterator(const ParamGeneratorInterface<ParamType>* base,
15721       const ParamGenerator<T1>& g1,
15722       const typename ParamGenerator<T1>::iterator& current1,
15723       const ParamGenerator<T2>& g2,
15724       const typename ParamGenerator<T2>::iterator& current2)
15725         : base_(base),
15726           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15727           begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
15728       ComputeCurrentValue();
15729     }
15730     virtual ~Iterator() {}
15731 
15732     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15733       return base_;
15734     }
15735     // Advance should not be called on beyond-of-range iterators
15736     // so no component iterators must be beyond end of range, either.
15737     virtual void Advance() {
15738       assert(!AtEnd());
15739       ++current2_;
15740       if (current2_ == end2_) {
15741         current2_ = begin2_;
15742         ++current1_;
15743       }
15744       ComputeCurrentValue();
15745     }
15746     virtual ParamIteratorInterface<ParamType>* Clone() const {
15747       return new Iterator(*this);
15748     }
15749     virtual const ParamType* Current() const { return current_value_.get(); }
15750     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15751       // Having the same base generator guarantees that the other
15752       // iterator is of the same type and we can downcast.
15753       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15754           << "The program attempted to compare iterators "
15755           << "from different generators." << std::endl;
15756       const Iterator* typed_other =
15757           CheckedDowncastToActualType<const Iterator>(&other);
15758       // We must report iterators equal if they both point beyond their
15759       // respective ranges. That can happen in a variety of fashions,
15760       // so we have to consult AtEnd().
15761       return (AtEnd() && typed_other->AtEnd()) ||
15762          (
15763           current1_ == typed_other->current1_ &&
15764           current2_ == typed_other->current2_);
15765     }
15766 
15767    private:
15768     Iterator(const Iterator& other)
15769         : base_(other.base_),
15770         begin1_(other.begin1_),
15771         end1_(other.end1_),
15772         current1_(other.current1_),
15773         begin2_(other.begin2_),
15774         end2_(other.end2_),
15775         current2_(other.current2_) {
15776       ComputeCurrentValue();
15777     }
15778 
15779     void ComputeCurrentValue() {
15780       if (!AtEnd())
15781         current_value_.reset(new ParamType(*current1_, *current2_));
15782     }
15783     bool AtEnd() const {
15784       // We must report iterator past the end of the range when either of the
15785       // component iterators has reached the end of its range.
15786       return
15787           current1_ == end1_ ||
15788           current2_ == end2_;
15789     }
15790 
15791     // No implementation - assignment is unsupported.
15792     void operator=(const Iterator& other);
15793 
15794     const ParamGeneratorInterface<ParamType>* const base_;
15795     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15796     // current[i]_ is the actual traversing iterator.
15797     const typename ParamGenerator<T1>::iterator begin1_;
15798     const typename ParamGenerator<T1>::iterator end1_;
15799     typename ParamGenerator<T1>::iterator current1_;
15800     const typename ParamGenerator<T2>::iterator begin2_;
15801     const typename ParamGenerator<T2>::iterator end2_;
15802     typename ParamGenerator<T2>::iterator current2_;
15803     linked_ptr<ParamType> current_value_;
15804   };  // class CartesianProductGenerator2::Iterator
15805 
15806   // No implementation - assignment is unsupported.
15807   void operator=(const CartesianProductGenerator2& other);
15808 
15809   const ParamGenerator<T1> g1_;
15810   const ParamGenerator<T2> g2_;
15811 };  // class CartesianProductGenerator2
15812 
15813 
15814 template <typename T1, typename T2, typename T3>
15815 class CartesianProductGenerator3
15816     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
15817  public:
15818   typedef ::testing::tuple<T1, T2, T3> ParamType;
15819 
15820   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
15821       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
15822       : g1_(g1), g2_(g2), g3_(g3) {}
15823   virtual ~CartesianProductGenerator3() {}
15824 
15825   virtual ParamIteratorInterface<ParamType>* Begin() const {
15826     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15827         g3_.begin());
15828   }
15829   virtual ParamIteratorInterface<ParamType>* End() const {
15830     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
15831   }
15832 
15833  private:
15834   class Iterator : public ParamIteratorInterface<ParamType> {
15835    public:
15836     Iterator(const ParamGeneratorInterface<ParamType>* base,
15837       const ParamGenerator<T1>& g1,
15838       const typename ParamGenerator<T1>::iterator& current1,
15839       const ParamGenerator<T2>& g2,
15840       const typename ParamGenerator<T2>::iterator& current2,
15841       const ParamGenerator<T3>& g3,
15842       const typename ParamGenerator<T3>::iterator& current3)
15843         : base_(base),
15844           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15845           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15846           begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
15847       ComputeCurrentValue();
15848     }
15849     virtual ~Iterator() {}
15850 
15851     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15852       return base_;
15853     }
15854     // Advance should not be called on beyond-of-range iterators
15855     // so no component iterators must be beyond end of range, either.
15856     virtual void Advance() {
15857       assert(!AtEnd());
15858       ++current3_;
15859       if (current3_ == end3_) {
15860         current3_ = begin3_;
15861         ++current2_;
15862       }
15863       if (current2_ == end2_) {
15864         current2_ = begin2_;
15865         ++current1_;
15866       }
15867       ComputeCurrentValue();
15868     }
15869     virtual ParamIteratorInterface<ParamType>* Clone() const {
15870       return new Iterator(*this);
15871     }
15872     virtual const ParamType* Current() const { return current_value_.get(); }
15873     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15874       // Having the same base generator guarantees that the other
15875       // iterator is of the same type and we can downcast.
15876       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15877           << "The program attempted to compare iterators "
15878           << "from different generators." << std::endl;
15879       const Iterator* typed_other =
15880           CheckedDowncastToActualType<const Iterator>(&other);
15881       // We must report iterators equal if they both point beyond their
15882       // respective ranges. That can happen in a variety of fashions,
15883       // so we have to consult AtEnd().
15884       return (AtEnd() && typed_other->AtEnd()) ||
15885          (
15886           current1_ == typed_other->current1_ &&
15887           current2_ == typed_other->current2_ &&
15888           current3_ == typed_other->current3_);
15889     }
15890 
15891    private:
15892     Iterator(const Iterator& other)
15893         : base_(other.base_),
15894         begin1_(other.begin1_),
15895         end1_(other.end1_),
15896         current1_(other.current1_),
15897         begin2_(other.begin2_),
15898         end2_(other.end2_),
15899         current2_(other.current2_),
15900         begin3_(other.begin3_),
15901         end3_(other.end3_),
15902         current3_(other.current3_) {
15903       ComputeCurrentValue();
15904     }
15905 
15906     void ComputeCurrentValue() {
15907       if (!AtEnd())
15908         current_value_.reset(new ParamType(*current1_, *current2_, *current3_));
15909     }
15910     bool AtEnd() const {
15911       // We must report iterator past the end of the range when either of the
15912       // component iterators has reached the end of its range.
15913       return
15914           current1_ == end1_ ||
15915           current2_ == end2_ ||
15916           current3_ == end3_;
15917     }
15918 
15919     // No implementation - assignment is unsupported.
15920     void operator=(const Iterator& other);
15921 
15922     const ParamGeneratorInterface<ParamType>* const base_;
15923     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15924     // current[i]_ is the actual traversing iterator.
15925     const typename ParamGenerator<T1>::iterator begin1_;
15926     const typename ParamGenerator<T1>::iterator end1_;
15927     typename ParamGenerator<T1>::iterator current1_;
15928     const typename ParamGenerator<T2>::iterator begin2_;
15929     const typename ParamGenerator<T2>::iterator end2_;
15930     typename ParamGenerator<T2>::iterator current2_;
15931     const typename ParamGenerator<T3>::iterator begin3_;
15932     const typename ParamGenerator<T3>::iterator end3_;
15933     typename ParamGenerator<T3>::iterator current3_;
15934     linked_ptr<ParamType> current_value_;
15935   };  // class CartesianProductGenerator3::Iterator
15936 
15937   // No implementation - assignment is unsupported.
15938   void operator=(const CartesianProductGenerator3& other);
15939 
15940   const ParamGenerator<T1> g1_;
15941   const ParamGenerator<T2> g2_;
15942   const ParamGenerator<T3> g3_;
15943 };  // class CartesianProductGenerator3
15944 
15945 
15946 template <typename T1, typename T2, typename T3, typename T4>
15947 class CartesianProductGenerator4
15948     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
15949  public:
15950   typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
15951 
15952   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
15953       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15954       const ParamGenerator<T4>& g4)
15955       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15956   virtual ~CartesianProductGenerator4() {}
15957 
15958   virtual ParamIteratorInterface<ParamType>* Begin() const {
15959     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15960         g3_.begin(), g4_, g4_.begin());
15961   }
15962   virtual ParamIteratorInterface<ParamType>* End() const {
15963     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15964         g4_, g4_.end());
15965   }
15966 
15967  private:
15968   class Iterator : public ParamIteratorInterface<ParamType> {
15969    public:
15970     Iterator(const ParamGeneratorInterface<ParamType>* base,
15971       const ParamGenerator<T1>& g1,
15972       const typename ParamGenerator<T1>::iterator& current1,
15973       const ParamGenerator<T2>& g2,
15974       const typename ParamGenerator<T2>::iterator& current2,
15975       const ParamGenerator<T3>& g3,
15976       const typename ParamGenerator<T3>::iterator& current3,
15977       const ParamGenerator<T4>& g4,
15978       const typename ParamGenerator<T4>::iterator& current4)
15979         : base_(base),
15980           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15981           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15982           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15983           begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
15984       ComputeCurrentValue();
15985     }
15986     virtual ~Iterator() {}
15987 
15988     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15989       return base_;
15990     }
15991     // Advance should not be called on beyond-of-range iterators
15992     // so no component iterators must be beyond end of range, either.
15993     virtual void Advance() {
15994       assert(!AtEnd());
15995       ++current4_;
15996       if (current4_ == end4_) {
15997         current4_ = begin4_;
15998         ++current3_;
15999       }
16000       if (current3_ == end3_) {
16001         current3_ = begin3_;
16002         ++current2_;
16003       }
16004       if (current2_ == end2_) {
16005         current2_ = begin2_;
16006         ++current1_;
16007       }
16008       ComputeCurrentValue();
16009     }
16010     virtual ParamIteratorInterface<ParamType>* Clone() const {
16011       return new Iterator(*this);
16012     }
16013     virtual const ParamType* Current() const { return current_value_.get(); }
16014     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16015       // Having the same base generator guarantees that the other
16016       // iterator is of the same type and we can downcast.
16017       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16018           << "The program attempted to compare iterators "
16019           << "from different generators." << std::endl;
16020       const Iterator* typed_other =
16021           CheckedDowncastToActualType<const Iterator>(&other);
16022       // We must report iterators equal if they both point beyond their
16023       // respective ranges. That can happen in a variety of fashions,
16024       // so we have to consult AtEnd().
16025       return (AtEnd() && typed_other->AtEnd()) ||
16026          (
16027           current1_ == typed_other->current1_ &&
16028           current2_ == typed_other->current2_ &&
16029           current3_ == typed_other->current3_ &&
16030           current4_ == typed_other->current4_);
16031     }
16032 
16033    private:
16034     Iterator(const Iterator& other)
16035         : base_(other.base_),
16036         begin1_(other.begin1_),
16037         end1_(other.end1_),
16038         current1_(other.current1_),
16039         begin2_(other.begin2_),
16040         end2_(other.end2_),
16041         current2_(other.current2_),
16042         begin3_(other.begin3_),
16043         end3_(other.end3_),
16044         current3_(other.current3_),
16045         begin4_(other.begin4_),
16046         end4_(other.end4_),
16047         current4_(other.current4_) {
16048       ComputeCurrentValue();
16049     }
16050 
16051     void ComputeCurrentValue() {
16052       if (!AtEnd())
16053         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16054             *current4_));
16055     }
16056     bool AtEnd() const {
16057       // We must report iterator past the end of the range when either of the
16058       // component iterators has reached the end of its range.
16059       return
16060           current1_ == end1_ ||
16061           current2_ == end2_ ||
16062           current3_ == end3_ ||
16063           current4_ == end4_;
16064     }
16065 
16066     // No implementation - assignment is unsupported.
16067     void operator=(const Iterator& other);
16068 
16069     const ParamGeneratorInterface<ParamType>* const base_;
16070     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16071     // current[i]_ is the actual traversing iterator.
16072     const typename ParamGenerator<T1>::iterator begin1_;
16073     const typename ParamGenerator<T1>::iterator end1_;
16074     typename ParamGenerator<T1>::iterator current1_;
16075     const typename ParamGenerator<T2>::iterator begin2_;
16076     const typename ParamGenerator<T2>::iterator end2_;
16077     typename ParamGenerator<T2>::iterator current2_;
16078     const typename ParamGenerator<T3>::iterator begin3_;
16079     const typename ParamGenerator<T3>::iterator end3_;
16080     typename ParamGenerator<T3>::iterator current3_;
16081     const typename ParamGenerator<T4>::iterator begin4_;
16082     const typename ParamGenerator<T4>::iterator end4_;
16083     typename ParamGenerator<T4>::iterator current4_;
16084     linked_ptr<ParamType> current_value_;
16085   };  // class CartesianProductGenerator4::Iterator
16086 
16087   // No implementation - assignment is unsupported.
16088   void operator=(const CartesianProductGenerator4& other);
16089 
16090   const ParamGenerator<T1> g1_;
16091   const ParamGenerator<T2> g2_;
16092   const ParamGenerator<T3> g3_;
16093   const ParamGenerator<T4> g4_;
16094 };  // class CartesianProductGenerator4
16095 
16096 
16097 template <typename T1, typename T2, typename T3, typename T4, typename T5>
16098 class CartesianProductGenerator5
16099     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
16100  public:
16101   typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
16102 
16103   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
16104       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16105       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
16106       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
16107   virtual ~CartesianProductGenerator5() {}
16108 
16109   virtual ParamIteratorInterface<ParamType>* Begin() const {
16110     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16111         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
16112   }
16113   virtual ParamIteratorInterface<ParamType>* End() const {
16114     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16115         g4_, g4_.end(), g5_, g5_.end());
16116   }
16117 
16118  private:
16119   class Iterator : public ParamIteratorInterface<ParamType> {
16120    public:
16121     Iterator(const ParamGeneratorInterface<ParamType>* base,
16122       const ParamGenerator<T1>& g1,
16123       const typename ParamGenerator<T1>::iterator& current1,
16124       const ParamGenerator<T2>& g2,
16125       const typename ParamGenerator<T2>::iterator& current2,
16126       const ParamGenerator<T3>& g3,
16127       const typename ParamGenerator<T3>::iterator& current3,
16128       const ParamGenerator<T4>& g4,
16129       const typename ParamGenerator<T4>::iterator& current4,
16130       const ParamGenerator<T5>& g5,
16131       const typename ParamGenerator<T5>::iterator& current5)
16132         : base_(base),
16133           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16134           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16135           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16136           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16137           begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
16138       ComputeCurrentValue();
16139     }
16140     virtual ~Iterator() {}
16141 
16142     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16143       return base_;
16144     }
16145     // Advance should not be called on beyond-of-range iterators
16146     // so no component iterators must be beyond end of range, either.
16147     virtual void Advance() {
16148       assert(!AtEnd());
16149       ++current5_;
16150       if (current5_ == end5_) {
16151         current5_ = begin5_;
16152         ++current4_;
16153       }
16154       if (current4_ == end4_) {
16155         current4_ = begin4_;
16156         ++current3_;
16157       }
16158       if (current3_ == end3_) {
16159         current3_ = begin3_;
16160         ++current2_;
16161       }
16162       if (current2_ == end2_) {
16163         current2_ = begin2_;
16164         ++current1_;
16165       }
16166       ComputeCurrentValue();
16167     }
16168     virtual ParamIteratorInterface<ParamType>* Clone() const {
16169       return new Iterator(*this);
16170     }
16171     virtual const ParamType* Current() const { return current_value_.get(); }
16172     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16173       // Having the same base generator guarantees that the other
16174       // iterator is of the same type and we can downcast.
16175       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16176           << "The program attempted to compare iterators "
16177           << "from different generators." << std::endl;
16178       const Iterator* typed_other =
16179           CheckedDowncastToActualType<const Iterator>(&other);
16180       // We must report iterators equal if they both point beyond their
16181       // respective ranges. That can happen in a variety of fashions,
16182       // so we have to consult AtEnd().
16183       return (AtEnd() && typed_other->AtEnd()) ||
16184          (
16185           current1_ == typed_other->current1_ &&
16186           current2_ == typed_other->current2_ &&
16187           current3_ == typed_other->current3_ &&
16188           current4_ == typed_other->current4_ &&
16189           current5_ == typed_other->current5_);
16190     }
16191 
16192    private:
16193     Iterator(const Iterator& other)
16194         : base_(other.base_),
16195         begin1_(other.begin1_),
16196         end1_(other.end1_),
16197         current1_(other.current1_),
16198         begin2_(other.begin2_),
16199         end2_(other.end2_),
16200         current2_(other.current2_),
16201         begin3_(other.begin3_),
16202         end3_(other.end3_),
16203         current3_(other.current3_),
16204         begin4_(other.begin4_),
16205         end4_(other.end4_),
16206         current4_(other.current4_),
16207         begin5_(other.begin5_),
16208         end5_(other.end5_),
16209         current5_(other.current5_) {
16210       ComputeCurrentValue();
16211     }
16212 
16213     void ComputeCurrentValue() {
16214       if (!AtEnd())
16215         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16216             *current4_, *current5_));
16217     }
16218     bool AtEnd() const {
16219       // We must report iterator past the end of the range when either of the
16220       // component iterators has reached the end of its range.
16221       return
16222           current1_ == end1_ ||
16223           current2_ == end2_ ||
16224           current3_ == end3_ ||
16225           current4_ == end4_ ||
16226           current5_ == end5_;
16227     }
16228 
16229     // No implementation - assignment is unsupported.
16230     void operator=(const Iterator& other);
16231 
16232     const ParamGeneratorInterface<ParamType>* const base_;
16233     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16234     // current[i]_ is the actual traversing iterator.
16235     const typename ParamGenerator<T1>::iterator begin1_;
16236     const typename ParamGenerator<T1>::iterator end1_;
16237     typename ParamGenerator<T1>::iterator current1_;
16238     const typename ParamGenerator<T2>::iterator begin2_;
16239     const typename ParamGenerator<T2>::iterator end2_;
16240     typename ParamGenerator<T2>::iterator current2_;
16241     const typename ParamGenerator<T3>::iterator begin3_;
16242     const typename ParamGenerator<T3>::iterator end3_;
16243     typename ParamGenerator<T3>::iterator current3_;
16244     const typename ParamGenerator<T4>::iterator begin4_;
16245     const typename ParamGenerator<T4>::iterator end4_;
16246     typename ParamGenerator<T4>::iterator current4_;
16247     const typename ParamGenerator<T5>::iterator begin5_;
16248     const typename ParamGenerator<T5>::iterator end5_;
16249     typename ParamGenerator<T5>::iterator current5_;
16250     linked_ptr<ParamType> current_value_;
16251   };  // class CartesianProductGenerator5::Iterator
16252 
16253   // No implementation - assignment is unsupported.
16254   void operator=(const CartesianProductGenerator5& other);
16255 
16256   const ParamGenerator<T1> g1_;
16257   const ParamGenerator<T2> g2_;
16258   const ParamGenerator<T3> g3_;
16259   const ParamGenerator<T4> g4_;
16260   const ParamGenerator<T5> g5_;
16261 };  // class CartesianProductGenerator5
16262 
16263 
16264 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16265     typename T6>
16266 class CartesianProductGenerator6
16267     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
16268         T6> > {
16269  public:
16270   typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
16271 
16272   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
16273       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16274       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16275       const ParamGenerator<T6>& g6)
16276       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
16277   virtual ~CartesianProductGenerator6() {}
16278 
16279   virtual ParamIteratorInterface<ParamType>* Begin() const {
16280     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16281         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
16282   }
16283   virtual ParamIteratorInterface<ParamType>* End() const {
16284     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16285         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
16286   }
16287 
16288  private:
16289   class Iterator : public ParamIteratorInterface<ParamType> {
16290    public:
16291     Iterator(const ParamGeneratorInterface<ParamType>* base,
16292       const ParamGenerator<T1>& g1,
16293       const typename ParamGenerator<T1>::iterator& current1,
16294       const ParamGenerator<T2>& g2,
16295       const typename ParamGenerator<T2>::iterator& current2,
16296       const ParamGenerator<T3>& g3,
16297       const typename ParamGenerator<T3>::iterator& current3,
16298       const ParamGenerator<T4>& g4,
16299       const typename ParamGenerator<T4>::iterator& current4,
16300       const ParamGenerator<T5>& g5,
16301       const typename ParamGenerator<T5>::iterator& current5,
16302       const ParamGenerator<T6>& g6,
16303       const typename ParamGenerator<T6>::iterator& current6)
16304         : base_(base),
16305           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16306           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16307           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16308           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16309           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16310           begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
16311       ComputeCurrentValue();
16312     }
16313     virtual ~Iterator() {}
16314 
16315     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16316       return base_;
16317     }
16318     // Advance should not be called on beyond-of-range iterators
16319     // so no component iterators must be beyond end of range, either.
16320     virtual void Advance() {
16321       assert(!AtEnd());
16322       ++current6_;
16323       if (current6_ == end6_) {
16324         current6_ = begin6_;
16325         ++current5_;
16326       }
16327       if (current5_ == end5_) {
16328         current5_ = begin5_;
16329         ++current4_;
16330       }
16331       if (current4_ == end4_) {
16332         current4_ = begin4_;
16333         ++current3_;
16334       }
16335       if (current3_ == end3_) {
16336         current3_ = begin3_;
16337         ++current2_;
16338       }
16339       if (current2_ == end2_) {
16340         current2_ = begin2_;
16341         ++current1_;
16342       }
16343       ComputeCurrentValue();
16344     }
16345     virtual ParamIteratorInterface<ParamType>* Clone() const {
16346       return new Iterator(*this);
16347     }
16348     virtual const ParamType* Current() const { return current_value_.get(); }
16349     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16350       // Having the same base generator guarantees that the other
16351       // iterator is of the same type and we can downcast.
16352       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16353           << "The program attempted to compare iterators "
16354           << "from different generators." << std::endl;
16355       const Iterator* typed_other =
16356           CheckedDowncastToActualType<const Iterator>(&other);
16357       // We must report iterators equal if they both point beyond their
16358       // respective ranges. That can happen in a variety of fashions,
16359       // so we have to consult AtEnd().
16360       return (AtEnd() && typed_other->AtEnd()) ||
16361          (
16362           current1_ == typed_other->current1_ &&
16363           current2_ == typed_other->current2_ &&
16364           current3_ == typed_other->current3_ &&
16365           current4_ == typed_other->current4_ &&
16366           current5_ == typed_other->current5_ &&
16367           current6_ == typed_other->current6_);
16368     }
16369 
16370    private:
16371     Iterator(const Iterator& other)
16372         : base_(other.base_),
16373         begin1_(other.begin1_),
16374         end1_(other.end1_),
16375         current1_(other.current1_),
16376         begin2_(other.begin2_),
16377         end2_(other.end2_),
16378         current2_(other.current2_),
16379         begin3_(other.begin3_),
16380         end3_(other.end3_),
16381         current3_(other.current3_),
16382         begin4_(other.begin4_),
16383         end4_(other.end4_),
16384         current4_(other.current4_),
16385         begin5_(other.begin5_),
16386         end5_(other.end5_),
16387         current5_(other.current5_),
16388         begin6_(other.begin6_),
16389         end6_(other.end6_),
16390         current6_(other.current6_) {
16391       ComputeCurrentValue();
16392     }
16393 
16394     void ComputeCurrentValue() {
16395       if (!AtEnd())
16396         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16397             *current4_, *current5_, *current6_));
16398     }
16399     bool AtEnd() const {
16400       // We must report iterator past the end of the range when either of the
16401       // component iterators has reached the end of its range.
16402       return
16403           current1_ == end1_ ||
16404           current2_ == end2_ ||
16405           current3_ == end3_ ||
16406           current4_ == end4_ ||
16407           current5_ == end5_ ||
16408           current6_ == end6_;
16409     }
16410 
16411     // No implementation - assignment is unsupported.
16412     void operator=(const Iterator& other);
16413 
16414     const ParamGeneratorInterface<ParamType>* const base_;
16415     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16416     // current[i]_ is the actual traversing iterator.
16417     const typename ParamGenerator<T1>::iterator begin1_;
16418     const typename ParamGenerator<T1>::iterator end1_;
16419     typename ParamGenerator<T1>::iterator current1_;
16420     const typename ParamGenerator<T2>::iterator begin2_;
16421     const typename ParamGenerator<T2>::iterator end2_;
16422     typename ParamGenerator<T2>::iterator current2_;
16423     const typename ParamGenerator<T3>::iterator begin3_;
16424     const typename ParamGenerator<T3>::iterator end3_;
16425     typename ParamGenerator<T3>::iterator current3_;
16426     const typename ParamGenerator<T4>::iterator begin4_;
16427     const typename ParamGenerator<T4>::iterator end4_;
16428     typename ParamGenerator<T4>::iterator current4_;
16429     const typename ParamGenerator<T5>::iterator begin5_;
16430     const typename ParamGenerator<T5>::iterator end5_;
16431     typename ParamGenerator<T5>::iterator current5_;
16432     const typename ParamGenerator<T6>::iterator begin6_;
16433     const typename ParamGenerator<T6>::iterator end6_;
16434     typename ParamGenerator<T6>::iterator current6_;
16435     linked_ptr<ParamType> current_value_;
16436   };  // class CartesianProductGenerator6::Iterator
16437 
16438   // No implementation - assignment is unsupported.
16439   void operator=(const CartesianProductGenerator6& other);
16440 
16441   const ParamGenerator<T1> g1_;
16442   const ParamGenerator<T2> g2_;
16443   const ParamGenerator<T3> g3_;
16444   const ParamGenerator<T4> g4_;
16445   const ParamGenerator<T5> g5_;
16446   const ParamGenerator<T6> g6_;
16447 };  // class CartesianProductGenerator6
16448 
16449 
16450 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16451     typename T6, typename T7>
16452 class CartesianProductGenerator7
16453     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16454         T7> > {
16455  public:
16456   typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
16457 
16458   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
16459       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16460       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16461       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
16462       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
16463   virtual ~CartesianProductGenerator7() {}
16464 
16465   virtual ParamIteratorInterface<ParamType>* Begin() const {
16466     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16467         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16468         g7_.begin());
16469   }
16470   virtual ParamIteratorInterface<ParamType>* End() const {
16471     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16472         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
16473   }
16474 
16475  private:
16476   class Iterator : public ParamIteratorInterface<ParamType> {
16477    public:
16478     Iterator(const ParamGeneratorInterface<ParamType>* base,
16479       const ParamGenerator<T1>& g1,
16480       const typename ParamGenerator<T1>::iterator& current1,
16481       const ParamGenerator<T2>& g2,
16482       const typename ParamGenerator<T2>::iterator& current2,
16483       const ParamGenerator<T3>& g3,
16484       const typename ParamGenerator<T3>::iterator& current3,
16485       const ParamGenerator<T4>& g4,
16486       const typename ParamGenerator<T4>::iterator& current4,
16487       const ParamGenerator<T5>& g5,
16488       const typename ParamGenerator<T5>::iterator& current5,
16489       const ParamGenerator<T6>& g6,
16490       const typename ParamGenerator<T6>::iterator& current6,
16491       const ParamGenerator<T7>& g7,
16492       const typename ParamGenerator<T7>::iterator& current7)
16493         : base_(base),
16494           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16495           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16496           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16497           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16498           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16499           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16500           begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
16501       ComputeCurrentValue();
16502     }
16503     virtual ~Iterator() {}
16504 
16505     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16506       return base_;
16507     }
16508     // Advance should not be called on beyond-of-range iterators
16509     // so no component iterators must be beyond end of range, either.
16510     virtual void Advance() {
16511       assert(!AtEnd());
16512       ++current7_;
16513       if (current7_ == end7_) {
16514         current7_ = begin7_;
16515         ++current6_;
16516       }
16517       if (current6_ == end6_) {
16518         current6_ = begin6_;
16519         ++current5_;
16520       }
16521       if (current5_ == end5_) {
16522         current5_ = begin5_;
16523         ++current4_;
16524       }
16525       if (current4_ == end4_) {
16526         current4_ = begin4_;
16527         ++current3_;
16528       }
16529       if (current3_ == end3_) {
16530         current3_ = begin3_;
16531         ++current2_;
16532       }
16533       if (current2_ == end2_) {
16534         current2_ = begin2_;
16535         ++current1_;
16536       }
16537       ComputeCurrentValue();
16538     }
16539     virtual ParamIteratorInterface<ParamType>* Clone() const {
16540       return new Iterator(*this);
16541     }
16542     virtual const ParamType* Current() const { return current_value_.get(); }
16543     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16544       // Having the same base generator guarantees that the other
16545       // iterator is of the same type and we can downcast.
16546       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16547           << "The program attempted to compare iterators "
16548           << "from different generators." << std::endl;
16549       const Iterator* typed_other =
16550           CheckedDowncastToActualType<const Iterator>(&other);
16551       // We must report iterators equal if they both point beyond their
16552       // respective ranges. That can happen in a variety of fashions,
16553       // so we have to consult AtEnd().
16554       return (AtEnd() && typed_other->AtEnd()) ||
16555          (
16556           current1_ == typed_other->current1_ &&
16557           current2_ == typed_other->current2_ &&
16558           current3_ == typed_other->current3_ &&
16559           current4_ == typed_other->current4_ &&
16560           current5_ == typed_other->current5_ &&
16561           current6_ == typed_other->current6_ &&
16562           current7_ == typed_other->current7_);
16563     }
16564 
16565    private:
16566     Iterator(const Iterator& other)
16567         : base_(other.base_),
16568         begin1_(other.begin1_),
16569         end1_(other.end1_),
16570         current1_(other.current1_),
16571         begin2_(other.begin2_),
16572         end2_(other.end2_),
16573         current2_(other.current2_),
16574         begin3_(other.begin3_),
16575         end3_(other.end3_),
16576         current3_(other.current3_),
16577         begin4_(other.begin4_),
16578         end4_(other.end4_),
16579         current4_(other.current4_),
16580         begin5_(other.begin5_),
16581         end5_(other.end5_),
16582         current5_(other.current5_),
16583         begin6_(other.begin6_),
16584         end6_(other.end6_),
16585         current6_(other.current6_),
16586         begin7_(other.begin7_),
16587         end7_(other.end7_),
16588         current7_(other.current7_) {
16589       ComputeCurrentValue();
16590     }
16591 
16592     void ComputeCurrentValue() {
16593       if (!AtEnd())
16594         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16595             *current4_, *current5_, *current6_, *current7_));
16596     }
16597     bool AtEnd() const {
16598       // We must report iterator past the end of the range when either of the
16599       // component iterators has reached the end of its range.
16600       return
16601           current1_ == end1_ ||
16602           current2_ == end2_ ||
16603           current3_ == end3_ ||
16604           current4_ == end4_ ||
16605           current5_ == end5_ ||
16606           current6_ == end6_ ||
16607           current7_ == end7_;
16608     }
16609 
16610     // No implementation - assignment is unsupported.
16611     void operator=(const Iterator& other);
16612 
16613     const ParamGeneratorInterface<ParamType>* const base_;
16614     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16615     // current[i]_ is the actual traversing iterator.
16616     const typename ParamGenerator<T1>::iterator begin1_;
16617     const typename ParamGenerator<T1>::iterator end1_;
16618     typename ParamGenerator<T1>::iterator current1_;
16619     const typename ParamGenerator<T2>::iterator begin2_;
16620     const typename ParamGenerator<T2>::iterator end2_;
16621     typename ParamGenerator<T2>::iterator current2_;
16622     const typename ParamGenerator<T3>::iterator begin3_;
16623     const typename ParamGenerator<T3>::iterator end3_;
16624     typename ParamGenerator<T3>::iterator current3_;
16625     const typename ParamGenerator<T4>::iterator begin4_;
16626     const typename ParamGenerator<T4>::iterator end4_;
16627     typename ParamGenerator<T4>::iterator current4_;
16628     const typename ParamGenerator<T5>::iterator begin5_;
16629     const typename ParamGenerator<T5>::iterator end5_;
16630     typename ParamGenerator<T5>::iterator current5_;
16631     const typename ParamGenerator<T6>::iterator begin6_;
16632     const typename ParamGenerator<T6>::iterator end6_;
16633     typename ParamGenerator<T6>::iterator current6_;
16634     const typename ParamGenerator<T7>::iterator begin7_;
16635     const typename ParamGenerator<T7>::iterator end7_;
16636     typename ParamGenerator<T7>::iterator current7_;
16637     linked_ptr<ParamType> current_value_;
16638   };  // class CartesianProductGenerator7::Iterator
16639 
16640   // No implementation - assignment is unsupported.
16641   void operator=(const CartesianProductGenerator7& other);
16642 
16643   const ParamGenerator<T1> g1_;
16644   const ParamGenerator<T2> g2_;
16645   const ParamGenerator<T3> g3_;
16646   const ParamGenerator<T4> g4_;
16647   const ParamGenerator<T5> g5_;
16648   const ParamGenerator<T6> g6_;
16649   const ParamGenerator<T7> g7_;
16650 };  // class CartesianProductGenerator7
16651 
16652 
16653 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16654     typename T6, typename T7, typename T8>
16655 class CartesianProductGenerator8
16656     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16657         T7, T8> > {
16658  public:
16659   typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
16660 
16661   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
16662       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16663       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16664       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
16665       const ParamGenerator<T8>& g8)
16666       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
16667           g8_(g8) {}
16668   virtual ~CartesianProductGenerator8() {}
16669 
16670   virtual ParamIteratorInterface<ParamType>* Begin() const {
16671     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16672         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16673         g7_.begin(), g8_, g8_.begin());
16674   }
16675   virtual ParamIteratorInterface<ParamType>* End() const {
16676     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16677         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
16678         g8_.end());
16679   }
16680 
16681  private:
16682   class Iterator : public ParamIteratorInterface<ParamType> {
16683    public:
16684     Iterator(const ParamGeneratorInterface<ParamType>* base,
16685       const ParamGenerator<T1>& g1,
16686       const typename ParamGenerator<T1>::iterator& current1,
16687       const ParamGenerator<T2>& g2,
16688       const typename ParamGenerator<T2>::iterator& current2,
16689       const ParamGenerator<T3>& g3,
16690       const typename ParamGenerator<T3>::iterator& current3,
16691       const ParamGenerator<T4>& g4,
16692       const typename ParamGenerator<T4>::iterator& current4,
16693       const ParamGenerator<T5>& g5,
16694       const typename ParamGenerator<T5>::iterator& current5,
16695       const ParamGenerator<T6>& g6,
16696       const typename ParamGenerator<T6>::iterator& current6,
16697       const ParamGenerator<T7>& g7,
16698       const typename ParamGenerator<T7>::iterator& current7,
16699       const ParamGenerator<T8>& g8,
16700       const typename ParamGenerator<T8>::iterator& current8)
16701         : base_(base),
16702           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16703           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16704           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16705           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16706           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16707           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16708           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
16709           begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
16710       ComputeCurrentValue();
16711     }
16712     virtual ~Iterator() {}
16713 
16714     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16715       return base_;
16716     }
16717     // Advance should not be called on beyond-of-range iterators
16718     // so no component iterators must be beyond end of range, either.
16719     virtual void Advance() {
16720       assert(!AtEnd());
16721       ++current8_;
16722       if (current8_ == end8_) {
16723         current8_ = begin8_;
16724         ++current7_;
16725       }
16726       if (current7_ == end7_) {
16727         current7_ = begin7_;
16728         ++current6_;
16729       }
16730       if (current6_ == end6_) {
16731         current6_ = begin6_;
16732         ++current5_;
16733       }
16734       if (current5_ == end5_) {
16735         current5_ = begin5_;
16736         ++current4_;
16737       }
16738       if (current4_ == end4_) {
16739         current4_ = begin4_;
16740         ++current3_;
16741       }
16742       if (current3_ == end3_) {
16743         current3_ = begin3_;
16744         ++current2_;
16745       }
16746       if (current2_ == end2_) {
16747         current2_ = begin2_;
16748         ++current1_;
16749       }
16750       ComputeCurrentValue();
16751     }
16752     virtual ParamIteratorInterface<ParamType>* Clone() const {
16753       return new Iterator(*this);
16754     }
16755     virtual const ParamType* Current() const { return current_value_.get(); }
16756     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16757       // Having the same base generator guarantees that the other
16758       // iterator is of the same type and we can downcast.
16759       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16760           << "The program attempted to compare iterators "
16761           << "from different generators." << std::endl;
16762       const Iterator* typed_other =
16763           CheckedDowncastToActualType<const Iterator>(&other);
16764       // We must report iterators equal if they both point beyond their
16765       // respective ranges. That can happen in a variety of fashions,
16766       // so we have to consult AtEnd().
16767       return (AtEnd() && typed_other->AtEnd()) ||
16768          (
16769           current1_ == typed_other->current1_ &&
16770           current2_ == typed_other->current2_ &&
16771           current3_ == typed_other->current3_ &&
16772           current4_ == typed_other->current4_ &&
16773           current5_ == typed_other->current5_ &&
16774           current6_ == typed_other->current6_ &&
16775           current7_ == typed_other->current7_ &&
16776           current8_ == typed_other->current8_);
16777     }
16778 
16779    private:
16780     Iterator(const Iterator& other)
16781         : base_(other.base_),
16782         begin1_(other.begin1_),
16783         end1_(other.end1_),
16784         current1_(other.current1_),
16785         begin2_(other.begin2_),
16786         end2_(other.end2_),
16787         current2_(other.current2_),
16788         begin3_(other.begin3_),
16789         end3_(other.end3_),
16790         current3_(other.current3_),
16791         begin4_(other.begin4_),
16792         end4_(other.end4_),
16793         current4_(other.current4_),
16794         begin5_(other.begin5_),
16795         end5_(other.end5_),
16796         current5_(other.current5_),
16797         begin6_(other.begin6_),
16798         end6_(other.end6_),
16799         current6_(other.current6_),
16800         begin7_(other.begin7_),
16801         end7_(other.end7_),
16802         current7_(other.current7_),
16803         begin8_(other.begin8_),
16804         end8_(other.end8_),
16805         current8_(other.current8_) {
16806       ComputeCurrentValue();
16807     }
16808 
16809     void ComputeCurrentValue() {
16810       if (!AtEnd())
16811         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
16812             *current4_, *current5_, *current6_, *current7_, *current8_));
16813     }
16814     bool AtEnd() const {
16815       // We must report iterator past the end of the range when either of the
16816       // component iterators has reached the end of its range.
16817       return
16818           current1_ == end1_ ||
16819           current2_ == end2_ ||
16820           current3_ == end3_ ||
16821           current4_ == end4_ ||
16822           current5_ == end5_ ||
16823           current6_ == end6_ ||
16824           current7_ == end7_ ||
16825           current8_ == end8_;
16826     }
16827 
16828     // No implementation - assignment is unsupported.
16829     void operator=(const Iterator& other);
16830 
16831     const ParamGeneratorInterface<ParamType>* const base_;
16832     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16833     // current[i]_ is the actual traversing iterator.
16834     const typename ParamGenerator<T1>::iterator begin1_;
16835     const typename ParamGenerator<T1>::iterator end1_;
16836     typename ParamGenerator<T1>::iterator current1_;
16837     const typename ParamGenerator<T2>::iterator begin2_;
16838     const typename ParamGenerator<T2>::iterator end2_;
16839     typename ParamGenerator<T2>::iterator current2_;
16840     const typename ParamGenerator<T3>::iterator begin3_;
16841     const typename ParamGenerator<T3>::iterator end3_;
16842     typename ParamGenerator<T3>::iterator current3_;
16843     const typename ParamGenerator<T4>::iterator begin4_;
16844     const typename ParamGenerator<T4>::iterator end4_;
16845     typename ParamGenerator<T4>::iterator current4_;
16846     const typename ParamGenerator<T5>::iterator begin5_;
16847     const typename ParamGenerator<T5>::iterator end5_;
16848     typename ParamGenerator<T5>::iterator current5_;
16849     const typename ParamGenerator<T6>::iterator begin6_;
16850     const typename ParamGenerator<T6>::iterator end6_;
16851     typename ParamGenerator<T6>::iterator current6_;
16852     const typename ParamGenerator<T7>::iterator begin7_;
16853     const typename ParamGenerator<T7>::iterator end7_;
16854     typename ParamGenerator<T7>::iterator current7_;
16855     const typename ParamGenerator<T8>::iterator begin8_;
16856     const typename ParamGenerator<T8>::iterator end8_;
16857     typename ParamGenerator<T8>::iterator current8_;
16858     linked_ptr<ParamType> current_value_;
16859   };  // class CartesianProductGenerator8::Iterator
16860 
16861   // No implementation - assignment is unsupported.
16862   void operator=(const CartesianProductGenerator8& other);
16863 
16864   const ParamGenerator<T1> g1_;
16865   const ParamGenerator<T2> g2_;
16866   const ParamGenerator<T3> g3_;
16867   const ParamGenerator<T4> g4_;
16868   const ParamGenerator<T5> g5_;
16869   const ParamGenerator<T6> g6_;
16870   const ParamGenerator<T7> g7_;
16871   const ParamGenerator<T8> g8_;
16872 };  // class CartesianProductGenerator8
16873 
16874 
16875 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16876     typename T6, typename T7, typename T8, typename T9>
16877 class CartesianProductGenerator9
16878     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16879         T7, T8, T9> > {
16880  public:
16881   typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
16882 
16883   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
16884       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16885       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16886       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
16887       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
16888       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
16889           g9_(g9) {}
16890   virtual ~CartesianProductGenerator9() {}
16891 
16892   virtual ParamIteratorInterface<ParamType>* Begin() const {
16893     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16894         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16895         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
16896   }
16897   virtual ParamIteratorInterface<ParamType>* End() const {
16898     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16899         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
16900         g8_.end(), g9_, g9_.end());
16901   }
16902 
16903  private:
16904   class Iterator : public ParamIteratorInterface<ParamType> {
16905    public:
16906     Iterator(const ParamGeneratorInterface<ParamType>* base,
16907       const ParamGenerator<T1>& g1,
16908       const typename ParamGenerator<T1>::iterator& current1,
16909       const ParamGenerator<T2>& g2,
16910       const typename ParamGenerator<T2>::iterator& current2,
16911       const ParamGenerator<T3>& g3,
16912       const typename ParamGenerator<T3>::iterator& current3,
16913       const ParamGenerator<T4>& g4,
16914       const typename ParamGenerator<T4>::iterator& current4,
16915       const ParamGenerator<T5>& g5,
16916       const typename ParamGenerator<T5>::iterator& current5,
16917       const ParamGenerator<T6>& g6,
16918       const typename ParamGenerator<T6>::iterator& current6,
16919       const ParamGenerator<T7>& g7,
16920       const typename ParamGenerator<T7>::iterator& current7,
16921       const ParamGenerator<T8>& g8,
16922       const typename ParamGenerator<T8>::iterator& current8,
16923       const ParamGenerator<T9>& g9,
16924       const typename ParamGenerator<T9>::iterator& current9)
16925         : base_(base),
16926           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16927           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16928           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16929           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16930           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16931           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16932           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
16933           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
16934           begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
16935       ComputeCurrentValue();
16936     }
16937     virtual ~Iterator() {}
16938 
16939     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16940       return base_;
16941     }
16942     // Advance should not be called on beyond-of-range iterators
16943     // so no component iterators must be beyond end of range, either.
16944     virtual void Advance() {
16945       assert(!AtEnd());
16946       ++current9_;
16947       if (current9_ == end9_) {
16948         current9_ = begin9_;
16949         ++current8_;
16950       }
16951       if (current8_ == end8_) {
16952         current8_ = begin8_;
16953         ++current7_;
16954       }
16955       if (current7_ == end7_) {
16956         current7_ = begin7_;
16957         ++current6_;
16958       }
16959       if (current6_ == end6_) {
16960         current6_ = begin6_;
16961         ++current5_;
16962       }
16963       if (current5_ == end5_) {
16964         current5_ = begin5_;
16965         ++current4_;
16966       }
16967       if (current4_ == end4_) {
16968         current4_ = begin4_;
16969         ++current3_;
16970       }
16971       if (current3_ == end3_) {
16972         current3_ = begin3_;
16973         ++current2_;
16974       }
16975       if (current2_ == end2_) {
16976         current2_ = begin2_;
16977         ++current1_;
16978       }
16979       ComputeCurrentValue();
16980     }
16981     virtual ParamIteratorInterface<ParamType>* Clone() const {
16982       return new Iterator(*this);
16983     }
16984     virtual const ParamType* Current() const { return current_value_.get(); }
16985     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16986       // Having the same base generator guarantees that the other
16987       // iterator is of the same type and we can downcast.
16988       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16989           << "The program attempted to compare iterators "
16990           << "from different generators." << std::endl;
16991       const Iterator* typed_other =
16992           CheckedDowncastToActualType<const Iterator>(&other);
16993       // We must report iterators equal if they both point beyond their
16994       // respective ranges. That can happen in a variety of fashions,
16995       // so we have to consult AtEnd().
16996       return (AtEnd() && typed_other->AtEnd()) ||
16997          (
16998           current1_ == typed_other->current1_ &&
16999           current2_ == typed_other->current2_ &&
17000           current3_ == typed_other->current3_ &&
17001           current4_ == typed_other->current4_ &&
17002           current5_ == typed_other->current5_ &&
17003           current6_ == typed_other->current6_ &&
17004           current7_ == typed_other->current7_ &&
17005           current8_ == typed_other->current8_ &&
17006           current9_ == typed_other->current9_);
17007     }
17008 
17009    private:
17010     Iterator(const Iterator& other)
17011         : base_(other.base_),
17012         begin1_(other.begin1_),
17013         end1_(other.end1_),
17014         current1_(other.current1_),
17015         begin2_(other.begin2_),
17016         end2_(other.end2_),
17017         current2_(other.current2_),
17018         begin3_(other.begin3_),
17019         end3_(other.end3_),
17020         current3_(other.current3_),
17021         begin4_(other.begin4_),
17022         end4_(other.end4_),
17023         current4_(other.current4_),
17024         begin5_(other.begin5_),
17025         end5_(other.end5_),
17026         current5_(other.current5_),
17027         begin6_(other.begin6_),
17028         end6_(other.end6_),
17029         current6_(other.current6_),
17030         begin7_(other.begin7_),
17031         end7_(other.end7_),
17032         current7_(other.current7_),
17033         begin8_(other.begin8_),
17034         end8_(other.end8_),
17035         current8_(other.current8_),
17036         begin9_(other.begin9_),
17037         end9_(other.end9_),
17038         current9_(other.current9_) {
17039       ComputeCurrentValue();
17040     }
17041 
17042     void ComputeCurrentValue() {
17043       if (!AtEnd())
17044         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
17045             *current4_, *current5_, *current6_, *current7_, *current8_,
17046             *current9_));
17047     }
17048     bool AtEnd() const {
17049       // We must report iterator past the end of the range when either of the
17050       // component iterators has reached the end of its range.
17051       return
17052           current1_ == end1_ ||
17053           current2_ == end2_ ||
17054           current3_ == end3_ ||
17055           current4_ == end4_ ||
17056           current5_ == end5_ ||
17057           current6_ == end6_ ||
17058           current7_ == end7_ ||
17059           current8_ == end8_ ||
17060           current9_ == end9_;
17061     }
17062 
17063     // No implementation - assignment is unsupported.
17064     void operator=(const Iterator& other);
17065 
17066     const ParamGeneratorInterface<ParamType>* const base_;
17067     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
17068     // current[i]_ is the actual traversing iterator.
17069     const typename ParamGenerator<T1>::iterator begin1_;
17070     const typename ParamGenerator<T1>::iterator end1_;
17071     typename ParamGenerator<T1>::iterator current1_;
17072     const typename ParamGenerator<T2>::iterator begin2_;
17073     const typename ParamGenerator<T2>::iterator end2_;
17074     typename ParamGenerator<T2>::iterator current2_;
17075     const typename ParamGenerator<T3>::iterator begin3_;
17076     const typename ParamGenerator<T3>::iterator end3_;
17077     typename ParamGenerator<T3>::iterator current3_;
17078     const typename ParamGenerator<T4>::iterator begin4_;
17079     const typename ParamGenerator<T4>::iterator end4_;
17080     typename ParamGenerator<T4>::iterator current4_;
17081     const typename ParamGenerator<T5>::iterator begin5_;
17082     const typename ParamGenerator<T5>::iterator end5_;
17083     typename ParamGenerator<T5>::iterator current5_;
17084     const typename ParamGenerator<T6>::iterator begin6_;
17085     const typename ParamGenerator<T6>::iterator end6_;
17086     typename ParamGenerator<T6>::iterator current6_;
17087     const typename ParamGenerator<T7>::iterator begin7_;
17088     const typename ParamGenerator<T7>::iterator end7_;
17089     typename ParamGenerator<T7>::iterator current7_;
17090     const typename ParamGenerator<T8>::iterator begin8_;
17091     const typename ParamGenerator<T8>::iterator end8_;
17092     typename ParamGenerator<T8>::iterator current8_;
17093     const typename ParamGenerator<T9>::iterator begin9_;
17094     const typename ParamGenerator<T9>::iterator end9_;
17095     typename ParamGenerator<T9>::iterator current9_;
17096     linked_ptr<ParamType> current_value_;
17097   };  // class CartesianProductGenerator9::Iterator
17098 
17099   // No implementation - assignment is unsupported.
17100   void operator=(const CartesianProductGenerator9& other);
17101 
17102   const ParamGenerator<T1> g1_;
17103   const ParamGenerator<T2> g2_;
17104   const ParamGenerator<T3> g3_;
17105   const ParamGenerator<T4> g4_;
17106   const ParamGenerator<T5> g5_;
17107   const ParamGenerator<T6> g6_;
17108   const ParamGenerator<T7> g7_;
17109   const ParamGenerator<T8> g8_;
17110   const ParamGenerator<T9> g9_;
17111 };  // class CartesianProductGenerator9
17112 
17113 
17114 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17115     typename T6, typename T7, typename T8, typename T9, typename T10>
17116 class CartesianProductGenerator10
17117     : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
17118         T7, T8, T9, T10> > {
17119  public:
17120   typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
17121 
17122   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
17123       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
17124       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
17125       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
17126       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
17127       const ParamGenerator<T10>& g10)
17128       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
17129           g9_(g9), g10_(g10) {}
17130   virtual ~CartesianProductGenerator10() {}
17131 
17132   virtual ParamIteratorInterface<ParamType>* Begin() const {
17133     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
17134         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
17135         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
17136   }
17137   virtual ParamIteratorInterface<ParamType>* End() const {
17138     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
17139         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
17140         g8_.end(), g9_, g9_.end(), g10_, g10_.end());
17141   }
17142 
17143  private:
17144   class Iterator : public ParamIteratorInterface<ParamType> {
17145    public:
17146     Iterator(const ParamGeneratorInterface<ParamType>* base,
17147       const ParamGenerator<T1>& g1,
17148       const typename ParamGenerator<T1>::iterator& current1,
17149       const ParamGenerator<T2>& g2,
17150       const typename ParamGenerator<T2>::iterator& current2,
17151       const ParamGenerator<T3>& g3,
17152       const typename ParamGenerator<T3>::iterator& current3,
17153       const ParamGenerator<T4>& g4,
17154       const typename ParamGenerator<T4>::iterator& current4,
17155       const ParamGenerator<T5>& g5,
17156       const typename ParamGenerator<T5>::iterator& current5,
17157       const ParamGenerator<T6>& g6,
17158       const typename ParamGenerator<T6>::iterator& current6,
17159       const ParamGenerator<T7>& g7,
17160       const typename ParamGenerator<T7>::iterator& current7,
17161       const ParamGenerator<T8>& g8,
17162       const typename ParamGenerator<T8>::iterator& current8,
17163       const ParamGenerator<T9>& g9,
17164       const typename ParamGenerator<T9>::iterator& current9,
17165       const ParamGenerator<T10>& g10,
17166       const typename ParamGenerator<T10>::iterator& current10)
17167         : base_(base),
17168           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
17169           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
17170           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
17171           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
17172           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
17173           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
17174           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
17175           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
17176           begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
17177           begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
17178       ComputeCurrentValue();
17179     }
17180     virtual ~Iterator() {}
17181 
17182     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
17183       return base_;
17184     }
17185     // Advance should not be called on beyond-of-range iterators
17186     // so no component iterators must be beyond end of range, either.
17187     virtual void Advance() {
17188       assert(!AtEnd());
17189       ++current10_;
17190       if (current10_ == end10_) {
17191         current10_ = begin10_;
17192         ++current9_;
17193       }
17194       if (current9_ == end9_) {
17195         current9_ = begin9_;
17196         ++current8_;
17197       }
17198       if (current8_ == end8_) {
17199         current8_ = begin8_;
17200         ++current7_;
17201       }
17202       if (current7_ == end7_) {
17203         current7_ = begin7_;
17204         ++current6_;
17205       }
17206       if (current6_ == end6_) {
17207         current6_ = begin6_;
17208         ++current5_;
17209       }
17210       if (current5_ == end5_) {
17211         current5_ = begin5_;
17212         ++current4_;
17213       }
17214       if (current4_ == end4_) {
17215         current4_ = begin4_;
17216         ++current3_;
17217       }
17218       if (current3_ == end3_) {
17219         current3_ = begin3_;
17220         ++current2_;
17221       }
17222       if (current2_ == end2_) {
17223         current2_ = begin2_;
17224         ++current1_;
17225       }
17226       ComputeCurrentValue();
17227     }
17228     virtual ParamIteratorInterface<ParamType>* Clone() const {
17229       return new Iterator(*this);
17230     }
17231     virtual const ParamType* Current() const { return current_value_.get(); }
17232     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
17233       // Having the same base generator guarantees that the other
17234       // iterator is of the same type and we can downcast.
17235       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
17236           << "The program attempted to compare iterators "
17237           << "from different generators." << std::endl;
17238       const Iterator* typed_other =
17239           CheckedDowncastToActualType<const Iterator>(&other);
17240       // We must report iterators equal if they both point beyond their
17241       // respective ranges. That can happen in a variety of fashions,
17242       // so we have to consult AtEnd().
17243       return (AtEnd() && typed_other->AtEnd()) ||
17244          (
17245           current1_ == typed_other->current1_ &&
17246           current2_ == typed_other->current2_ &&
17247           current3_ == typed_other->current3_ &&
17248           current4_ == typed_other->current4_ &&
17249           current5_ == typed_other->current5_ &&
17250           current6_ == typed_other->current6_ &&
17251           current7_ == typed_other->current7_ &&
17252           current8_ == typed_other->current8_ &&
17253           current9_ == typed_other->current9_ &&
17254           current10_ == typed_other->current10_);
17255     }
17256 
17257    private:
17258     Iterator(const Iterator& other)
17259         : base_(other.base_),
17260         begin1_(other.begin1_),
17261         end1_(other.end1_),
17262         current1_(other.current1_),
17263         begin2_(other.begin2_),
17264         end2_(other.end2_),
17265         current2_(other.current2_),
17266         begin3_(other.begin3_),
17267         end3_(other.end3_),
17268         current3_(other.current3_),
17269         begin4_(other.begin4_),
17270         end4_(other.end4_),
17271         current4_(other.current4_),
17272         begin5_(other.begin5_),
17273         end5_(other.end5_),
17274         current5_(other.current5_),
17275         begin6_(other.begin6_),
17276         end6_(other.end6_),
17277         current6_(other.current6_),
17278         begin7_(other.begin7_),
17279         end7_(other.end7_),
17280         current7_(other.current7_),
17281         begin8_(other.begin8_),
17282         end8_(other.end8_),
17283         current8_(other.current8_),
17284         begin9_(other.begin9_),
17285         end9_(other.end9_),
17286         current9_(other.current9_),
17287         begin10_(other.begin10_),
17288         end10_(other.end10_),
17289         current10_(other.current10_) {
17290       ComputeCurrentValue();
17291     }
17292 
17293     void ComputeCurrentValue() {
17294       if (!AtEnd())
17295         current_value_.reset(new ParamType(*current1_, *current2_, *current3_,
17296             *current4_, *current5_, *current6_, *current7_, *current8_,
17297             *current9_, *current10_));
17298     }
17299     bool AtEnd() const {
17300       // We must report iterator past the end of the range when either of the
17301       // component iterators has reached the end of its range.
17302       return
17303           current1_ == end1_ ||
17304           current2_ == end2_ ||
17305           current3_ == end3_ ||
17306           current4_ == end4_ ||
17307           current5_ == end5_ ||
17308           current6_ == end6_ ||
17309           current7_ == end7_ ||
17310           current8_ == end8_ ||
17311           current9_ == end9_ ||
17312           current10_ == end10_;
17313     }
17314 
17315     // No implementation - assignment is unsupported.
17316     void operator=(const Iterator& other);
17317 
17318     const ParamGeneratorInterface<ParamType>* const base_;
17319     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
17320     // current[i]_ is the actual traversing iterator.
17321     const typename ParamGenerator<T1>::iterator begin1_;
17322     const typename ParamGenerator<T1>::iterator end1_;
17323     typename ParamGenerator<T1>::iterator current1_;
17324     const typename ParamGenerator<T2>::iterator begin2_;
17325     const typename ParamGenerator<T2>::iterator end2_;
17326     typename ParamGenerator<T2>::iterator current2_;
17327     const typename ParamGenerator<T3>::iterator begin3_;
17328     const typename ParamGenerator<T3>::iterator end3_;
17329     typename ParamGenerator<T3>::iterator current3_;
17330     const typename ParamGenerator<T4>::iterator begin4_;
17331     const typename ParamGenerator<T4>::iterator end4_;
17332     typename ParamGenerator<T4>::iterator current4_;
17333     const typename ParamGenerator<T5>::iterator begin5_;
17334     const typename ParamGenerator<T5>::iterator end5_;
17335     typename ParamGenerator<T5>::iterator current5_;
17336     const typename ParamGenerator<T6>::iterator begin6_;
17337     const typename ParamGenerator<T6>::iterator end6_;
17338     typename ParamGenerator<T6>::iterator current6_;
17339     const typename ParamGenerator<T7>::iterator begin7_;
17340     const typename ParamGenerator<T7>::iterator end7_;
17341     typename ParamGenerator<T7>::iterator current7_;
17342     const typename ParamGenerator<T8>::iterator begin8_;
17343     const typename ParamGenerator<T8>::iterator end8_;
17344     typename ParamGenerator<T8>::iterator current8_;
17345     const typename ParamGenerator<T9>::iterator begin9_;
17346     const typename ParamGenerator<T9>::iterator end9_;
17347     typename ParamGenerator<T9>::iterator current9_;
17348     const typename ParamGenerator<T10>::iterator begin10_;
17349     const typename ParamGenerator<T10>::iterator end10_;
17350     typename ParamGenerator<T10>::iterator current10_;
17351     linked_ptr<ParamType> current_value_;
17352   };  // class CartesianProductGenerator10::Iterator
17353 
17354   // No implementation - assignment is unsupported.
17355   void operator=(const CartesianProductGenerator10& other);
17356 
17357   const ParamGenerator<T1> g1_;
17358   const ParamGenerator<T2> g2_;
17359   const ParamGenerator<T3> g3_;
17360   const ParamGenerator<T4> g4_;
17361   const ParamGenerator<T5> g5_;
17362   const ParamGenerator<T6> g6_;
17363   const ParamGenerator<T7> g7_;
17364   const ParamGenerator<T8> g8_;
17365   const ParamGenerator<T9> g9_;
17366   const ParamGenerator<T10> g10_;
17367 };  // class CartesianProductGenerator10
17368 
17369 
17370 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17371 //
17372 // Helper classes providing Combine() with polymorphic features. They allow
17373 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
17374 // convertible to U.
17375 //
17376 template <class Generator1, class Generator2>
17377 class CartesianProductHolder2 {
17378  public:
17379 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
17380       : g1_(g1), g2_(g2) {}
17381   template <typename T1, typename T2>
17382   operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
17383     return ParamGenerator< ::testing::tuple<T1, T2> >(
17384         new CartesianProductGenerator2<T1, T2>(
17385         static_cast<ParamGenerator<T1> >(g1_),
17386         static_cast<ParamGenerator<T2> >(g2_)));
17387   }
17388 
17389  private:
17390   // No implementation - assignment is unsupported.
17391   void operator=(const CartesianProductHolder2& other);
17392 
17393   const Generator1 g1_;
17394   const Generator2 g2_;
17395 };  // class CartesianProductHolder2
17396 
17397 template <class Generator1, class Generator2, class Generator3>
17398 class CartesianProductHolder3 {
17399  public:
17400 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
17401     const Generator3& g3)
17402       : g1_(g1), g2_(g2), g3_(g3) {}
17403   template <typename T1, typename T2, typename T3>
17404   operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
17405     return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
17406         new CartesianProductGenerator3<T1, T2, T3>(
17407         static_cast<ParamGenerator<T1> >(g1_),
17408         static_cast<ParamGenerator<T2> >(g2_),
17409         static_cast<ParamGenerator<T3> >(g3_)));
17410   }
17411 
17412  private:
17413   // No implementation - assignment is unsupported.
17414   void operator=(const CartesianProductHolder3& other);
17415 
17416   const Generator1 g1_;
17417   const Generator2 g2_;
17418   const Generator3 g3_;
17419 };  // class CartesianProductHolder3
17420 
17421 template <class Generator1, class Generator2, class Generator3,
17422     class Generator4>
17423 class CartesianProductHolder4 {
17424  public:
17425 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
17426     const Generator3& g3, const Generator4& g4)
17427       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
17428   template <typename T1, typename T2, typename T3, typename T4>
17429   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
17430     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
17431         new CartesianProductGenerator4<T1, T2, T3, T4>(
17432         static_cast<ParamGenerator<T1> >(g1_),
17433         static_cast<ParamGenerator<T2> >(g2_),
17434         static_cast<ParamGenerator<T3> >(g3_),
17435         static_cast<ParamGenerator<T4> >(g4_)));
17436   }
17437 
17438  private:
17439   // No implementation - assignment is unsupported.
17440   void operator=(const CartesianProductHolder4& other);
17441 
17442   const Generator1 g1_;
17443   const Generator2 g2_;
17444   const Generator3 g3_;
17445   const Generator4 g4_;
17446 };  // class CartesianProductHolder4
17447 
17448 template <class Generator1, class Generator2, class Generator3,
17449     class Generator4, class Generator5>
17450 class CartesianProductHolder5 {
17451  public:
17452 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
17453     const Generator3& g3, const Generator4& g4, const Generator5& g5)
17454       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
17455   template <typename T1, typename T2, typename T3, typename T4, typename T5>
17456   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
17457     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
17458         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
17459         static_cast<ParamGenerator<T1> >(g1_),
17460         static_cast<ParamGenerator<T2> >(g2_),
17461         static_cast<ParamGenerator<T3> >(g3_),
17462         static_cast<ParamGenerator<T4> >(g4_),
17463         static_cast<ParamGenerator<T5> >(g5_)));
17464   }
17465 
17466  private:
17467   // No implementation - assignment is unsupported.
17468   void operator=(const CartesianProductHolder5& other);
17469 
17470   const Generator1 g1_;
17471   const Generator2 g2_;
17472   const Generator3 g3_;
17473   const Generator4 g4_;
17474   const Generator5 g5_;
17475 };  // class CartesianProductHolder5
17476 
17477 template <class Generator1, class Generator2, class Generator3,
17478     class Generator4, class Generator5, class Generator6>
17479 class CartesianProductHolder6 {
17480  public:
17481 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
17482     const Generator3& g3, const Generator4& g4, const Generator5& g5,
17483     const Generator6& g6)
17484       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
17485   template <typename T1, typename T2, typename T3, typename T4, typename T5,
17486       typename T6>
17487   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
17488     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
17489         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
17490         static_cast<ParamGenerator<T1> >(g1_),
17491         static_cast<ParamGenerator<T2> >(g2_),
17492         static_cast<ParamGenerator<T3> >(g3_),
17493         static_cast<ParamGenerator<T4> >(g4_),
17494         static_cast<ParamGenerator<T5> >(g5_),
17495         static_cast<ParamGenerator<T6> >(g6_)));
17496   }
17497 
17498  private:
17499   // No implementation - assignment is unsupported.
17500   void operator=(const CartesianProductHolder6& other);
17501 
17502   const Generator1 g1_;
17503   const Generator2 g2_;
17504   const Generator3 g3_;
17505   const Generator4 g4_;
17506   const Generator5 g5_;
17507   const Generator6 g6_;
17508 };  // class CartesianProductHolder6
17509 
17510 template <class Generator1, class Generator2, class Generator3,
17511     class Generator4, class Generator5, class Generator6, class Generator7>
17512 class CartesianProductHolder7 {
17513  public:
17514 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
17515     const Generator3& g3, const Generator4& g4, const Generator5& g5,
17516     const Generator6& g6, const Generator7& g7)
17517       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
17518   template <typename T1, typename T2, typename T3, typename T4, typename T5,
17519       typename T6, typename T7>
17520   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
17521       T7> >() const {
17522     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
17523         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
17524         static_cast<ParamGenerator<T1> >(g1_),
17525         static_cast<ParamGenerator<T2> >(g2_),
17526         static_cast<ParamGenerator<T3> >(g3_),
17527         static_cast<ParamGenerator<T4> >(g4_),
17528         static_cast<ParamGenerator<T5> >(g5_),
17529         static_cast<ParamGenerator<T6> >(g6_),
17530         static_cast<ParamGenerator<T7> >(g7_)));
17531   }
17532 
17533  private:
17534   // No implementation - assignment is unsupported.
17535   void operator=(const CartesianProductHolder7& other);
17536 
17537   const Generator1 g1_;
17538   const Generator2 g2_;
17539   const Generator3 g3_;
17540   const Generator4 g4_;
17541   const Generator5 g5_;
17542   const Generator6 g6_;
17543   const Generator7 g7_;
17544 };  // class CartesianProductHolder7
17545 
17546 template <class Generator1, class Generator2, class Generator3,
17547     class Generator4, class Generator5, class Generator6, class Generator7,
17548     class Generator8>
17549 class CartesianProductHolder8 {
17550  public:
17551 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
17552     const Generator3& g3, const Generator4& g4, const Generator5& g5,
17553     const Generator6& g6, const Generator7& g7, const Generator8& g8)
17554       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
17555           g8_(g8) {}
17556   template <typename T1, typename T2, typename T3, typename T4, typename T5,
17557       typename T6, typename T7, typename T8>
17558   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
17559       T8> >() const {
17560     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
17561         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
17562         static_cast<ParamGenerator<T1> >(g1_),
17563         static_cast<ParamGenerator<T2> >(g2_),
17564         static_cast<ParamGenerator<T3> >(g3_),
17565         static_cast<ParamGenerator<T4> >(g4_),
17566         static_cast<ParamGenerator<T5> >(g5_),
17567         static_cast<ParamGenerator<T6> >(g6_),
17568         static_cast<ParamGenerator<T7> >(g7_),
17569         static_cast<ParamGenerator<T8> >(g8_)));
17570   }
17571 
17572  private:
17573   // No implementation - assignment is unsupported.
17574   void operator=(const CartesianProductHolder8& other);
17575 
17576   const Generator1 g1_;
17577   const Generator2 g2_;
17578   const Generator3 g3_;
17579   const Generator4 g4_;
17580   const Generator5 g5_;
17581   const Generator6 g6_;
17582   const Generator7 g7_;
17583   const Generator8 g8_;
17584 };  // class CartesianProductHolder8
17585 
17586 template <class Generator1, class Generator2, class Generator3,
17587     class Generator4, class Generator5, class Generator6, class Generator7,
17588     class Generator8, class Generator9>
17589 class CartesianProductHolder9 {
17590  public:
17591 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
17592     const Generator3& g3, const Generator4& g4, const Generator5& g5,
17593     const Generator6& g6, const Generator7& g7, const Generator8& g8,
17594     const Generator9& g9)
17595       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
17596           g9_(g9) {}
17597   template <typename T1, typename T2, typename T3, typename T4, typename T5,
17598       typename T6, typename T7, typename T8, typename T9>
17599   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
17600       T9> >() const {
17601     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
17602         T9> >(
17603         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
17604         static_cast<ParamGenerator<T1> >(g1_),
17605         static_cast<ParamGenerator<T2> >(g2_),
17606         static_cast<ParamGenerator<T3> >(g3_),
17607         static_cast<ParamGenerator<T4> >(g4_),
17608         static_cast<ParamGenerator<T5> >(g5_),
17609         static_cast<ParamGenerator<T6> >(g6_),
17610         static_cast<ParamGenerator<T7> >(g7_),
17611         static_cast<ParamGenerator<T8> >(g8_),
17612         static_cast<ParamGenerator<T9> >(g9_)));
17613   }
17614 
17615  private:
17616   // No implementation - assignment is unsupported.
17617   void operator=(const CartesianProductHolder9& other);
17618 
17619   const Generator1 g1_;
17620   const Generator2 g2_;
17621   const Generator3 g3_;
17622   const Generator4 g4_;
17623   const Generator5 g5_;
17624   const Generator6 g6_;
17625   const Generator7 g7_;
17626   const Generator8 g8_;
17627   const Generator9 g9_;
17628 };  // class CartesianProductHolder9
17629 
17630 template <class Generator1, class Generator2, class Generator3,
17631     class Generator4, class Generator5, class Generator6, class Generator7,
17632     class Generator8, class Generator9, class Generator10>
17633 class CartesianProductHolder10 {
17634  public:
17635 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
17636     const Generator3& g3, const Generator4& g4, const Generator5& g5,
17637     const Generator6& g6, const Generator7& g7, const Generator8& g8,
17638     const Generator9& g9, const Generator10& g10)
17639       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
17640           g9_(g9), g10_(g10) {}
17641   template <typename T1, typename T2, typename T3, typename T4, typename T5,
17642       typename T6, typename T7, typename T8, typename T9, typename T10>
17643   operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17644       T10> >() const {
17645     return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17646         T10> >(
17647         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
17648             T10>(
17649         static_cast<ParamGenerator<T1> >(g1_),
17650         static_cast<ParamGenerator<T2> >(g2_),
17651         static_cast<ParamGenerator<T3> >(g3_),
17652         static_cast<ParamGenerator<T4> >(g4_),
17653         static_cast<ParamGenerator<T5> >(g5_),
17654         static_cast<ParamGenerator<T6> >(g6_),
17655         static_cast<ParamGenerator<T7> >(g7_),
17656         static_cast<ParamGenerator<T8> >(g8_),
17657         static_cast<ParamGenerator<T9> >(g9_),
17658         static_cast<ParamGenerator<T10> >(g10_)));
17659   }
17660 
17661  private:
17662   // No implementation - assignment is unsupported.
17663   void operator=(const CartesianProductHolder10& other);
17664 
17665   const Generator1 g1_;
17666   const Generator2 g2_;
17667   const Generator3 g3_;
17668   const Generator4 g4_;
17669   const Generator5 g5_;
17670   const Generator6 g6_;
17671   const Generator7 g7_;
17672   const Generator8 g8_;
17673   const Generator9 g9_;
17674   const Generator10 g10_;
17675 };  // class CartesianProductHolder10
17676 
17677 # endif  // GTEST_HAS_COMBINE
17678 
17679 }  // namespace internal
17680 }  // namespace testing
17681 
17682 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
17683 
17684 namespace testing {
17685 
17686 // Functions producing parameter generators.
17687 //
17688 // Google Test uses these generators to produce parameters for value-
17689 // parameterized tests. When a parameterized test case is instantiated
17690 // with a particular generator, Google Test creates and runs tests
17691 // for each element in the sequence produced by the generator.
17692 //
17693 // In the following sample, tests from test case FooTest are instantiated
17694 // each three times with parameter values 3, 5, and 8:
17695 //
17696 // class FooTest : public TestWithParam<int> { ... };
17697 //
17698 // TEST_P(FooTest, TestThis) {
17699 // }
17700 // TEST_P(FooTest, TestThat) {
17701 // }
17702 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
17703 //
17704 
17705 // Range() returns generators providing sequences of values in a range.
17706 //
17707 // Synopsis:
17708 // Range(start, end)
17709 //   - returns a generator producing a sequence of values {start, start+1,
17710 //     start+2, ..., }.
17711 // Range(start, end, step)
17712 //   - returns a generator producing a sequence of values {start, start+step,
17713 //     start+step+step, ..., }.
17714 // Notes:
17715 //   * The generated sequences never include end. For example, Range(1, 5)
17716 //     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
17717 //     returns a generator producing {1, 3, 5, 7}.
17718 //   * start and end must have the same type. That type may be any integral or
17719 //     floating-point type or a user defined type satisfying these conditions:
17720 //     * It must be assignable (have operator=() defined).
17721 //     * It must have operator+() (operator+(int-compatible type) for
17722 //       two-operand version).
17723 //     * It must have operator<() defined.
17724 //     Elements in the resulting sequences will also have that type.
17725 //   * Condition start < end must be satisfied in order for resulting sequences
17726 //     to contain any elements.
17727 //
17728 template <typename T, typename IncrementT>
17729 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
17730   return internal::ParamGenerator<T>(
17731       new internal::RangeGenerator<T, IncrementT>(start, end, step));
17732 }
17733 
17734 template <typename T>
17735 internal::ParamGenerator<T> Range(T start, T end) {
17736   return Range(start, end, 1);
17737 }
17738 
17739 // ValuesIn() function allows generation of tests with parameters coming from
17740 // a container.
17741 //
17742 // Synopsis:
17743 // ValuesIn(const T (&array)[N])
17744 //   - returns a generator producing sequences with elements from
17745 //     a C-style array.
17746 // ValuesIn(const Container& container)
17747 //   - returns a generator producing sequences with elements from
17748 //     an STL-style container.
17749 // ValuesIn(Iterator begin, Iterator end)
17750 //   - returns a generator producing sequences with elements from
17751 //     a range [begin, end) defined by a pair of STL-style iterators. These
17752 //     iterators can also be plain C pointers.
17753 //
17754 // Please note that ValuesIn copies the values from the containers
17755 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
17756 //
17757 // Examples:
17758 //
17759 // This instantiates tests from test case StringTest
17760 // each with C-string values of "foo", "bar", and "baz":
17761 //
17762 // const char* strings[] = {"foo", "bar", "baz"};
17763 // INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));
17764 //
17765 // This instantiates tests from test case StlStringTest
17766 // each with STL strings with values "a" and "b":
17767 //
17768 // ::std::vector< ::std::string> GetParameterStrings() {
17769 //   ::std::vector< ::std::string> v;
17770 //   v.push_back("a");
17771 //   v.push_back("b");
17772 //   return v;
17773 // }
17774 //
17775 // INSTANTIATE_TEST_CASE_P(CharSequence,
17776 //                         StlStringTest,
17777 //                         ValuesIn(GetParameterStrings()));
17778 //
17779 //
17780 // This will also instantiate tests from CharTest
17781 // each with parameter values 'a' and 'b':
17782 //
17783 // ::std::list<char> GetParameterChars() {
17784 //   ::std::list<char> list;
17785 //   list.push_back('a');
17786 //   list.push_back('b');
17787 //   return list;
17788 // }
17789 // ::std::list<char> l = GetParameterChars();
17790 // INSTANTIATE_TEST_CASE_P(CharSequence2,
17791 //                         CharTest,
17792 //                         ValuesIn(l.begin(), l.end()));
17793 //
17794 template <typename ForwardIterator>
17795 internal::ParamGenerator<
17796   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
17797 ValuesIn(ForwardIterator begin, ForwardIterator end) {
17798   typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
17799       ::value_type ParamType;
17800   return internal::ParamGenerator<ParamType>(
17801       new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
17802 }
17803 
17804 template <typename T, size_t N>
17805 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
17806   return ValuesIn(array, array + N);
17807 }
17808 
17809 template <class Container>
17810 internal::ParamGenerator<typename Container::value_type> ValuesIn(
17811     const Container& container) {
17812   return ValuesIn(container.begin(), container.end());
17813 }
17814 
17815 // Values() allows generating tests from explicitly specified list of
17816 // parameters.
17817 //
17818 // Synopsis:
17819 // Values(T v1, T v2, ..., T vN)
17820 //   - returns a generator producing sequences with elements v1, v2, ..., vN.
17821 //
17822 // For example, this instantiates tests from test case BarTest each
17823 // with values "one", "two", and "three":
17824 //
17825 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
17826 //
17827 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
17828 // The exact type of values will depend on the type of parameter in BazTest.
17829 //
17830 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
17831 //
17832 // Currently, Values() supports from 1 to 50 parameters.
17833 //
17834 template <typename T1>
17835 internal::ValueArray1<T1> Values(T1 v1) {
17836   return internal::ValueArray1<T1>(v1);
17837 }
17838 
17839 template <typename T1, typename T2>
17840 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
17841   return internal::ValueArray2<T1, T2>(v1, v2);
17842 }
17843 
17844 template <typename T1, typename T2, typename T3>
17845 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
17846   return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
17847 }
17848 
17849 template <typename T1, typename T2, typename T3, typename T4>
17850 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
17851   return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
17852 }
17853 
17854 template <typename T1, typename T2, typename T3, typename T4, typename T5>
17855 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17856     T5 v5) {
17857   return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
17858 }
17859 
17860 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17861     typename T6>
17862 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
17863     T4 v4, T5 v5, T6 v6) {
17864   return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
17865 }
17866 
17867 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17868     typename T6, typename T7>
17869 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
17870     T4 v4, T5 v5, T6 v6, T7 v7) {
17871   return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
17872       v6, v7);
17873 }
17874 
17875 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17876     typename T6, typename T7, typename T8>
17877 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
17878     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
17879   return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
17880       v5, v6, v7, v8);
17881 }
17882 
17883 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17884     typename T6, typename T7, typename T8, typename T9>
17885 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
17886     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
17887   return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
17888       v4, v5, v6, v7, v8, v9);
17889 }
17890 
17891 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17892     typename T6, typename T7, typename T8, typename T9, typename T10>
17893 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
17894     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
17895   return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
17896       v2, v3, v4, v5, v6, v7, v8, v9, v10);
17897 }
17898 
17899 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17900     typename T6, typename T7, typename T8, typename T9, typename T10,
17901     typename T11>
17902 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
17903     T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17904     T10 v10, T11 v11) {
17905   return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
17906       T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
17907 }
17908 
17909 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17910     typename T6, typename T7, typename T8, typename T9, typename T10,
17911     typename T11, typename T12>
17912 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17913     T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17914     T10 v10, T11 v11, T12 v12) {
17915   return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17916       T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
17917 }
17918 
17919 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17920     typename T6, typename T7, typename T8, typename T9, typename T10,
17921     typename T11, typename T12, typename T13>
17922 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
17923     T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17924     T10 v10, T11 v11, T12 v12, T13 v13) {
17925   return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17926       T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
17927 }
17928 
17929 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17930     typename T6, typename T7, typename T8, typename T9, typename T10,
17931     typename T11, typename T12, typename T13, typename T14>
17932 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17933     T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17934     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
17935   return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17936       T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
17937       v14);
17938 }
17939 
17940 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17941     typename T6, typename T7, typename T8, typename T9, typename T10,
17942     typename T11, typename T12, typename T13, typename T14, typename T15>
17943 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17944     T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
17945     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
17946   return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17947       T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
17948       v13, v14, v15);
17949 }
17950 
17951 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17952     typename T6, typename T7, typename T8, typename T9, typename T10,
17953     typename T11, typename T12, typename T13, typename T14, typename T15,
17954     typename T16>
17955 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17956     T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17957     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17958     T16 v16) {
17959   return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17960       T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
17961       v12, v13, v14, v15, v16);
17962 }
17963 
17964 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17965     typename T6, typename T7, typename T8, typename T9, typename T10,
17966     typename T11, typename T12, typename T13, typename T14, typename T15,
17967     typename T16, typename T17>
17968 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17969     T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17970     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17971     T16 v16, T17 v17) {
17972   return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17973       T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
17974       v11, v12, v13, v14, v15, v16, v17);
17975 }
17976 
17977 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17978     typename T6, typename T7, typename T8, typename T9, typename T10,
17979     typename T11, typename T12, typename T13, typename T14, typename T15,
17980     typename T16, typename T17, typename T18>
17981 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17982     T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
17983     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17984     T16 v16, T17 v17, T18 v18) {
17985   return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17986       T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
17987       v10, v11, v12, v13, v14, v15, v16, v17, v18);
17988 }
17989 
17990 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17991     typename T6, typename T7, typename T8, typename T9, typename T10,
17992     typename T11, typename T12, typename T13, typename T14, typename T15,
17993     typename T16, typename T17, typename T18, typename T19>
17994 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17995     T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
17996     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
17997     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
17998   return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17999       T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
18000       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
18001 }
18002 
18003 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18004     typename T6, typename T7, typename T8, typename T9, typename T10,
18005     typename T11, typename T12, typename T13, typename T14, typename T15,
18006     typename T16, typename T17, typename T18, typename T19, typename T20>
18007 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18008     T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18009     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18010     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
18011   return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18012       T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
18013       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
18014 }
18015 
18016 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18017     typename T6, typename T7, typename T8, typename T9, typename T10,
18018     typename T11, typename T12, typename T13, typename T14, typename T15,
18019     typename T16, typename T17, typename T18, typename T19, typename T20,
18020     typename T21>
18021 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18022     T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18023     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18024     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
18025   return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18026       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
18027       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
18028 }
18029 
18030 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18031     typename T6, typename T7, typename T8, typename T9, typename T10,
18032     typename T11, typename T12, typename T13, typename T14, typename T15,
18033     typename T16, typename T17, typename T18, typename T19, typename T20,
18034     typename T21, typename T22>
18035 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18036     T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
18037     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18038     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18039     T21 v21, T22 v22) {
18040   return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18041       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
18042       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18043       v20, v21, v22);
18044 }
18045 
18046 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18047     typename T6, typename T7, typename T8, typename T9, typename T10,
18048     typename T11, typename T12, typename T13, typename T14, typename T15,
18049     typename T16, typename T17, typename T18, typename T19, typename T20,
18050     typename T21, typename T22, typename T23>
18051 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18052     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
18053     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18054     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18055     T21 v21, T22 v22, T23 v23) {
18056   return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18057       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
18058       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18059       v20, v21, v22, v23);
18060 }
18061 
18062 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18063     typename T6, typename T7, typename T8, typename T9, typename T10,
18064     typename T11, typename T12, typename T13, typename T14, typename T15,
18065     typename T16, typename T17, typename T18, typename T19, typename T20,
18066     typename T21, typename T22, typename T23, typename T24>
18067 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18068     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
18069     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18070     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18071     T21 v21, T22 v22, T23 v23, T24 v24) {
18072   return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18073       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
18074       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
18075       v19, v20, v21, v22, v23, v24);
18076 }
18077 
18078 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18079     typename T6, typename T7, typename T8, typename T9, typename T10,
18080     typename T11, typename T12, typename T13, typename T14, typename T15,
18081     typename T16, typename T17, typename T18, typename T19, typename T20,
18082     typename T21, typename T22, typename T23, typename T24, typename T25>
18083 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18084     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
18085     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
18086     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
18087     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
18088   return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18089       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
18090       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
18091       v18, v19, v20, v21, v22, v23, v24, v25);
18092 }
18093 
18094 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18095     typename T6, typename T7, typename T8, typename T9, typename T10,
18096     typename T11, typename T12, typename T13, typename T14, typename T15,
18097     typename T16, typename T17, typename T18, typename T19, typename T20,
18098     typename T21, typename T22, typename T23, typename T24, typename T25,
18099     typename T26>
18100 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18101     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18102     T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18103     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18104     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18105     T26 v26) {
18106   return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18107       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18108       T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
18109       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
18110 }
18111 
18112 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18113     typename T6, typename T7, typename T8, typename T9, typename T10,
18114     typename T11, typename T12, typename T13, typename T14, typename T15,
18115     typename T16, typename T17, typename T18, typename T19, typename T20,
18116     typename T21, typename T22, typename T23, typename T24, typename T25,
18117     typename T26, typename T27>
18118 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18119     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
18120     T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18121     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18122     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18123     T26 v26, T27 v27) {
18124   return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18125       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18126       T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
18127       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
18128 }
18129 
18130 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18131     typename T6, typename T7, typename T8, typename T9, typename T10,
18132     typename T11, typename T12, typename T13, typename T14, typename T15,
18133     typename T16, typename T17, typename T18, typename T19, typename T20,
18134     typename T21, typename T22, typename T23, typename T24, typename T25,
18135     typename T26, typename T27, typename T28>
18136 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18137     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
18138     T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18139     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18140     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18141     T26 v26, T27 v27, T28 v28) {
18142   return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18143       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18144       T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
18145       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
18146       v28);
18147 }
18148 
18149 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18150     typename T6, typename T7, typename T8, typename T9, typename T10,
18151     typename T11, typename T12, typename T13, typename T14, typename T15,
18152     typename T16, typename T17, typename T18, typename T19, typename T20,
18153     typename T21, typename T22, typename T23, typename T24, typename T25,
18154     typename T26, typename T27, typename T28, typename T29>
18155 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18156     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18157     T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18158     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18159     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18160     T26 v26, T27 v27, T28 v28, T29 v29) {
18161   return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18162       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18163       T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
18164       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
18165       v27, v28, v29);
18166 }
18167 
18168 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18169     typename T6, typename T7, typename T8, typename T9, typename T10,
18170     typename T11, typename T12, typename T13, typename T14, typename T15,
18171     typename T16, typename T17, typename T18, typename T19, typename T20,
18172     typename T21, typename T22, typename T23, typename T24, typename T25,
18173     typename T26, typename T27, typename T28, typename T29, typename T30>
18174 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18175     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18176     T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
18177     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
18178     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
18179     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
18180   return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18181       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18182       T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
18183       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
18184       v26, v27, v28, v29, v30);
18185 }
18186 
18187 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18188     typename T6, typename T7, typename T8, typename T9, typename T10,
18189     typename T11, typename T12, typename T13, typename T14, typename T15,
18190     typename T16, typename T17, typename T18, typename T19, typename T20,
18191     typename T21, typename T22, typename T23, typename T24, typename T25,
18192     typename T26, typename T27, typename T28, typename T29, typename T30,
18193     typename T31>
18194 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18195     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18196     T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18197     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18198     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18199     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
18200   return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18201       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18202       T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
18203       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
18204       v25, v26, v27, v28, v29, v30, v31);
18205 }
18206 
18207 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18208     typename T6, typename T7, typename T8, typename T9, typename T10,
18209     typename T11, typename T12, typename T13, typename T14, typename T15,
18210     typename T16, typename T17, typename T18, typename T19, typename T20,
18211     typename T21, typename T22, typename T23, typename T24, typename T25,
18212     typename T26, typename T27, typename T28, typename T29, typename T30,
18213     typename T31, typename T32>
18214 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18215     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18216     T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18217     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18218     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18219     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18220     T32 v32) {
18221   return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18222       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18223       T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
18224       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18225       v24, v25, v26, v27, v28, v29, v30, v31, v32);
18226 }
18227 
18228 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18229     typename T6, typename T7, typename T8, typename T9, typename T10,
18230     typename T11, typename T12, typename T13, typename T14, typename T15,
18231     typename T16, typename T17, typename T18, typename T19, typename T20,
18232     typename T21, typename T22, typename T23, typename T24, typename T25,
18233     typename T26, typename T27, typename T28, typename T29, typename T30,
18234     typename T31, typename T32, typename T33>
18235 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18236     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18237     T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
18238     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18239     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18240     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18241     T32 v32, T33 v33) {
18242   return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18243       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18244       T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
18245       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18246       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
18247 }
18248 
18249 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18250     typename T6, typename T7, typename T8, typename T9, typename T10,
18251     typename T11, typename T12, typename T13, typename T14, typename T15,
18252     typename T16, typename T17, typename T18, typename T19, typename T20,
18253     typename T21, typename T22, typename T23, typename T24, typename T25,
18254     typename T26, typename T27, typename T28, typename T29, typename T30,
18255     typename T31, typename T32, typename T33, typename T34>
18256 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18257     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18258     T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
18259     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
18260     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
18261     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
18262     T31 v31, T32 v32, T33 v33, T34 v34) {
18263   return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18264       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18265       T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
18266       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
18267       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
18268 }
18269 
18270 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18271     typename T6, typename T7, typename T8, typename T9, typename T10,
18272     typename T11, typename T12, typename T13, typename T14, typename T15,
18273     typename T16, typename T17, typename T18, typename T19, typename T20,
18274     typename T21, typename T22, typename T23, typename T24, typename T25,
18275     typename T26, typename T27, typename T28, typename T29, typename T30,
18276     typename T31, typename T32, typename T33, typename T34, typename T35>
18277 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18278     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18279     T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18280     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18281     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
18282     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
18283     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
18284   return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18285       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18286       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
18287       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
18288       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
18289 }
18290 
18291 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18292     typename T6, typename T7, typename T8, typename T9, typename T10,
18293     typename T11, typename T12, typename T13, typename T14, typename T15,
18294     typename T16, typename T17, typename T18, typename T19, typename T20,
18295     typename T21, typename T22, typename T23, typename T24, typename T25,
18296     typename T26, typename T27, typename T28, typename T29, typename T30,
18297     typename T31, typename T32, typename T33, typename T34, typename T35,
18298     typename T36>
18299 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18300     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18301     T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18302     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18303     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
18304     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
18305     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
18306   return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18307       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18308       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
18309       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18310       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
18311       v34, v35, v36);
18312 }
18313 
18314 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18315     typename T6, typename T7, typename T8, typename T9, typename T10,
18316     typename T11, typename T12, typename T13, typename T14, typename T15,
18317     typename T16, typename T17, typename T18, typename T19, typename T20,
18318     typename T21, typename T22, typename T23, typename T24, typename T25,
18319     typename T26, typename T27, typename T28, typename T29, typename T30,
18320     typename T31, typename T32, typename T33, typename T34, typename T35,
18321     typename T36, typename T37>
18322 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18323     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18324     T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
18325     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18326     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18327     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
18328     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
18329     T37 v37) {
18330   return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18331       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18332       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
18333       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18334       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
18335       v34, v35, v36, v37);
18336 }
18337 
18338 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18339     typename T6, typename T7, typename T8, typename T9, typename T10,
18340     typename T11, typename T12, typename T13, typename T14, typename T15,
18341     typename T16, typename T17, typename T18, typename T19, typename T20,
18342     typename T21, typename T22, typename T23, typename T24, typename T25,
18343     typename T26, typename T27, typename T28, typename T29, typename T30,
18344     typename T31, typename T32, typename T33, typename T34, typename T35,
18345     typename T36, typename T37, typename T38>
18346 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18347     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18348     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
18349     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18350     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18351     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
18352     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
18353     T37 v37, T38 v38) {
18354   return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18355       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18356       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
18357       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
18358       v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
18359       v33, v34, v35, v36, v37, v38);
18360 }
18361 
18362 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18363     typename T6, typename T7, typename T8, typename T9, typename T10,
18364     typename T11, typename T12, typename T13, typename T14, typename T15,
18365     typename T16, typename T17, typename T18, typename T19, typename T20,
18366     typename T21, typename T22, typename T23, typename T24, typename T25,
18367     typename T26, typename T27, typename T28, typename T29, typename T30,
18368     typename T31, typename T32, typename T33, typename T34, typename T35,
18369     typename T36, typename T37, typename T38, typename T39>
18370 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18371     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18372     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
18373     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
18374     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
18375     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
18376     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
18377     T37 v37, T38 v38, T39 v39) {
18378   return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18379       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18380       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
18381       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
18382       v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
18383       v32, v33, v34, v35, v36, v37, v38, v39);
18384 }
18385 
18386 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18387     typename T6, typename T7, typename T8, typename T9, typename T10,
18388     typename T11, typename T12, typename T13, typename T14, typename T15,
18389     typename T16, typename T17, typename T18, typename T19, typename T20,
18390     typename T21, typename T22, typename T23, typename T24, typename T25,
18391     typename T26, typename T27, typename T28, typename T29, typename T30,
18392     typename T31, typename T32, typename T33, typename T34, typename T35,
18393     typename T36, typename T37, typename T38, typename T39, typename T40>
18394 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18395     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18396     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
18397     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
18398     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
18399     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
18400     T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
18401     T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
18402   return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18403       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18404       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18405       T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
18406       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
18407       v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
18408 }
18409 
18410 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18411     typename T6, typename T7, typename T8, typename T9, typename T10,
18412     typename T11, typename T12, typename T13, typename T14, typename T15,
18413     typename T16, typename T17, typename T18, typename T19, typename T20,
18414     typename T21, typename T22, typename T23, typename T24, typename T25,
18415     typename T26, typename T27, typename T28, typename T29, typename T30,
18416     typename T31, typename T32, typename T33, typename T34, typename T35,
18417     typename T36, typename T37, typename T38, typename T39, typename T40,
18418     typename T41>
18419 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18420     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18421     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
18422     T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18423     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18424     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18425     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18426     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
18427   return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18428       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18429       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18430       T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
18431       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
18432       v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
18433 }
18434 
18435 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18436     typename T6, typename T7, typename T8, typename T9, typename T10,
18437     typename T11, typename T12, typename T13, typename T14, typename T15,
18438     typename T16, typename T17, typename T18, typename T19, typename T20,
18439     typename T21, typename T22, typename T23, typename T24, typename T25,
18440     typename T26, typename T27, typename T28, typename T29, typename T30,
18441     typename T31, typename T32, typename T33, typename T34, typename T35,
18442     typename T36, typename T37, typename T38, typename T39, typename T40,
18443     typename T41, typename T42>
18444 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18445     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18446     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
18447     T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18448     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18449     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18450     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18451     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
18452     T42 v42) {
18453   return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18454       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18455       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18456       T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
18457       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
18458       v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
18459       v42);
18460 }
18461 
18462 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18463     typename T6, typename T7, typename T8, typename T9, typename T10,
18464     typename T11, typename T12, typename T13, typename T14, typename T15,
18465     typename T16, typename T17, typename T18, typename T19, typename T20,
18466     typename T21, typename T22, typename T23, typename T24, typename T25,
18467     typename T26, typename T27, typename T28, typename T29, typename T30,
18468     typename T31, typename T32, typename T33, typename T34, typename T35,
18469     typename T36, typename T37, typename T38, typename T39, typename T40,
18470     typename T41, typename T42, typename T43>
18471 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18472     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18473     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
18474     T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18475     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18476     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18477     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18478     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
18479     T42 v42, T43 v43) {
18480   return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18481       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18482       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18483       T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
18484       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
18485       v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
18486       v41, v42, v43);
18487 }
18488 
18489 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18490     typename T6, typename T7, typename T8, typename T9, typename T10,
18491     typename T11, typename T12, typename T13, typename T14, typename T15,
18492     typename T16, typename T17, typename T18, typename T19, typename T20,
18493     typename T21, typename T22, typename T23, typename T24, typename T25,
18494     typename T26, typename T27, typename T28, typename T29, typename T30,
18495     typename T31, typename T32, typename T33, typename T34, typename T35,
18496     typename T36, typename T37, typename T38, typename T39, typename T40,
18497     typename T41, typename T42, typename T43, typename T44>
18498 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18499     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18500     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18501     T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
18502     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
18503     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
18504     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
18505     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
18506     T42 v42, T43 v43, T44 v44) {
18507   return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18508       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18509       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18510       T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
18511       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
18512       v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
18513       v40, v41, v42, v43, v44);
18514 }
18515 
18516 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18517     typename T6, typename T7, typename T8, typename T9, typename T10,
18518     typename T11, typename T12, typename T13, typename T14, typename T15,
18519     typename T16, typename T17, typename T18, typename T19, typename T20,
18520     typename T21, typename T22, typename T23, typename T24, typename T25,
18521     typename T26, typename T27, typename T28, typename T29, typename T30,
18522     typename T31, typename T32, typename T33, typename T34, typename T35,
18523     typename T36, typename T37, typename T38, typename T39, typename T40,
18524     typename T41, typename T42, typename T43, typename T44, typename T45>
18525 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18526     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18527     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18528     T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
18529     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
18530     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
18531     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
18532     T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
18533     T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
18534   return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18535       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18536       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18537       T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
18538       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
18539       v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
18540       v39, v40, v41, v42, v43, v44, v45);
18541 }
18542 
18543 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18544     typename T6, typename T7, typename T8, typename T9, typename T10,
18545     typename T11, typename T12, typename T13, typename T14, typename T15,
18546     typename T16, typename T17, typename T18, typename T19, typename T20,
18547     typename T21, typename T22, typename T23, typename T24, typename T25,
18548     typename T26, typename T27, typename T28, typename T29, typename T30,
18549     typename T31, typename T32, typename T33, typename T34, typename T35,
18550     typename T36, typename T37, typename T38, typename T39, typename T40,
18551     typename T41, typename T42, typename T43, typename T44, typename T45,
18552     typename T46>
18553 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18554     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18555     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18556     T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18557     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18558     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18559     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18560     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
18561     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
18562   return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18563       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18564       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18565       T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
18566       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18567       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
18568       v38, v39, v40, v41, v42, v43, v44, v45, v46);
18569 }
18570 
18571 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18572     typename T6, typename T7, typename T8, typename T9, typename T10,
18573     typename T11, typename T12, typename T13, typename T14, typename T15,
18574     typename T16, typename T17, typename T18, typename T19, typename T20,
18575     typename T21, typename T22, typename T23, typename T24, typename T25,
18576     typename T26, typename T27, typename T28, typename T29, typename T30,
18577     typename T31, typename T32, typename T33, typename T34, typename T35,
18578     typename T36, typename T37, typename T38, typename T39, typename T40,
18579     typename T41, typename T42, typename T43, typename T44, typename T45,
18580     typename T46, typename T47>
18581 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18582     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18583     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18584     T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
18585     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18586     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18587     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18588     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
18589     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
18590   return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18591       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18592       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18593       T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
18594       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
18595       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
18596       v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
18597 }
18598 
18599 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18600     typename T6, typename T7, typename T8, typename T9, typename T10,
18601     typename T11, typename T12, typename T13, typename T14, typename T15,
18602     typename T16, typename T17, typename T18, typename T19, typename T20,
18603     typename T21, typename T22, typename T23, typename T24, typename T25,
18604     typename T26, typename T27, typename T28, typename T29, typename T30,
18605     typename T31, typename T32, typename T33, typename T34, typename T35,
18606     typename T36, typename T37, typename T38, typename T39, typename T40,
18607     typename T41, typename T42, typename T43, typename T44, typename T45,
18608     typename T46, typename T47, typename T48>
18609 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18610     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18611     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18612     T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
18613     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
18614     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
18615     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
18616     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
18617     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
18618     T48 v48) {
18619   return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18620       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18621       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18622       T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
18623       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
18624       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
18625       v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
18626 }
18627 
18628 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18629     typename T6, typename T7, typename T8, typename T9, typename T10,
18630     typename T11, typename T12, typename T13, typename T14, typename T15,
18631     typename T16, typename T17, typename T18, typename T19, typename T20,
18632     typename T21, typename T22, typename T23, typename T24, typename T25,
18633     typename T26, typename T27, typename T28, typename T29, typename T30,
18634     typename T31, typename T32, typename T33, typename T34, typename T35,
18635     typename T36, typename T37, typename T38, typename T39, typename T40,
18636     typename T41, typename T42, typename T43, typename T44, typename T45,
18637     typename T46, typename T47, typename T48, typename T49>
18638 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18639     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18640     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18641     T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
18642     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
18643     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
18644     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
18645     T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
18646     T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
18647     T47 v47, T48 v48, T49 v49) {
18648   return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18649       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18650       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18651       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
18652       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
18653       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
18654       v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
18655 }
18656 
18657 template <typename T1, typename T2, typename T3, typename T4, typename T5,
18658     typename T6, typename T7, typename T8, typename T9, typename T10,
18659     typename T11, typename T12, typename T13, typename T14, typename T15,
18660     typename T16, typename T17, typename T18, typename T19, typename T20,
18661     typename T21, typename T22, typename T23, typename T24, typename T25,
18662     typename T26, typename T27, typename T28, typename T29, typename T30,
18663     typename T31, typename T32, typename T33, typename T34, typename T35,
18664     typename T36, typename T37, typename T38, typename T39, typename T40,
18665     typename T41, typename T42, typename T43, typename T44, typename T45,
18666     typename T46, typename T47, typename T48, typename T49, typename T50>
18667 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
18668     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
18669     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
18670     T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
18671     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
18672     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
18673     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
18674     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
18675     T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
18676     T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
18677   return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
18678       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
18679       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
18680       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
18681       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
18682       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
18683       v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
18684       v48, v49, v50);
18685 }
18686 
18687 // Bool() allows generating tests with parameters in a set of (false, true).
18688 //
18689 // Synopsis:
18690 // Bool()
18691 //   - returns a generator producing sequences with elements {false, true}.
18692 //
18693 // It is useful when testing code that depends on Boolean flags. Combinations
18694 // of multiple flags can be tested when several Bool()'s are combined using
18695 // Combine() function.
18696 //
18697 // In the following example all tests in the test case FlagDependentTest
18698 // will be instantiated twice with parameters false and true.
18699 //
18700 // class FlagDependentTest : public testing::TestWithParam<bool> {
18701 //   virtual void SetUp() {
18702 //     external_flag = GetParam();
18703 //   }
18704 // }
18705 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
18706 //
18707 inline internal::ParamGenerator<bool> Bool() {
18708   return Values(false, true);
18709 }
18710 
18711 # if GTEST_HAS_COMBINE
18712 // Combine() allows the user to combine two or more sequences to produce
18713 // values of a Cartesian product of those sequences' elements.
18714 //
18715 // Synopsis:
18716 // Combine(gen1, gen2, ..., genN)
18717 //   - returns a generator producing sequences with elements coming from
18718 //     the Cartesian product of elements from the sequences generated by
18719 //     gen1, gen2, ..., genN. The sequence elements will have a type of
18720 //     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
18721 //     of elements from sequences produces by gen1, gen2, ..., genN.
18722 //
18723 // Combine can have up to 10 arguments. This number is currently limited
18724 // by the maximum number of elements in the tuple implementation used by Google
18725 // Test.
18726 //
18727 // Example:
18728 //
18729 // This will instantiate tests in test case AnimalTest each one with
18730 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
18731 // tuple("dog", BLACK), and tuple("dog", WHITE):
18732 //
18733 // enum Color { BLACK, GRAY, WHITE };
18734 // class AnimalTest
18735 //     : public testing::TestWithParam<tuple<const char*, Color> > {...};
18736 //
18737 // TEST_P(AnimalTest, AnimalLooksNice) {...}
18738 //
18739 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
18740 //                         Combine(Values("cat", "dog"),
18741 //                                 Values(BLACK, WHITE)));
18742 //
18743 // This will instantiate tests in FlagDependentTest with all variations of two
18744 // Boolean flags:
18745 //
18746 // class FlagDependentTest
18747 //     : public testing::TestWithParam<tuple<bool, bool> > {
18748 //   virtual void SetUp() {
18749 //     // Assigns external_flag_1 and external_flag_2 values from the tuple.
18750 //     tie(external_flag_1, external_flag_2) = GetParam();
18751 //   }
18752 // };
18753 //
18754 // TEST_P(FlagDependentTest, TestFeature1) {
18755 //   // Test your code using external_flag_1 and external_flag_2 here.
18756 // }
18757 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
18758 //                         Combine(Bool(), Bool()));
18759 //
18760 template <typename Generator1, typename Generator2>
18761 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
18762     const Generator1& g1, const Generator2& g2) {
18763   return internal::CartesianProductHolder2<Generator1, Generator2>(
18764       g1, g2);
18765 }
18766 
18767 template <typename Generator1, typename Generator2, typename Generator3>
18768 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
18769     const Generator1& g1, const Generator2& g2, const Generator3& g3) {
18770   return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
18771       g1, g2, g3);
18772 }
18773 
18774 template <typename Generator1, typename Generator2, typename Generator3,
18775     typename Generator4>
18776 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
18777     Generator4> Combine(
18778     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18779         const Generator4& g4) {
18780   return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
18781       Generator4>(
18782       g1, g2, g3, g4);
18783 }
18784 
18785 template <typename Generator1, typename Generator2, typename Generator3,
18786     typename Generator4, typename Generator5>
18787 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
18788     Generator4, Generator5> Combine(
18789     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18790         const Generator4& g4, const Generator5& g5) {
18791   return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
18792       Generator4, Generator5>(
18793       g1, g2, g3, g4, g5);
18794 }
18795 
18796 template <typename Generator1, typename Generator2, typename Generator3,
18797     typename Generator4, typename Generator5, typename Generator6>
18798 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
18799     Generator4, Generator5, Generator6> Combine(
18800     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18801         const Generator4& g4, const Generator5& g5, const Generator6& g6) {
18802   return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
18803       Generator4, Generator5, Generator6>(
18804       g1, g2, g3, g4, g5, g6);
18805 }
18806 
18807 template <typename Generator1, typename Generator2, typename Generator3,
18808     typename Generator4, typename Generator5, typename Generator6,
18809     typename Generator7>
18810 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
18811     Generator4, Generator5, Generator6, Generator7> Combine(
18812     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18813         const Generator4& g4, const Generator5& g5, const Generator6& g6,
18814         const Generator7& g7) {
18815   return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
18816       Generator4, Generator5, Generator6, Generator7>(
18817       g1, g2, g3, g4, g5, g6, g7);
18818 }
18819 
18820 template <typename Generator1, typename Generator2, typename Generator3,
18821     typename Generator4, typename Generator5, typename Generator6,
18822     typename Generator7, typename Generator8>
18823 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
18824     Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
18825     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18826         const Generator4& g4, const Generator5& g5, const Generator6& g6,
18827         const Generator7& g7, const Generator8& g8) {
18828   return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
18829       Generator4, Generator5, Generator6, Generator7, Generator8>(
18830       g1, g2, g3, g4, g5, g6, g7, g8);
18831 }
18832 
18833 template <typename Generator1, typename Generator2, typename Generator3,
18834     typename Generator4, typename Generator5, typename Generator6,
18835     typename Generator7, typename Generator8, typename Generator9>
18836 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
18837     Generator4, Generator5, Generator6, Generator7, Generator8,
18838     Generator9> Combine(
18839     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18840         const Generator4& g4, const Generator5& g5, const Generator6& g6,
18841         const Generator7& g7, const Generator8& g8, const Generator9& g9) {
18842   return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
18843       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
18844       g1, g2, g3, g4, g5, g6, g7, g8, g9);
18845 }
18846 
18847 template <typename Generator1, typename Generator2, typename Generator3,
18848     typename Generator4, typename Generator5, typename Generator6,
18849     typename Generator7, typename Generator8, typename Generator9,
18850     typename Generator10>
18851 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
18852     Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
18853     Generator10> Combine(
18854     const Generator1& g1, const Generator2& g2, const Generator3& g3,
18855         const Generator4& g4, const Generator5& g5, const Generator6& g6,
18856         const Generator7& g7, const Generator8& g8, const Generator9& g9,
18857         const Generator10& g10) {
18858   return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
18859       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
18860       Generator10>(
18861       g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
18862 }
18863 # endif  // GTEST_HAS_COMBINE
18864 
18865 # define TEST_P(test_case_name, test_name) \
18866   class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
18867       : public test_case_name { \
18868    public: \
18869     GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
18870     virtual void TestBody(); \
18871    private: \
18872     static int AddToRegistry() { \
18873       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
18874           GetTestCasePatternHolder<test_case_name>(\
18875               #test_case_name, \
18876               ::testing::internal::CodeLocation(\
18877                   __FILE__, __LINE__))->AddTestPattern(\
18878                       GTEST_STRINGIFY_(test_case_name), \
18879                       GTEST_STRINGIFY_(test_name), \
18880                       new ::testing::internal::TestMetaFactory< \
18881                           GTEST_TEST_CLASS_NAME_(\
18882                               test_case_name, test_name)>()); \
18883       return 0; \
18884     } \
18885     static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
18886     GTEST_DISALLOW_COPY_AND_ASSIGN_(\
18887         GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
18888   }; \
18889   int GTEST_TEST_CLASS_NAME_(test_case_name, \
18890                              test_name)::gtest_registering_dummy_ = \
18891       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
18892   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
18893 
18894 // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
18895 // to specify a function or functor that generates custom test name suffixes
18896 // based on the test parameters. The function should accept one argument of
18897 // type testing::TestParamInfo<class ParamType>, and return std::string.
18898 //
18899 // testing::PrintToStringParamName is a builtin test suffix generator that
18900 // returns the value of testing::PrintToString(GetParam()).
18901 //
18902 // Note: test names must be non-empty, unique, and may only contain ASCII
18903 // alphanumeric characters or underscore. Because PrintToString adds quotes
18904 // to std::string and C strings, it won't work for these types.
18905 
18906 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
18907   static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
18908       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
18909   static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
18910       const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
18911     return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
18912         (__VA_ARGS__)(info); \
18913   } \
18914   static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
18915       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
18916           GetTestCasePatternHolder<test_case_name>(\
18917               #test_case_name, \
18918               ::testing::internal::CodeLocation(\
18919                   __FILE__, __LINE__))->AddTestCaseInstantiation(\
18920                       #prefix, \
18921                       &gtest_##prefix##test_case_name##_EvalGenerator_, \
18922                       &gtest_##prefix##test_case_name##_EvalGenerateName_, \
18923                       __FILE__, __LINE__)
18924 
18925 }  // namespace testing
18926 
18927 #endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
18928 // Copyright 2006, Google Inc.
18929 // All rights reserved.
18930 //
18931 // Redistribution and use in source and binary forms, with or without
18932 // modification, are permitted provided that the following conditions are
18933 // met:
18934 //
18935 //     * Redistributions of source code must retain the above copyright
18936 // notice, this list of conditions and the following disclaimer.
18937 //     * Redistributions in binary form must reproduce the above
18938 // copyright notice, this list of conditions and the following disclaimer
18939 // in the documentation and/or other materials provided with the
18940 // distribution.
18941 //     * Neither the name of Google Inc. nor the names of its
18942 // contributors may be used to endorse or promote products derived from
18943 // this software without specific prior written permission.
18944 //
18945 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18946 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18947 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18948 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18949 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18950 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18951 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18952 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18953 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18954 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18955 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18956 
18957 //
18958 // Google C++ Testing and Mocking Framework definitions useful in production code.
18959 // GOOGLETEST_CM0003 DO NOT DELETE
18960 
18961 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18962 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18963 
18964 // When you need to test the private or protected members of a class,
18965 // use the FRIEND_TEST macro to declare your tests as friends of the
18966 // class.  For example:
18967 //
18968 // class MyClass {
18969 //  private:
18970 //   void PrivateMethod();
18971 //   FRIEND_TEST(MyClassTest, PrivateMethodWorks);
18972 // };
18973 //
18974 // class MyClassTest : public testing::Test {
18975 //   // ...
18976 // };
18977 //
18978 // TEST_F(MyClassTest, PrivateMethodWorks) {
18979 //   // Can call MyClass::PrivateMethod() here.
18980 // }
18981 //
18982 // Note: The test class must be in the same namespace as the class being tested.
18983 // For example, putting MyClassTest in an anonymous namespace will not work.
18984 
18985 #define FRIEND_TEST(test_case_name, test_name)\
18986 friend class test_case_name##_##test_name##_Test
18987 
18988 #endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18989 // Copyright 2008, Google Inc.
18990 // All rights reserved.
18991 //
18992 // Redistribution and use in source and binary forms, with or without
18993 // modification, are permitted provided that the following conditions are
18994 // met:
18995 //
18996 //     * Redistributions of source code must retain the above copyright
18997 // notice, this list of conditions and the following disclaimer.
18998 //     * Redistributions in binary form must reproduce the above
18999 // copyright notice, this list of conditions and the following disclaimer
19000 // in the documentation and/or other materials provided with the
19001 // distribution.
19002 //     * Neither the name of Google Inc. nor the names of its
19003 // contributors may be used to endorse or promote products derived from
19004 // this software without specific prior written permission.
19005 //
19006 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19007 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19008 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19009 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19010 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19011 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19012 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19013 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19014 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19015 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19016 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19017 //
19018 // GOOGLETEST_CM0001 DO NOT DELETE
19019 
19020 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
19021 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
19022 
19023 #include <iosfwd>
19024 #include <vector>
19025 
19026 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
19027 /* class A needs to have dll-interface to be used by clients of class B */)
19028 
19029 namespace testing {
19030 
19031 // A copyable object representing the result of a test part (i.e. an
19032 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
19033 //
19034 // Don't inherit from TestPartResult as its destructor is not virtual.
19035 class GTEST_API_ TestPartResult {
19036  public:
19037   // The possible outcomes of a test part (i.e. an assertion or an
19038   // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
19039   enum Type {
19040     kSuccess,          // Succeeded.
19041     kNonFatalFailure,  // Failed but the test can continue.
19042     kFatalFailure      // Failed and the test should be terminated.
19043   };
19044 
19045   // C'tor.  TestPartResult does NOT have a default constructor.
19046   // Always use this constructor (with parameters) to create a
19047   // TestPartResult object.
19048   TestPartResult(Type a_type,
19049                  const char* a_file_name,
19050                  int a_line_number,
19051                  const char* a_message)
19052       : type_(a_type),
19053         file_name_(a_file_name == NULL ? "" : a_file_name),
19054         line_number_(a_line_number),
19055         summary_(ExtractSummary(a_message)),
19056         message_(a_message) {
19057   }
19058 
19059   // Gets the outcome of the test part.
19060   Type type() const { return type_; }
19061 
19062   // Gets the name of the source file where the test part took place, or
19063   // NULL if it's unknown.
19064   const char* file_name() const {
19065     return file_name_.empty() ? NULL : file_name_.c_str();
19066   }
19067 
19068   // Gets the line in the source file where the test part took place,
19069   // or -1 if it's unknown.
19070   int line_number() const { return line_number_; }
19071 
19072   // Gets the summary of the failure message.
19073   const char* summary() const { return summary_.c_str(); }
19074 
19075   // Gets the message associated with the test part.
19076   const char* message() const { return message_.c_str(); }
19077 
19078   // Returns true iff the test part passed.
19079   bool passed() const { return type_ == kSuccess; }
19080 
19081   // Returns true iff the test part failed.
19082   bool failed() const { return type_ != kSuccess; }
19083 
19084   // Returns true iff the test part non-fatally failed.
19085   bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
19086 
19087   // Returns true iff the test part fatally failed.
19088   bool fatally_failed() const { return type_ == kFatalFailure; }
19089 
19090  private:
19091   Type type_;
19092 
19093   // Gets the summary of the failure message by omitting the stack
19094   // trace in it.
19095   static std::string ExtractSummary(const char* message);
19096 
19097   // The name of the source file where the test part took place, or
19098   // "" if the source file is unknown.
19099   std::string file_name_;
19100   // The line in the source file where the test part took place, or -1
19101   // if the line number is unknown.
19102   int line_number_;
19103   std::string summary_;  // The test failure summary.
19104   std::string message_;  // The test failure message.
19105 };
19106 
19107 // Prints a TestPartResult object.
19108 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
19109 
19110 // An array of TestPartResult objects.
19111 //
19112 // Don't inherit from TestPartResultArray as its destructor is not
19113 // virtual.
19114 class GTEST_API_ TestPartResultArray {
19115  public:
19116   TestPartResultArray() {}
19117 
19118   // Appends the given TestPartResult to the array.
19119   void Append(const TestPartResult& result);
19120 
19121   // Returns the TestPartResult at the given index (0-based).
19122   const TestPartResult& GetTestPartResult(int index) const;
19123 
19124   // Returns the number of TestPartResult objects in the array.
19125   int size() const;
19126 
19127  private:
19128   std::vector<TestPartResult> array_;
19129 
19130   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
19131 };
19132 
19133 // This interface knows how to report a test part result.
19134 class GTEST_API_ TestPartResultReporterInterface {
19135  public:
19136   virtual ~TestPartResultReporterInterface() {}
19137 
19138   virtual void ReportTestPartResult(const TestPartResult& result) = 0;
19139 };
19140 
19141 namespace internal {
19142 
19143 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
19144 // statement generates new fatal failures. To do so it registers itself as the
19145 // current test part result reporter. Besides checking if fatal failures were
19146 // reported, it only delegates the reporting to the former result reporter.
19147 // The original result reporter is restored in the destructor.
19148 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19149 class GTEST_API_ HasNewFatalFailureHelper
19150     : public TestPartResultReporterInterface {
19151  public:
19152   HasNewFatalFailureHelper();
19153   virtual ~HasNewFatalFailureHelper();
19154   virtual void ReportTestPartResult(const TestPartResult& result);
19155   bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
19156  private:
19157   bool has_new_fatal_failure_;
19158   TestPartResultReporterInterface* original_reporter_;
19159 
19160   GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
19161 };
19162 
19163 }  // namespace internal
19164 
19165 }  // namespace testing
19166 
19167 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251
19168 
19169 #endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
19170 // Copyright 2008 Google Inc.
19171 // All Rights Reserved.
19172 //
19173 // Redistribution and use in source and binary forms, with or without
19174 // modification, are permitted provided that the following conditions are
19175 // met:
19176 //
19177 //     * Redistributions of source code must retain the above copyright
19178 // notice, this list of conditions and the following disclaimer.
19179 //     * Redistributions in binary form must reproduce the above
19180 // copyright notice, this list of conditions and the following disclaimer
19181 // in the documentation and/or other materials provided with the
19182 // distribution.
19183 //     * Neither the name of Google Inc. nor the names of its
19184 // contributors may be used to endorse or promote products derived from
19185 // this software without specific prior written permission.
19186 //
19187 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19188 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19189 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19190 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19191 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19192 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19193 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19194 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19195 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19196 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19197 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19198 
19199 
19200 // GOOGLETEST_CM0001 DO NOT DELETE
19201 
19202 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
19203 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
19204 
19205 // This header implements typed tests and type-parameterized tests.
19206 
19207 // Typed (aka type-driven) tests repeat the same test for types in a
19208 // list.  You must know which types you want to test with when writing
19209 // typed tests. Here's how you do it:
19210 
19211 #if 0
19212 
19213 // First, define a fixture class template.  It should be parameterized
19214 // by a type.  Remember to derive it from testing::Test.
19215 template <typename T>
19216 class FooTest : public testing::Test {
19217  public:
19218   ...
19219   typedef std::list<T> List;
19220   static T shared_;
19221   T value_;
19222 };
19223 
19224 // Next, associate a list of types with the test case, which will be
19225 // repeated for each type in the list.  The typedef is necessary for
19226 // the macro to parse correctly.
19227 typedef testing::Types<char, int, unsigned int> MyTypes;
19228 TYPED_TEST_CASE(FooTest, MyTypes);
19229 
19230 // If the type list contains only one type, you can write that type
19231 // directly without Types<...>:
19232 //   TYPED_TEST_CASE(FooTest, int);
19233 
19234 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
19235 // tests for this test case as you want.
19236 TYPED_TEST(FooTest, DoesBlah) {
19237   // Inside a test, refer to TypeParam to get the type parameter.
19238   // Since we are inside a derived class template, C++ requires use to
19239   // visit the members of FooTest via 'this'.
19240   TypeParam n = this->value_;
19241 
19242   // To visit static members of the fixture, add the TestFixture::
19243   // prefix.
19244   n += TestFixture::shared_;
19245 
19246   // To refer to typedefs in the fixture, add the "typename
19247   // TestFixture::" prefix.
19248   typename TestFixture::List values;
19249   values.push_back(n);
19250   ...
19251 }
19252 
19253 TYPED_TEST(FooTest, HasPropertyA) { ... }
19254 
19255 // TYPED_TEST_CASE takes an optional third argument which allows to specify a
19256 // class that generates custom test name suffixes based on the type. This should
19257 // be a class which has a static template function GetName(int index) returning
19258 // a string for each type. The provided integer index equals the index of the
19259 // type in the provided type list. In many cases the index can be ignored.
19260 //
19261 // For example:
19262 //   class MyTypeNames {
19263 //    public:
19264 //     template <typename T>
19265 //     static std::string GetName(int) {
19266 //       if (std::is_same<T, char>()) return "char";
19267 //       if (std::is_same<T, int>()) return "int";
19268 //       if (std::is_same<T, unsigned int>()) return "unsignedInt";
19269 //     }
19270 //   };
19271 //   TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
19272 
19273 #endif  // 0
19274 
19275 // Type-parameterized tests are abstract test patterns parameterized
19276 // by a type.  Compared with typed tests, type-parameterized tests
19277 // allow you to define the test pattern without knowing what the type
19278 // parameters are.  The defined pattern can be instantiated with
19279 // different types any number of times, in any number of translation
19280 // units.
19281 //
19282 // If you are designing an interface or concept, you can define a
19283 // suite of type-parameterized tests to verify properties that any
19284 // valid implementation of the interface/concept should have.  Then,
19285 // each implementation can easily instantiate the test suite to verify
19286 // that it conforms to the requirements, without having to write
19287 // similar tests repeatedly.  Here's an example:
19288 
19289 #if 0
19290 
19291 // First, define a fixture class template.  It should be parameterized
19292 // by a type.  Remember to derive it from testing::Test.
19293 template <typename T>
19294 class FooTest : public testing::Test {
19295   ...
19296 };
19297 
19298 // Next, declare that you will define a type-parameterized test case
19299 // (the _P suffix is for "parameterized" or "pattern", whichever you
19300 // prefer):
19301 TYPED_TEST_CASE_P(FooTest);
19302 
19303 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
19304 // for this type-parameterized test case as you want.
19305 TYPED_TEST_P(FooTest, DoesBlah) {
19306   // Inside a test, refer to TypeParam to get the type parameter.
19307   TypeParam n = 0;
19308   ...
19309 }
19310 
19311 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
19312 
19313 // Now the tricky part: you need to register all test patterns before
19314 // you can instantiate them.  The first argument of the macro is the
19315 // test case name; the rest are the names of the tests in this test
19316 // case.
19317 REGISTER_TYPED_TEST_CASE_P(FooTest,
19318                            DoesBlah, HasPropertyA);
19319 
19320 // Finally, you are free to instantiate the pattern with the types you
19321 // want.  If you put the above code in a header file, you can #include
19322 // it in multiple C++ source files and instantiate it multiple times.
19323 //
19324 // To distinguish different instances of the pattern, the first
19325 // argument to the INSTANTIATE_* macro is a prefix that will be added
19326 // to the actual test case name.  Remember to pick unique prefixes for
19327 // different instances.
19328 typedef testing::Types<char, int, unsigned int> MyTypes;
19329 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
19330 
19331 // If the type list contains only one type, you can write that type
19332 // directly without Types<...>:
19333 //   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
19334 //
19335 // Similar to the optional argument of TYPED_TEST_CASE above,
19336 // INSTANTIATE_TEST_CASE_P takes an optional fourth argument which allows to
19337 // generate custom names.
19338 //   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes, MyTypeNames);
19339 
19340 #endif  // 0
19341 
19342 
19343 // Implements typed tests.
19344 
19345 #if GTEST_HAS_TYPED_TEST
19346 
19347 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19348 //
19349 // Expands to the name of the typedef for the type parameters of the
19350 // given test case.
19351 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
19352 
19353 // Expands to the name of the typedef for the NameGenerator, responsible for
19354 // creating the suffixes of the name.
19355 #define GTEST_NAME_GENERATOR_(TestCaseName) \
19356   gtest_type_params_##TestCaseName##_NameGenerator
19357 
19358 // The 'Types' template argument below must have spaces around it
19359 // since some compilers may choke on '>>' when passing a template
19360 // instance (e.g. Types<int>)
19361 # define TYPED_TEST_CASE(CaseName, Types, ...)                             \
19362   typedef ::testing::internal::TypeList< Types >::type GTEST_TYPE_PARAMS_( \
19363       CaseName);                                                           \
19364   typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type    \
19365       GTEST_NAME_GENERATOR_(CaseName)
19366 
19367 # define TYPED_TEST(CaseName, TestName)                                       \
19368   template <typename gtest_TypeParam_>                                        \
19369   class GTEST_TEST_CLASS_NAME_(CaseName, TestName)                            \
19370       : public CaseName<gtest_TypeParam_> {                                   \
19371    private:                                                                   \
19372     typedef CaseName<gtest_TypeParam_> TestFixture;                           \
19373     typedef gtest_TypeParam_ TypeParam;                                       \
19374     virtual void TestBody();                                                  \
19375   };                                                                          \
19376   static bool gtest_##CaseName##_##TestName##_registered_                     \
19377         GTEST_ATTRIBUTE_UNUSED_ =                                             \
19378       ::testing::internal::TypeParameterizedTest<                             \
19379           CaseName,                                                           \
19380           ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName,   \
19381                                                                   TestName)>, \
19382           GTEST_TYPE_PARAMS_(                                                 \
19383               CaseName)>::Register("",                                        \
19384                                    ::testing::internal::CodeLocation(         \
19385                                        __FILE__, __LINE__),                   \
19386                                    #CaseName, #TestName, 0,                   \
19387                                    ::testing::internal::GenerateNames<        \
19388                                        GTEST_NAME_GENERATOR_(CaseName),       \
19389                                        GTEST_TYPE_PARAMS_(CaseName)>());      \
19390   template <typename gtest_TypeParam_>                                        \
19391   void GTEST_TEST_CLASS_NAME_(CaseName,                                       \
19392                               TestName)<gtest_TypeParam_>::TestBody()
19393 
19394 #endif  // GTEST_HAS_TYPED_TEST
19395 
19396 // Implements type-parameterized tests.
19397 
19398 #if GTEST_HAS_TYPED_TEST_P
19399 
19400 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19401 //
19402 // Expands to the namespace name that the type-parameterized tests for
19403 // the given type-parameterized test case are defined in.  The exact
19404 // name of the namespace is subject to change without notice.
19405 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
19406   gtest_case_##TestCaseName##_
19407 
19408 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19409 //
19410 // Expands to the name of the variable used to remember the names of
19411 // the defined tests in the given test case.
19412 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
19413   gtest_typed_test_case_p_state_##TestCaseName##_
19414 
19415 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
19416 //
19417 // Expands to the name of the variable used to remember the names of
19418 // the registered tests in the given test case.
19419 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
19420   gtest_registered_test_names_##TestCaseName##_
19421 
19422 // The variables defined in the type-parameterized test macros are
19423 // static as typically these macros are used in a .h file that can be
19424 // #included in multiple translation units linked together.
19425 # define TYPED_TEST_CASE_P(CaseName) \
19426   static ::testing::internal::TypedTestCasePState \
19427       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
19428 
19429 # define TYPED_TEST_P(CaseName, TestName) \
19430   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
19431   template <typename gtest_TypeParam_> \
19432   class TestName : public CaseName<gtest_TypeParam_> { \
19433    private: \
19434     typedef CaseName<gtest_TypeParam_> TestFixture; \
19435     typedef gtest_TypeParam_ TypeParam; \
19436     virtual void TestBody(); \
19437   }; \
19438   static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
19439       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
19440           __FILE__, __LINE__, #CaseName, #TestName); \
19441   } \
19442   template <typename gtest_TypeParam_> \
19443   void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
19444 
19445 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
19446   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
19447   typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
19448   } \
19449   static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \
19450       GTEST_ATTRIBUTE_UNUSED_ = \
19451           GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames( \
19452               __FILE__, __LINE__, #__VA_ARGS__)
19453 
19454 // The 'Types' template argument below must have spaces around it
19455 // since some compilers may choke on '>>' when passing a template
19456 // instance (e.g. Types<int>)
19457 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types, ...)      \
19458   static bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ =       \
19459       ::testing::internal::TypeParameterizedTestCase<                     \
19460           CaseName, GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_,     \
19461           ::testing::internal::TypeList< Types >::type>::                 \
19462           Register(#Prefix,                                               \
19463                    ::testing::internal::CodeLocation(__FILE__, __LINE__), \
19464                    &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), #CaseName,  \
19465                    GTEST_REGISTERED_TEST_NAMES_(CaseName),                \
19466                    ::testing::internal::GenerateNames<                    \
19467                        ::testing::internal::NameGeneratorSelector<        \
19468                            __VA_ARGS__>::type,                            \
19469                        ::testing::internal::TypeList< Types >::type>())
19470 
19471 #endif  // GTEST_HAS_TYPED_TEST_P
19472 
19473 #endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
19474 
19475 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
19476 /* class A needs to have dll-interface to be used by clients of class B */)
19477 
19478 // Depending on the platform, different string classes are available.
19479 // On Linux, in addition to ::std::string, Google also makes use of
19480 // class ::string, which has the same interface as ::std::string, but
19481 // has a different implementation.
19482 //
19483 // You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
19484 // ::string is available AND is a distinct type to ::std::string, or
19485 // define it to 0 to indicate otherwise.
19486 //
19487 // If ::std::string and ::string are the same class on your platform
19488 // due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
19489 //
19490 // If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
19491 // heuristically.
19492 
19493 namespace testing {
19494 
19495 // Silence C4100 (unreferenced formal parameter) and 4805
19496 // unsafe mix of type 'const int' and type 'const bool'
19497 #ifdef _MSC_VER
19498 # pragma warning(push)
19499 # pragma warning(disable:4805)
19500 # pragma warning(disable:4100)
19501 #endif
19502 
19503 
19504 // Declares the flags.
19505 
19506 // This flag temporary enables the disabled tests.
19507 GTEST_DECLARE_bool_(also_run_disabled_tests);
19508 
19509 // This flag brings the debugger on an assertion failure.
19510 GTEST_DECLARE_bool_(break_on_failure);
19511 
19512 // This flag controls whether Google Test catches all test-thrown exceptions
19513 // and logs them as failures.
19514 GTEST_DECLARE_bool_(catch_exceptions);
19515 
19516 // This flag enables using colors in terminal output. Available values are
19517 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
19518 // to let Google Test decide.
19519 GTEST_DECLARE_string_(color);
19520 
19521 // This flag sets up the filter to select by name using a glob pattern
19522 // the tests to run. If the filter is not given all tests are executed.
19523 GTEST_DECLARE_string_(filter);
19524 
19525 // This flag controls whether Google Test installs a signal handler that dumps
19526 // debugging information when fatal signals are raised.
19527 GTEST_DECLARE_bool_(install_failure_signal_handler);
19528 
19529 // This flag causes the Google Test to list tests. None of the tests listed
19530 // are actually run if the flag is provided.
19531 GTEST_DECLARE_bool_(list_tests);
19532 
19533 // This flag controls whether Google Test emits a detailed XML report to a file
19534 // in addition to its normal textual output.
19535 GTEST_DECLARE_string_(output);
19536 
19537 // This flags control whether Google Test prints the elapsed time for each
19538 // test.
19539 GTEST_DECLARE_bool_(print_time);
19540 
19541 // This flags control whether Google Test prints UTF8 characters as text.
19542 GTEST_DECLARE_bool_(print_utf8);
19543 
19544 // This flag specifies the random number seed.
19545 GTEST_DECLARE_int32_(random_seed);
19546 
19547 // This flag sets how many times the tests are repeated. The default value
19548 // is 1. If the value is -1 the tests are repeating forever.
19549 GTEST_DECLARE_int32_(repeat);
19550 
19551 // This flag controls whether Google Test includes Google Test internal
19552 // stack frames in failure stack traces.
19553 GTEST_DECLARE_bool_(show_internal_stack_frames);
19554 
19555 // When this flag is specified, tests' order is randomized on every iteration.
19556 GTEST_DECLARE_bool_(shuffle);
19557 
19558 // This flag specifies the maximum number of stack frames to be
19559 // printed in a failure message.
19560 GTEST_DECLARE_int32_(stack_trace_depth);
19561 
19562 // When this flag is specified, a failed assertion will throw an
19563 // exception if exceptions are enabled, or exit the program with a
19564 // non-zero code otherwise. For use with an external test framework.
19565 GTEST_DECLARE_bool_(throw_on_failure);
19566 
19567 // When this flag is set with a "host:port" string, on supported
19568 // platforms test results are streamed to the specified port on
19569 // the specified host machine.
19570 GTEST_DECLARE_string_(stream_result_to);
19571 
19572 #if GTEST_USE_OWN_FLAGFILE_FLAG_
19573 GTEST_DECLARE_string_(flagfile);
19574 #endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
19575 
19576 // The upper limit for valid stack trace depths.
19577 const int kMaxStackTraceDepth = 100;
19578 
19579 namespace internal {
19580 
19581 class AssertHelper;
19582 class DefaultGlobalTestPartResultReporter;
19583 class ExecDeathTest;
19584 class NoExecDeathTest;
19585 class FinalSuccessChecker;
19586 class GTestFlagSaver;
19587 class StreamingListenerTest;
19588 class TestResultAccessor;
19589 class TestEventListenersAccessor;
19590 class TestEventRepeater;
19591 class UnitTestRecordPropertyTestHelper;
19592 class WindowsDeathTest;
19593 class FuchsiaDeathTest;
19594 class UnitTestImpl* GetUnitTestImpl();
19595 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
19596                                     const std::string& message);
19597 
19598 }  // namespace internal
19599 
19600 // The friend relationship of some of these classes is cyclic.
19601 // If we don't forward declare them the compiler might confuse the classes
19602 // in friendship clauses with same named classes on the scope.
19603 class Test;
19604 class TestCase;
19605 class TestInfo;
19606 class UnitTest;
19607 
19608 // A class for indicating whether an assertion was successful.  When
19609 // the assertion wasn't successful, the AssertionResult object
19610 // remembers a non-empty message that describes how it failed.
19611 //
19612 // To create an instance of this class, use one of the factory functions
19613 // (AssertionSuccess() and AssertionFailure()).
19614 //
19615 // This class is useful for two purposes:
19616 //   1. Defining predicate functions to be used with Boolean test assertions
19617 //      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
19618 //   2. Defining predicate-format functions to be
19619 //      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
19620 //
19621 // For example, if you define IsEven predicate:
19622 //
19623 //   testing::AssertionResult IsEven(int n) {
19624 //     if ((n % 2) == 0)
19625 //       return testing::AssertionSuccess();
19626 //     else
19627 //       return testing::AssertionFailure() << n << " is odd";
19628 //   }
19629 //
19630 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
19631 // will print the message
19632 //
19633 //   Value of: IsEven(Fib(5))
19634 //     Actual: false (5 is odd)
19635 //   Expected: true
19636 //
19637 // instead of a more opaque
19638 //
19639 //   Value of: IsEven(Fib(5))
19640 //     Actual: false
19641 //   Expected: true
19642 //
19643 // in case IsEven is a simple Boolean predicate.
19644 //
19645 // If you expect your predicate to be reused and want to support informative
19646 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
19647 // about half as often as positive ones in our tests), supply messages for
19648 // both success and failure cases:
19649 //
19650 //   testing::AssertionResult IsEven(int n) {
19651 //     if ((n % 2) == 0)
19652 //       return testing::AssertionSuccess() << n << " is even";
19653 //     else
19654 //       return testing::AssertionFailure() << n << " is odd";
19655 //   }
19656 //
19657 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
19658 //
19659 //   Value of: IsEven(Fib(6))
19660 //     Actual: true (8 is even)
19661 //   Expected: false
19662 //
19663 // NB: Predicates that support negative Boolean assertions have reduced
19664 // performance in positive ones so be careful not to use them in tests
19665 // that have lots (tens of thousands) of positive Boolean assertions.
19666 //
19667 // To use this class with EXPECT_PRED_FORMAT assertions such as:
19668 //
19669 //   // Verifies that Foo() returns an even number.
19670 //   EXPECT_PRED_FORMAT1(IsEven, Foo());
19671 //
19672 // you need to define:
19673 //
19674 //   testing::AssertionResult IsEven(const char* expr, int n) {
19675 //     if ((n % 2) == 0)
19676 //       return testing::AssertionSuccess();
19677 //     else
19678 //       return testing::AssertionFailure()
19679 //         << "Expected: " << expr << " is even\n  Actual: it's " << n;
19680 //   }
19681 //
19682 // If Foo() returns 5, you will see the following message:
19683 //
19684 //   Expected: Foo() is even
19685 //     Actual: it's 5
19686 //
19687 class GTEST_API_ AssertionResult {
19688  public:
19689   // Copy constructor.
19690   // Used in EXPECT_TRUE/FALSE(assertion_result).
19691   AssertionResult(const AssertionResult& other);
19692 
19693 #if defined(_MSC_VER) && _MSC_VER < 1910
19694   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
19695 #endif
19696 
19697   // Used in the EXPECT_TRUE/FALSE(bool_expression).
19698   //
19699   // T must be contextually convertible to bool.
19700   //
19701   // The second parameter prevents this overload from being considered if
19702   // the argument is implicitly convertible to AssertionResult. In that case
19703   // we want AssertionResult's copy constructor to be used.
19704   template <typename T>
19705   explicit AssertionResult(
19706       const T& success,
19707       typename internal::EnableIf<
19708           !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
19709           /*enabler*/ = NULL)
19710       : success_(success) {}
19711 
19712 #if defined(_MSC_VER) && _MSC_VER < 1910
19713   GTEST_DISABLE_MSC_WARNINGS_POP_()
19714 #endif
19715 
19716   // Assignment operator.
19717   AssertionResult& operator=(AssertionResult other) {
19718     swap(other);
19719     return *this;
19720   }
19721 
19722   // Returns true iff the assertion succeeded.
19723   operator bool() const { return success_; }  // NOLINT
19724 
19725   // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
19726   AssertionResult operator!() const;
19727 
19728   // Returns the text streamed into this AssertionResult. Test assertions
19729   // use it when they fail (i.e., the predicate's outcome doesn't match the
19730   // assertion's expectation). When nothing has been streamed into the
19731   // object, returns an empty string.
19732   const char* message() const {
19733     return message_.get() != NULL ?  message_->c_str() : "";
19734   }
19735   // FIXME: Remove this after making sure no clients use it.
19736   // Deprecated; please use message() instead.
19737   const char* failure_message() const { return message(); }
19738 
19739   // Streams a custom failure message into this object.
19740   template <typename T> AssertionResult& operator<<(const T& value) {
19741     AppendMessage(Message() << value);
19742     return *this;
19743   }
19744 
19745   // Allows streaming basic output manipulators such as endl or flush into
19746   // this object.
19747   AssertionResult& operator<<(
19748       ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
19749     AppendMessage(Message() << basic_manipulator);
19750     return *this;
19751   }
19752 
19753  private:
19754   // Appends the contents of message to message_.
19755   void AppendMessage(const Message& a_message) {
19756     if (message_.get() == NULL)
19757       message_.reset(new ::std::string);
19758     message_->append(a_message.GetString().c_str());
19759   }
19760 
19761   // Swap the contents of this AssertionResult with other.
19762   void swap(AssertionResult& other);
19763 
19764   // Stores result of the assertion predicate.
19765   bool success_;
19766   // Stores the message describing the condition in case the expectation
19767   // construct is not satisfied with the predicate's outcome.
19768   // Referenced via a pointer to avoid taking too much stack frame space
19769   // with test assertions.
19770   internal::scoped_ptr< ::std::string> message_;
19771 };
19772 
19773 // Makes a successful assertion result.
19774 GTEST_API_ AssertionResult AssertionSuccess();
19775 
19776 // Makes a failed assertion result.
19777 GTEST_API_ AssertionResult AssertionFailure();
19778 
19779 // Makes a failed assertion result with the given failure message.
19780 // Deprecated; use AssertionFailure() << msg.
19781 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
19782 
19783 }  // namespace testing
19784 
19785 // Includes the auto-generated header that implements a family of generic
19786 // predicate assertion macros. This include comes late because it relies on
19787 // APIs declared above.
19788 // Copyright 2006, Google Inc.
19789 // All rights reserved.
19790 //
19791 // Redistribution and use in source and binary forms, with or without
19792 // modification, are permitted provided that the following conditions are
19793 // met:
19794 //
19795 //     * Redistributions of source code must retain the above copyright
19796 // notice, this list of conditions and the following disclaimer.
19797 //     * Redistributions in binary form must reproduce the above
19798 // copyright notice, this list of conditions and the following disclaimer
19799 // in the documentation and/or other materials provided with the
19800 // distribution.
19801 //     * Neither the name of Google Inc. nor the names of its
19802 // contributors may be used to endorse or promote products derived from
19803 // this software without specific prior written permission.
19804 //
19805 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19806 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19807 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19808 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19809 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19810 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19811 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19812 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19813 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19814 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19815 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19816 
19817 // This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
19818 // 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
19819 //
19820 // Implements a family of generic predicate assertion macros.
19821 
19822 // GOOGLETEST_CM0001 DO NOT DELETE
19823 
19824 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19825 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19826 
19827 
19828 namespace testing {
19829 
19830 // This header implements a family of generic predicate assertion
19831 // macros:
19832 //
19833 //   ASSERT_PRED_FORMAT1(pred_format, v1)
19834 //   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19835 //   ...
19836 //
19837 // where pred_format is a function or functor that takes n (in the
19838 // case of ASSERT_PRED_FORMATn) values and their source expression
19839 // text, and returns a testing::AssertionResult.  See the definition
19840 // of ASSERT_EQ in gtest.h for an example.
19841 //
19842 // If you don't care about formatting, you can use the more
19843 // restrictive version:
19844 //
19845 //   ASSERT_PRED1(pred, v1)
19846 //   ASSERT_PRED2(pred, v1, v2)
19847 //   ...
19848 //
19849 // where pred is an n-ary function or functor that returns bool,
19850 // and the values v1, v2, ..., must support the << operator for
19851 // streaming to std::ostream.
19852 //
19853 // We also define the EXPECT_* variations.
19854 //
19855 // For now we only support predicates whose arity is at most 5.
19856 
19857 // GTEST_ASSERT_ is the basic statement to which all of the assertions
19858 // in this file reduce.  Don't use this in your code.
19859 
19860 #define GTEST_ASSERT_(expression, on_failure) \
19861   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19862   if (const ::testing::AssertionResult gtest_ar = (expression)) \
19863     ; \
19864   else \
19865     on_failure(gtest_ar.failure_message())
19866 
19867 
19868 // Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19869 // this in your code.
19870 template <typename Pred,
19871           typename T1>
19872 AssertionResult AssertPred1Helper(const char* pred_text,
19873                                   const char* e1,
19874                                   Pred pred,
19875                                   const T1& v1) {
19876   if (pred(v1)) return AssertionSuccess();
19877 
19878   return AssertionFailure() << pred_text << "("
19879                             << e1 << ") evaluates to false, where"
19880                             << "\n" << e1 << " evaluates to " << v1;
19881 }
19882 
19883 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19884 // Don't use this in your code.
19885 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19886   GTEST_ASSERT_(pred_format(#v1, v1), \
19887                 on_failure)
19888 
19889 // Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19890 // this in your code.
19891 #define GTEST_PRED1_(pred, v1, on_failure)\
19892   GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19893                                              #v1, \
19894                                              pred, \
19895                                              v1), on_failure)
19896 
19897 // Unary predicate assertion macros.
19898 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
19899   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19900 #define EXPECT_PRED1(pred, v1) \
19901   GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19902 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
19903   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19904 #define ASSERT_PRED1(pred, v1) \
19905   GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19906 
19907 
19908 
19909 // Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19910 // this in your code.
19911 template <typename Pred,
19912           typename T1,
19913           typename T2>
19914 AssertionResult AssertPred2Helper(const char* pred_text,
19915                                   const char* e1,
19916                                   const char* e2,
19917                                   Pred pred,
19918                                   const T1& v1,
19919                                   const T2& v2) {
19920   if (pred(v1, v2)) return AssertionSuccess();
19921 
19922   return AssertionFailure() << pred_text << "("
19923                             << e1 << ", "
19924                             << e2 << ") evaluates to false, where"
19925                             << "\n" << e1 << " evaluates to " << v1
19926                             << "\n" << e2 << " evaluates to " << v2;
19927 }
19928 
19929 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19930 // Don't use this in your code.
19931 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19932   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19933                 on_failure)
19934 
19935 // Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19936 // this in your code.
19937 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
19938   GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19939                                              #v1, \
19940                                              #v2, \
19941                                              pred, \
19942                                              v1, \
19943                                              v2), on_failure)
19944 
19945 // Binary predicate assertion macros.
19946 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19947   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19948 #define EXPECT_PRED2(pred, v1, v2) \
19949   GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19950 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19951   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19952 #define ASSERT_PRED2(pred, v1, v2) \
19953   GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19954 
19955 
19956 
19957 // Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19958 // this in your code.
19959 template <typename Pred,
19960           typename T1,
19961           typename T2,
19962           typename T3>
19963 AssertionResult AssertPred3Helper(const char* pred_text,
19964                                   const char* e1,
19965                                   const char* e2,
19966                                   const char* e3,
19967                                   Pred pred,
19968                                   const T1& v1,
19969                                   const T2& v2,
19970                                   const T3& v3) {
19971   if (pred(v1, v2, v3)) return AssertionSuccess();
19972 
19973   return AssertionFailure() << pred_text << "("
19974                             << e1 << ", "
19975                             << e2 << ", "
19976                             << e3 << ") evaluates to false, where"
19977                             << "\n" << e1 << " evaluates to " << v1
19978                             << "\n" << e2 << " evaluates to " << v2
19979                             << "\n" << e3 << " evaluates to " << v3;
19980 }
19981 
19982 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19983 // Don't use this in your code.
19984 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19985   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19986                 on_failure)
19987 
19988 // Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19989 // this in your code.
19990 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19991   GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19992                                              #v1, \
19993                                              #v2, \
19994                                              #v3, \
19995                                              pred, \
19996                                              v1, \
19997                                              v2, \
19998                                              v3), on_failure)
19999 
20000 // Ternary predicate assertion macros.
20001 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
20002   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
20003 #define EXPECT_PRED3(pred, v1, v2, v3) \
20004   GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
20005 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
20006   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
20007 #define ASSERT_PRED3(pred, v1, v2, v3) \
20008   GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
20009 
20010 
20011 
20012 // Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
20013 // this in your code.
20014 template <typename Pred,
20015           typename T1,
20016           typename T2,
20017           typename T3,
20018           typename T4>
20019 AssertionResult AssertPred4Helper(const char* pred_text,
20020                                   const char* e1,
20021                                   const char* e2,
20022                                   const char* e3,
20023                                   const char* e4,
20024                                   Pred pred,
20025                                   const T1& v1,
20026                                   const T2& v2,
20027                                   const T3& v3,
20028                                   const T4& v4) {
20029   if (pred(v1, v2, v3, v4)) return AssertionSuccess();
20030 
20031   return AssertionFailure() << pred_text << "("
20032                             << e1 << ", "
20033                             << e2 << ", "
20034                             << e3 << ", "
20035                             << e4 << ") evaluates to false, where"
20036                             << "\n" << e1 << " evaluates to " << v1
20037                             << "\n" << e2 << " evaluates to " << v2
20038                             << "\n" << e3 << " evaluates to " << v3
20039                             << "\n" << e4 << " evaluates to " << v4;
20040 }
20041 
20042 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
20043 // Don't use this in your code.
20044 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
20045   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
20046                 on_failure)
20047 
20048 // Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
20049 // this in your code.
20050 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
20051   GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
20052                                              #v1, \
20053                                              #v2, \
20054                                              #v3, \
20055                                              #v4, \
20056                                              pred, \
20057                                              v1, \
20058                                              v2, \
20059                                              v3, \
20060                                              v4), on_failure)
20061 
20062 // 4-ary predicate assertion macros.
20063 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
20064   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
20065 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
20066   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
20067 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
20068   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
20069 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
20070   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
20071 
20072 
20073 
20074 // Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
20075 // this in your code.
20076 template <typename Pred,
20077           typename T1,
20078           typename T2,
20079           typename T3,
20080           typename T4,
20081           typename T5>
20082 AssertionResult AssertPred5Helper(const char* pred_text,
20083                                   const char* e1,
20084                                   const char* e2,
20085                                   const char* e3,
20086                                   const char* e4,
20087                                   const char* e5,
20088                                   Pred pred,
20089                                   const T1& v1,
20090                                   const T2& v2,
20091                                   const T3& v3,
20092                                   const T4& v4,
20093                                   const T5& v5) {
20094   if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
20095 
20096   return AssertionFailure() << pred_text << "("
20097                             << e1 << ", "
20098                             << e2 << ", "
20099                             << e3 << ", "
20100                             << e4 << ", "
20101                             << e5 << ") evaluates to false, where"
20102                             << "\n" << e1 << " evaluates to " << v1
20103                             << "\n" << e2 << " evaluates to " << v2
20104                             << "\n" << e3 << " evaluates to " << v3
20105                             << "\n" << e4 << " evaluates to " << v4
20106                             << "\n" << e5 << " evaluates to " << v5;
20107 }
20108 
20109 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
20110 // Don't use this in your code.
20111 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
20112   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
20113                 on_failure)
20114 
20115 // Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
20116 // this in your code.
20117 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
20118   GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
20119                                              #v1, \
20120                                              #v2, \
20121                                              #v3, \
20122                                              #v4, \
20123                                              #v5, \
20124                                              pred, \
20125                                              v1, \
20126                                              v2, \
20127                                              v3, \
20128                                              v4, \
20129                                              v5), on_failure)
20130 
20131 // 5-ary predicate assertion macros.
20132 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
20133   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
20134 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
20135   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
20136 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
20137   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
20138 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
20139   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
20140 
20141 
20142 
20143 }  // namespace testing
20144 
20145 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
20146 
20147 namespace testing {
20148 
20149 // The abstract class that all tests inherit from.
20150 //
20151 // In Google Test, a unit test program contains one or many TestCases, and
20152 // each TestCase contains one or many Tests.
20153 //
20154 // When you define a test using the TEST macro, you don't need to
20155 // explicitly derive from Test - the TEST macro automatically does
20156 // this for you.
20157 //
20158 // The only time you derive from Test is when defining a test fixture
20159 // to be used in a TEST_F.  For example:
20160 //
20161 //   class FooTest : public testing::Test {
20162 //    protected:
20163 //     void SetUp() override { ... }
20164 //     void TearDown() override { ... }
20165 //     ...
20166 //   };
20167 //
20168 //   TEST_F(FooTest, Bar) { ... }
20169 //   TEST_F(FooTest, Baz) { ... }
20170 //
20171 // Test is not copyable.
20172 class GTEST_API_ Test {
20173  public:
20174   friend class TestInfo;
20175 
20176   // Defines types for pointers to functions that set up and tear down
20177   // a test case.
20178   typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
20179   typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
20180 
20181   // The d'tor is virtual as we intend to inherit from Test.
20182   virtual ~Test();
20183 
20184   // Sets up the stuff shared by all tests in this test case.
20185   //
20186   // Google Test will call Foo::SetUpTestCase() before running the first
20187   // test in test case Foo.  Hence a sub-class can define its own
20188   // SetUpTestCase() method to shadow the one defined in the super
20189   // class.
20190   static void SetUpTestCase() {}
20191 
20192   // Tears down the stuff shared by all tests in this test case.
20193   //
20194   // Google Test will call Foo::TearDownTestCase() after running the last
20195   // test in test case Foo.  Hence a sub-class can define its own
20196   // TearDownTestCase() method to shadow the one defined in the super
20197   // class.
20198   static void TearDownTestCase() {}
20199 
20200   // Returns true iff the current test has a fatal failure.
20201   static bool HasFatalFailure();
20202 
20203   // Returns true iff the current test has a non-fatal failure.
20204   static bool HasNonfatalFailure();
20205 
20206   // Returns true iff the current test has a (either fatal or
20207   // non-fatal) failure.
20208   static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
20209 
20210   // Logs a property for the current test, test case, or for the entire
20211   // invocation of the test program when used outside of the context of a
20212   // test case.  Only the last value for a given key is remembered.  These
20213   // are public static so they can be called from utility functions that are
20214   // not members of the test fixture.  Calls to RecordProperty made during
20215   // lifespan of the test (from the moment its constructor starts to the
20216   // moment its destructor finishes) will be output in XML as attributes of
20217   // the <testcase> element.  Properties recorded from fixture's
20218   // SetUpTestCase or TearDownTestCase are logged as attributes of the
20219   // corresponding <testsuite> element.  Calls to RecordProperty made in the
20220   // global context (before or after invocation of RUN_ALL_TESTS and from
20221   // SetUp/TearDown method of Environment objects registered with Google
20222   // Test) will be output as attributes of the <testsuites> element.
20223   static void RecordProperty(const std::string& key, const std::string& value);
20224   static void RecordProperty(const std::string& key, int value);
20225 
20226  protected:
20227   // Creates a Test object.
20228   Test();
20229 
20230   // Sets up the test fixture.
20231   virtual void SetUp();
20232 
20233   // Tears down the test fixture.
20234   virtual void TearDown();
20235 
20236  private:
20237   // Returns true iff the current test has the same fixture class as
20238   // the first test in the current test case.
20239   static bool HasSameFixtureClass();
20240 
20241   // Runs the test after the test fixture has been set up.
20242   //
20243   // A sub-class must implement this to define the test logic.
20244   //
20245   // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
20246   // Instead, use the TEST or TEST_F macro.
20247   virtual void TestBody() = 0;
20248 
20249   // Sets up, executes, and tears down the test.
20250   void Run();
20251 
20252   // Deletes self.  We deliberately pick an unusual name for this
20253   // internal method to avoid clashing with names used in user TESTs.
20254   void DeleteSelf_() { delete this; }
20255 
20256   const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
20257 
20258   // Often a user misspells SetUp() as Setup() and spends a long time
20259   // wondering why it is never called by Google Test.  The declaration of
20260   // the following method is solely for catching such an error at
20261   // compile time:
20262   //
20263   //   - The return type is deliberately chosen to be not void, so it
20264   //   will be a conflict if void Setup() is declared in the user's
20265   //   test fixture.
20266   //
20267   //   - This method is private, so it will be another compiler error
20268   //   if the method is called from the user's test fixture.
20269   //
20270   // DO NOT OVERRIDE THIS FUNCTION.
20271   //
20272   // If you see an error about overriding the following function or
20273   // about it being private, you have mis-spelled SetUp() as Setup().
20274   struct Setup_should_be_spelled_SetUp {};
20275   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
20276 
20277   // We disallow copying Tests.
20278   GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
20279 };
20280 
20281 typedef internal::TimeInMillis TimeInMillis;
20282 
20283 // A copyable object representing a user specified test property which can be
20284 // output as a key/value string pair.
20285 //
20286 // Don't inherit from TestProperty as its destructor is not virtual.
20287 class TestProperty {
20288  public:
20289   // C'tor.  TestProperty does NOT have a default constructor.
20290   // Always use this constructor (with parameters) to create a
20291   // TestProperty object.
20292   TestProperty(const std::string& a_key, const std::string& a_value) :
20293     key_(a_key), value_(a_value) {
20294   }
20295 
20296   // Gets the user supplied key.
20297   const char* key() const {
20298     return key_.c_str();
20299   }
20300 
20301   // Gets the user supplied value.
20302   const char* value() const {
20303     return value_.c_str();
20304   }
20305 
20306   // Sets a new value, overriding the one supplied in the constructor.
20307   void SetValue(const std::string& new_value) {
20308     value_ = new_value;
20309   }
20310 
20311  private:
20312   // The key supplied by the user.
20313   std::string key_;
20314   // The value supplied by the user.
20315   std::string value_;
20316 };
20317 
20318 // The result of a single Test.  This includes a list of
20319 // TestPartResults, a list of TestProperties, a count of how many
20320 // death tests there are in the Test, and how much time it took to run
20321 // the Test.
20322 //
20323 // TestResult is not copyable.
20324 class GTEST_API_ TestResult {
20325  public:
20326   // Creates an empty TestResult.
20327   TestResult();
20328 
20329   // D'tor.  Do not inherit from TestResult.
20330   ~TestResult();
20331 
20332   // Gets the number of all test parts.  This is the sum of the number
20333   // of successful test parts and the number of failed test parts.
20334   int total_part_count() const;
20335 
20336   // Returns the number of the test properties.
20337   int test_property_count() const;
20338 
20339   // Returns true iff the test passed (i.e. no test part failed).
20340   bool Passed() const { return !Failed(); }
20341 
20342   // Returns true iff the test failed.
20343   bool Failed() const;
20344 
20345   // Returns true iff the test fatally failed.
20346   bool HasFatalFailure() const;
20347 
20348   // Returns true iff the test has a non-fatal failure.
20349   bool HasNonfatalFailure() const;
20350 
20351   // Returns the elapsed time, in milliseconds.
20352   TimeInMillis elapsed_time() const { return elapsed_time_; }
20353 
20354   // Returns the i-th test part result among all the results. i can range from 0
20355   // to total_part_count() - 1. If i is not in that range, aborts the program.
20356   const TestPartResult& GetTestPartResult(int i) const;
20357 
20358   // Returns the i-th test property. i can range from 0 to
20359   // test_property_count() - 1. If i is not in that range, aborts the
20360   // program.
20361   const TestProperty& GetTestProperty(int i) const;
20362 
20363  private:
20364   friend class TestInfo;
20365   friend class TestCase;
20366   friend class UnitTest;
20367   friend class internal::DefaultGlobalTestPartResultReporter;
20368   friend class internal::ExecDeathTest;
20369   friend class internal::TestResultAccessor;
20370   friend class internal::UnitTestImpl;
20371   friend class internal::WindowsDeathTest;
20372   friend class internal::FuchsiaDeathTest;
20373 
20374   // Gets the vector of TestPartResults.
20375   const std::vector<TestPartResult>& test_part_results() const {
20376     return test_part_results_;
20377   }
20378 
20379   // Gets the vector of TestProperties.
20380   const std::vector<TestProperty>& test_properties() const {
20381     return test_properties_;
20382   }
20383 
20384   // Sets the elapsed time.
20385   void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
20386 
20387   // Adds a test property to the list. The property is validated and may add
20388   // a non-fatal failure if invalid (e.g., if it conflicts with reserved
20389   // key names). If a property is already recorded for the same key, the
20390   // value will be updated, rather than storing multiple values for the same
20391   // key.  xml_element specifies the element for which the property is being
20392   // recorded and is used for validation.
20393   void RecordProperty(const std::string& xml_element,
20394                       const TestProperty& test_property);
20395 
20396   // Adds a failure if the key is a reserved attribute of Google Test
20397   // testcase tags.  Returns true if the property is valid.
20398   // FIXME: Validate attribute names are legal and human readable.
20399   static bool ValidateTestProperty(const std::string& xml_element,
20400                                    const TestProperty& test_property);
20401 
20402   // Adds a test part result to the list.
20403   void AddTestPartResult(const TestPartResult& test_part_result);
20404 
20405   // Returns the death test count.
20406   int death_test_count() const { return death_test_count_; }
20407 
20408   // Increments the death test count, returning the new count.
20409   int increment_death_test_count() { return ++death_test_count_; }
20410 
20411   // Clears the test part results.
20412   void ClearTestPartResults();
20413 
20414   // Clears the object.
20415   void Clear();
20416 
20417   // Protects mutable state of the property vector and of owned
20418   // properties, whose values may be updated.
20419   internal::Mutex test_properites_mutex_;
20420 
20421   // The vector of TestPartResults
20422   std::vector<TestPartResult> test_part_results_;
20423   // The vector of TestProperties
20424   std::vector<TestProperty> test_properties_;
20425   // Running count of death tests.
20426   int death_test_count_;
20427   // The elapsed time, in milliseconds.
20428   TimeInMillis elapsed_time_;
20429 
20430   // We disallow copying TestResult.
20431   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
20432 };  // class TestResult
20433 
20434 // A TestInfo object stores the following information about a test:
20435 //
20436 //   Test case name
20437 //   Test name
20438 //   Whether the test should be run
20439 //   A function pointer that creates the test object when invoked
20440 //   Test result
20441 //
20442 // The constructor of TestInfo registers itself with the UnitTest
20443 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
20444 // run.
20445 class GTEST_API_ TestInfo {
20446  public:
20447   // Destructs a TestInfo object.  This function is not virtual, so
20448   // don't inherit from TestInfo.
20449   ~TestInfo();
20450 
20451   // Returns the test case name.
20452   const char* test_case_name() const { return test_case_name_.c_str(); }
20453 
20454   // Returns the test name.
20455   const char* name() const { return name_.c_str(); }
20456 
20457   // Returns the name of the parameter type, or NULL if this is not a typed
20458   // or a type-parameterized test.
20459   const char* type_param() const {
20460     if (type_param_.get() != NULL)
20461       return type_param_->c_str();
20462     return NULL;
20463   }
20464 
20465   // Returns the text representation of the value parameter, or NULL if this
20466   // is not a value-parameterized test.
20467   const char* value_param() const {
20468     if (value_param_.get() != NULL)
20469       return value_param_->c_str();
20470     return NULL;
20471   }
20472 
20473   // Returns the file name where this test is defined.
20474   const char* file() const { return location_.file.c_str(); }
20475 
20476   // Returns the line where this test is defined.
20477   int line() const { return location_.line; }
20478 
20479   // Return true if this test should not be run because it's in another shard.
20480   bool is_in_another_shard() const { return is_in_another_shard_; }
20481 
20482   // Returns true if this test should run, that is if the test is not
20483   // disabled (or it is disabled but the also_run_disabled_tests flag has
20484   // been specified) and its full name matches the user-specified filter.
20485   //
20486   // Google Test allows the user to filter the tests by their full names.
20487   // The full name of a test Bar in test case Foo is defined as
20488   // "Foo.Bar".  Only the tests that match the filter will run.
20489   //
20490   // A filter is a colon-separated list of glob (not regex) patterns,
20491   // optionally followed by a '-' and a colon-separated list of
20492   // negative patterns (tests to exclude).  A test is run if it
20493   // matches one of the positive patterns and does not match any of
20494   // the negative patterns.
20495   //
20496   // For example, *A*:Foo.* is a filter that matches any string that
20497   // contains the character 'A' or starts with "Foo.".
20498   bool should_run() const { return should_run_; }
20499 
20500   // Returns true iff this test will appear in the XML report.
20501   bool is_reportable() const {
20502     // The XML report includes tests matching the filter, excluding those
20503     // run in other shards.
20504     return matches_filter_ && !is_in_another_shard_;
20505   }
20506 
20507   // Returns the result of the test.
20508   const TestResult* result() const { return &result_; }
20509 
20510  private:
20511 #if GTEST_HAS_DEATH_TEST
20512   friend class internal::DefaultDeathTestFactory;
20513 #endif  // GTEST_HAS_DEATH_TEST
20514   friend class Test;
20515   friend class TestCase;
20516   friend class internal::UnitTestImpl;
20517   friend class internal::StreamingListenerTest;
20518   friend TestInfo* internal::MakeAndRegisterTestInfo(
20519       const char* test_case_name,
20520       const char* name,
20521       const char* type_param,
20522       const char* value_param,
20523       internal::CodeLocation code_location,
20524       internal::TypeId fixture_class_id,
20525       Test::SetUpTestCaseFunc set_up_tc,
20526       Test::TearDownTestCaseFunc tear_down_tc,
20527       internal::TestFactoryBase* factory);
20528 
20529   // Constructs a TestInfo object. The newly constructed instance assumes
20530   // ownership of the factory object.
20531   TestInfo(const std::string& test_case_name,
20532            const std::string& name,
20533            const char* a_type_param,   // NULL if not a type-parameterized test
20534            const char* a_value_param,  // NULL if not a value-parameterized test
20535            internal::CodeLocation a_code_location,
20536            internal::TypeId fixture_class_id,
20537            internal::TestFactoryBase* factory);
20538 
20539   // Increments the number of death tests encountered in this test so
20540   // far.
20541   int increment_death_test_count() {
20542     return result_.increment_death_test_count();
20543   }
20544 
20545   // Creates the test object, runs it, records its result, and then
20546   // deletes it.
20547   void Run();
20548 
20549   static void ClearTestResult(TestInfo* test_info) {
20550     test_info->result_.Clear();
20551   }
20552 
20553   // These fields are immutable properties of the test.
20554   const std::string test_case_name_;     // Test case name
20555   const std::string name_;               // Test name
20556   // Name of the parameter type, or NULL if this is not a typed or a
20557   // type-parameterized test.
20558   const internal::scoped_ptr<const ::std::string> type_param_;
20559   // Text representation of the value parameter, or NULL if this is not a
20560   // value-parameterized test.
20561   const internal::scoped_ptr<const ::std::string> value_param_;
20562   internal::CodeLocation location_;
20563   const internal::TypeId fixture_class_id_;   // ID of the test fixture class
20564   bool should_run_;                 // True iff this test should run
20565   bool is_disabled_;                // True iff this test is disabled
20566   bool matches_filter_;             // True if this test matches the
20567                                     // user-specified filter.
20568   bool is_in_another_shard_;        // Will be run in another shard.
20569   internal::TestFactoryBase* const factory_;  // The factory that creates
20570                                               // the test object
20571 
20572   // This field is mutable and needs to be reset before running the
20573   // test for the second time.
20574   TestResult result_;
20575 
20576   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
20577 };
20578 
20579 // A test case, which consists of a vector of TestInfos.
20580 //
20581 // TestCase is not copyable.
20582 class GTEST_API_ TestCase {
20583  public:
20584   // Creates a TestCase with the given name.
20585   //
20586   // TestCase does NOT have a default constructor.  Always use this
20587   // constructor to create a TestCase object.
20588   //
20589   // Arguments:
20590   //
20591   //   name:         name of the test case
20592   //   a_type_param: the name of the test's type parameter, or NULL if
20593   //                 this is not a type-parameterized test.
20594   //   set_up_tc:    pointer to the function that sets up the test case
20595   //   tear_down_tc: pointer to the function that tears down the test case
20596   TestCase(const char* name, const char* a_type_param,
20597            Test::SetUpTestCaseFunc set_up_tc,
20598            Test::TearDownTestCaseFunc tear_down_tc);
20599 
20600   // Destructor of TestCase.
20601   virtual ~TestCase();
20602 
20603   // Gets the name of the TestCase.
20604   const char* name() const { return name_.c_str(); }
20605 
20606   // Returns the name of the parameter type, or NULL if this is not a
20607   // type-parameterized test case.
20608   const char* type_param() const {
20609     if (type_param_.get() != NULL)
20610       return type_param_->c_str();
20611     return NULL;
20612   }
20613 
20614   // Returns true if any test in this test case should run.
20615   bool should_run() const { return should_run_; }
20616 
20617   // Gets the number of successful tests in this test case.
20618   int successful_test_count() const;
20619 
20620   // Gets the number of failed tests in this test case.
20621   int failed_test_count() const;
20622 
20623   // Gets the number of disabled tests that will be reported in the XML report.
20624   int reportable_disabled_test_count() const;
20625 
20626   // Gets the number of disabled tests in this test case.
20627   int disabled_test_count() const;
20628 
20629   // Gets the number of tests to be printed in the XML report.
20630   int reportable_test_count() const;
20631 
20632   // Get the number of tests in this test case that should run.
20633   int test_to_run_count() const;
20634 
20635   // Gets the number of all tests in this test case.
20636   int total_test_count() const;
20637 
20638   // Returns true iff the test case passed.
20639   bool Passed() const { return !Failed(); }
20640 
20641   // Returns true iff the test case failed.
20642   bool Failed() const { return failed_test_count() > 0; }
20643 
20644   // Returns the elapsed time, in milliseconds.
20645   TimeInMillis elapsed_time() const { return elapsed_time_; }
20646 
20647   // Returns the i-th test among all the tests. i can range from 0 to
20648   // total_test_count() - 1. If i is not in that range, returns NULL.
20649   const TestInfo* GetTestInfo(int i) const;
20650 
20651   // Returns the TestResult that holds test properties recorded during
20652   // execution of SetUpTestCase and TearDownTestCase.
20653   const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
20654 
20655  private:
20656   friend class Test;
20657   friend class internal::UnitTestImpl;
20658 
20659   // Gets the (mutable) vector of TestInfos in this TestCase.
20660   std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
20661 
20662   // Gets the (immutable) vector of TestInfos in this TestCase.
20663   const std::vector<TestInfo*>& test_info_list() const {
20664     return test_info_list_;
20665   }
20666 
20667   // Returns the i-th test among all the tests. i can range from 0 to
20668   // total_test_count() - 1. If i is not in that range, returns NULL.
20669   TestInfo* GetMutableTestInfo(int i);
20670 
20671   // Sets the should_run member.
20672   void set_should_run(bool should) { should_run_ = should; }
20673 
20674   // Adds a TestInfo to this test case.  Will delete the TestInfo upon
20675   // destruction of the TestCase object.
20676   void AddTestInfo(TestInfo * test_info);
20677 
20678   // Clears the results of all tests in this test case.
20679   void ClearResult();
20680 
20681   // Clears the results of all tests in the given test case.
20682   static void ClearTestCaseResult(TestCase* test_case) {
20683     test_case->ClearResult();
20684   }
20685 
20686   // Runs every test in this TestCase.
20687   void Run();
20688 
20689   // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
20690   // for catching exceptions thrown from SetUpTestCase().
20691   void RunSetUpTestCase() { (*set_up_tc_)(); }
20692 
20693   // Runs TearDownTestCase() for this TestCase.  This wrapper is
20694   // needed for catching exceptions thrown from TearDownTestCase().
20695   void RunTearDownTestCase() { (*tear_down_tc_)(); }
20696 
20697   // Returns true iff test passed.
20698   static bool TestPassed(const TestInfo* test_info) {
20699     return test_info->should_run() && test_info->result()->Passed();
20700   }
20701 
20702   // Returns true iff test failed.
20703   static bool TestFailed(const TestInfo* test_info) {
20704     return test_info->should_run() && test_info->result()->Failed();
20705   }
20706 
20707   // Returns true iff the test is disabled and will be reported in the XML
20708   // report.
20709   static bool TestReportableDisabled(const TestInfo* test_info) {
20710     return test_info->is_reportable() && test_info->is_disabled_;
20711   }
20712 
20713   // Returns true iff test is disabled.
20714   static bool TestDisabled(const TestInfo* test_info) {
20715     return test_info->is_disabled_;
20716   }
20717 
20718   // Returns true iff this test will appear in the XML report.
20719   static bool TestReportable(const TestInfo* test_info) {
20720     return test_info->is_reportable();
20721   }
20722 
20723   // Returns true if the given test should run.
20724   static bool ShouldRunTest(const TestInfo* test_info) {
20725     return test_info->should_run();
20726   }
20727 
20728   // Shuffles the tests in this test case.
20729   void ShuffleTests(internal::Random* random);
20730 
20731   // Restores the test order to before the first shuffle.
20732   void UnshuffleTests();
20733 
20734   // Name of the test case.
20735   std::string name_;
20736   // Name of the parameter type, or NULL if this is not a typed or a
20737   // type-parameterized test.
20738   const internal::scoped_ptr<const ::std::string> type_param_;
20739   // The vector of TestInfos in their original order.  It owns the
20740   // elements in the vector.
20741   std::vector<TestInfo*> test_info_list_;
20742   // Provides a level of indirection for the test list to allow easy
20743   // shuffling and restoring the test order.  The i-th element in this
20744   // vector is the index of the i-th test in the shuffled test list.
20745   std::vector<int> test_indices_;
20746   // Pointer to the function that sets up the test case.
20747   Test::SetUpTestCaseFunc set_up_tc_;
20748   // Pointer to the function that tears down the test case.
20749   Test::TearDownTestCaseFunc tear_down_tc_;
20750   // True iff any test in this test case should run.
20751   bool should_run_;
20752   // Elapsed time, in milliseconds.
20753   TimeInMillis elapsed_time_;
20754   // Holds test properties recorded during execution of SetUpTestCase and
20755   // TearDownTestCase.
20756   TestResult ad_hoc_test_result_;
20757 
20758   // We disallow copying TestCases.
20759   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
20760 };
20761 
20762 // An Environment object is capable of setting up and tearing down an
20763 // environment.  You should subclass this to define your own
20764 // environment(s).
20765 //
20766 // An Environment object does the set-up and tear-down in virtual
20767 // methods SetUp() and TearDown() instead of the constructor and the
20768 // destructor, as:
20769 //
20770 //   1. You cannot safely throw from a destructor.  This is a problem
20771 //      as in some cases Google Test is used where exceptions are enabled, and
20772 //      we may want to implement ASSERT_* using exceptions where they are
20773 //      available.
20774 //   2. You cannot use ASSERT_* directly in a constructor or
20775 //      destructor.
20776 class Environment {
20777  public:
20778   // The d'tor is virtual as we need to subclass Environment.
20779   virtual ~Environment() {}
20780 
20781   // Override this to define how to set up the environment.
20782   virtual void SetUp() {}
20783 
20784   // Override this to define how to tear down the environment.
20785   virtual void TearDown() {}
20786  private:
20787   // If you see an error about overriding the following function or
20788   // about it being private, you have mis-spelled SetUp() as Setup().
20789   struct Setup_should_be_spelled_SetUp {};
20790   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
20791 };
20792 
20793 #if GTEST_HAS_EXCEPTIONS
20794 
20795 // Exception which can be thrown from TestEventListener::OnTestPartResult.
20796 class GTEST_API_ AssertionException
20797     : public internal::GoogleTestFailureException {
20798  public:
20799   explicit AssertionException(const TestPartResult& result)
20800       : GoogleTestFailureException(result) {}
20801 };
20802 
20803 #endif  // GTEST_HAS_EXCEPTIONS
20804 
20805 // The interface for tracing execution of tests. The methods are organized in
20806 // the order the corresponding events are fired.
20807 class TestEventListener {
20808  public:
20809   virtual ~TestEventListener() {}
20810 
20811   // Fired before any test activity starts.
20812   virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
20813 
20814   // Fired before each iteration of tests starts.  There may be more than
20815   // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
20816   // index, starting from 0.
20817   virtual void OnTestIterationStart(const UnitTest& unit_test,
20818                                     int iteration) = 0;
20819 
20820   // Fired before environment set-up for each iteration of tests starts.
20821   virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
20822 
20823   // Fired after environment set-up for each iteration of tests ends.
20824   virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
20825 
20826   // Fired before the test case starts.
20827   virtual void OnTestCaseStart(const TestCase& test_case) = 0;
20828 
20829   // Fired before the test starts.
20830   virtual void OnTestStart(const TestInfo& test_info) = 0;
20831 
20832   // Fired after a failed assertion or a SUCCEED() invocation.
20833   // If you want to throw an exception from this function to skip to the next
20834   // TEST, it must be AssertionException defined above, or inherited from it.
20835   virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
20836 
20837   // Fired after the test ends.
20838   virtual void OnTestEnd(const TestInfo& test_info) = 0;
20839 
20840   // Fired after the test case ends.
20841   virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
20842 
20843   // Fired before environment tear-down for each iteration of tests starts.
20844   virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
20845 
20846   // Fired after environment tear-down for each iteration of tests ends.
20847   virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
20848 
20849   // Fired after each iteration of tests finishes.
20850   virtual void OnTestIterationEnd(const UnitTest& unit_test,
20851                                   int iteration) = 0;
20852 
20853   // Fired after all test activities have ended.
20854   virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
20855 };
20856 
20857 // The convenience class for users who need to override just one or two
20858 // methods and are not concerned that a possible change to a signature of
20859 // the methods they override will not be caught during the build.  For
20860 // comments about each method please see the definition of TestEventListener
20861 // above.
20862 class EmptyTestEventListener : public TestEventListener {
20863  public:
20864   virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
20865   virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
20866                                     int /*iteration*/) {}
20867   virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
20868   virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
20869   virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
20870   virtual void OnTestStart(const TestInfo& /*test_info*/) {}
20871   virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
20872   virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
20873   virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
20874   virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
20875   virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
20876   virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
20877                                   int /*iteration*/) {}
20878   virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
20879 };
20880 
20881 // TestEventListeners lets users add listeners to track events in Google Test.
20882 class GTEST_API_ TestEventListeners {
20883  public:
20884   TestEventListeners();
20885   ~TestEventListeners();
20886 
20887   // Appends an event listener to the end of the list. Google Test assumes
20888   // the ownership of the listener (i.e. it will delete the listener when
20889   // the test program finishes).
20890   void Append(TestEventListener* listener);
20891 
20892   // Removes the given event listener from the list and returns it.  It then
20893   // becomes the caller's responsibility to delete the listener. Returns
20894   // NULL if the listener is not found in the list.
20895   TestEventListener* Release(TestEventListener* listener);
20896 
20897   // Returns the standard listener responsible for the default console
20898   // output.  Can be removed from the listeners list to shut down default
20899   // console output.  Note that removing this object from the listener list
20900   // with Release transfers its ownership to the caller and makes this
20901   // function return NULL the next time.
20902   TestEventListener* default_result_printer() const {
20903     return default_result_printer_;
20904   }
20905 
20906   // Returns the standard listener responsible for the default XML output
20907   // controlled by the --gtest_output=xml flag.  Can be removed from the
20908   // listeners list by users who want to shut down the default XML output
20909   // controlled by this flag and substitute it with custom one.  Note that
20910   // removing this object from the listener list with Release transfers its
20911   // ownership to the caller and makes this function return NULL the next
20912   // time.
20913   TestEventListener* default_xml_generator() const {
20914     return default_xml_generator_;
20915   }
20916 
20917  private:
20918   friend class TestCase;
20919   friend class TestInfo;
20920   friend class internal::DefaultGlobalTestPartResultReporter;
20921   friend class internal::NoExecDeathTest;
20922   friend class internal::TestEventListenersAccessor;
20923   friend class internal::UnitTestImpl;
20924 
20925   // Returns repeater that broadcasts the TestEventListener events to all
20926   // subscribers.
20927   TestEventListener* repeater();
20928 
20929   // Sets the default_result_printer attribute to the provided listener.
20930   // The listener is also added to the listener list and previous
20931   // default_result_printer is removed from it and deleted. The listener can
20932   // also be NULL in which case it will not be added to the list. Does
20933   // nothing if the previous and the current listener objects are the same.
20934   void SetDefaultResultPrinter(TestEventListener* listener);
20935 
20936   // Sets the default_xml_generator attribute to the provided listener.  The
20937   // listener is also added to the listener list and previous
20938   // default_xml_generator is removed from it and deleted. The listener can
20939   // also be NULL in which case it will not be added to the list. Does
20940   // nothing if the previous and the current listener objects are the same.
20941   void SetDefaultXmlGenerator(TestEventListener* listener);
20942 
20943   // Controls whether events will be forwarded by the repeater to the
20944   // listeners in the list.
20945   bool EventForwardingEnabled() const;
20946   void SuppressEventForwarding();
20947 
20948   // The actual list of listeners.
20949   internal::TestEventRepeater* repeater_;
20950   // Listener responsible for the standard result output.
20951   TestEventListener* default_result_printer_;
20952   // Listener responsible for the creation of the XML output file.
20953   TestEventListener* default_xml_generator_;
20954 
20955   // We disallow copying TestEventListeners.
20956   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
20957 };
20958 
20959 // A UnitTest consists of a vector of TestCases.
20960 //
20961 // This is a singleton class.  The only instance of UnitTest is
20962 // created when UnitTest::GetInstance() is first called.  This
20963 // instance is never deleted.
20964 //
20965 // UnitTest is not copyable.
20966 //
20967 // This class is thread-safe as long as the methods are called
20968 // according to their specification.
20969 class GTEST_API_ UnitTest {
20970  public:
20971   // Gets the singleton UnitTest object.  The first time this method
20972   // is called, a UnitTest object is constructed and returned.
20973   // Consecutive calls will return the same object.
20974   static UnitTest* GetInstance();
20975 
20976   // Runs all tests in this UnitTest object and prints the result.
20977   // Returns 0 if successful, or 1 otherwise.
20978   //
20979   // This method can only be called from the main thread.
20980   //
20981   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20982   int Run() GTEST_MUST_USE_RESULT_;
20983 
20984   // Returns the working directory when the first TEST() or TEST_F()
20985   // was executed.  The UnitTest object owns the string.
20986   const char* original_working_dir() const;
20987 
20988   // Returns the TestCase object for the test that's currently running,
20989   // or NULL if no test is running.
20990   const TestCase* current_test_case() const
20991       GTEST_LOCK_EXCLUDED_(mutex_);
20992 
20993   // Returns the TestInfo object for the test that's currently running,
20994   // or NULL if no test is running.
20995   const TestInfo* current_test_info() const
20996       GTEST_LOCK_EXCLUDED_(mutex_);
20997 
20998   // Returns the random seed used at the start of the current test run.
20999   int random_seed() const;
21000 
21001   // Returns the ParameterizedTestCaseRegistry object used to keep track of
21002   // value-parameterized tests and instantiate and register them.
21003   //
21004   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21005   internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
21006       GTEST_LOCK_EXCLUDED_(mutex_);
21007 
21008   // Gets the number of successful test cases.
21009   int successful_test_case_count() const;
21010 
21011   // Gets the number of failed test cases.
21012   int failed_test_case_count() const;
21013 
21014   // Gets the number of all test cases.
21015   int total_test_case_count() const;
21016 
21017   // Gets the number of all test cases that contain at least one test
21018   // that should run.
21019   int test_case_to_run_count() const;
21020 
21021   // Gets the number of successful tests.
21022   int successful_test_count() const;
21023 
21024   // Gets the number of failed tests.
21025   int failed_test_count() const;
21026 
21027   // Gets the number of disabled tests that will be reported in the XML report.
21028   int reportable_disabled_test_count() const;
21029 
21030   // Gets the number of disabled tests.
21031   int disabled_test_count() const;
21032 
21033   // Gets the number of tests to be printed in the XML report.
21034   int reportable_test_count() const;
21035 
21036   // Gets the number of all tests.
21037   int total_test_count() const;
21038 
21039   // Gets the number of tests that should run.
21040   int test_to_run_count() const;
21041 
21042   // Gets the time of the test program start, in ms from the start of the
21043   // UNIX epoch.
21044   TimeInMillis start_timestamp() const;
21045 
21046   // Gets the elapsed time, in milliseconds.
21047   TimeInMillis elapsed_time() const;
21048 
21049   // Returns true iff the unit test passed (i.e. all test cases passed).
21050   bool Passed() const;
21051 
21052   // Returns true iff the unit test failed (i.e. some test case failed
21053   // or something outside of all tests failed).
21054   bool Failed() const;
21055 
21056   // Gets the i-th test case among all the test cases. i can range from 0 to
21057   // total_test_case_count() - 1. If i is not in that range, returns NULL.
21058   const TestCase* GetTestCase(int i) const;
21059 
21060   // Returns the TestResult containing information on test failures and
21061   // properties logged outside of individual test cases.
21062   const TestResult& ad_hoc_test_result() const;
21063 
21064   // Returns the list of event listeners that can be used to track events
21065   // inside Google Test.
21066   TestEventListeners& listeners();
21067 
21068  private:
21069   // Registers and returns a global test environment.  When a test
21070   // program is run, all global test environments will be set-up in
21071   // the order they were registered.  After all tests in the program
21072   // have finished, all global test environments will be torn-down in
21073   // the *reverse* order they were registered.
21074   //
21075   // The UnitTest object takes ownership of the given environment.
21076   //
21077   // This method can only be called from the main thread.
21078   Environment* AddEnvironment(Environment* env);
21079 
21080   // Adds a TestPartResult to the current TestResult object.  All
21081   // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
21082   // eventually call this to report their results.  The user code
21083   // should use the assertion macros instead of calling this directly.
21084   void AddTestPartResult(TestPartResult::Type result_type,
21085                          const char* file_name,
21086                          int line_number,
21087                          const std::string& message,
21088                          const std::string& os_stack_trace)
21089       GTEST_LOCK_EXCLUDED_(mutex_);
21090 
21091   // Adds a TestProperty to the current TestResult object when invoked from
21092   // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
21093   // from SetUpTestCase or TearDownTestCase, or to the global property set
21094   // when invoked elsewhere.  If the result already contains a property with
21095   // the same key, the value will be updated.
21096   void RecordProperty(const std::string& key, const std::string& value);
21097 
21098   // Gets the i-th test case among all the test cases. i can range from 0 to
21099   // total_test_case_count() - 1. If i is not in that range, returns NULL.
21100   TestCase* GetMutableTestCase(int i);
21101 
21102   // Accessors for the implementation object.
21103   internal::UnitTestImpl* impl() { return impl_; }
21104   const internal::UnitTestImpl* impl() const { return impl_; }
21105 
21106   // These classes and functions are friends as they need to access private
21107   // members of UnitTest.
21108   friend class ScopedTrace;
21109   friend class Test;
21110   friend class internal::AssertHelper;
21111   friend class internal::StreamingListenerTest;
21112   friend class internal::UnitTestRecordPropertyTestHelper;
21113   friend Environment* AddGlobalTestEnvironment(Environment* env);
21114   friend internal::UnitTestImpl* internal::GetUnitTestImpl();
21115   friend void internal::ReportFailureInUnknownLocation(
21116       TestPartResult::Type result_type,
21117       const std::string& message);
21118 
21119   // Creates an empty UnitTest.
21120   UnitTest();
21121 
21122   // D'tor
21123   virtual ~UnitTest();
21124 
21125   // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
21126   // Google Test trace stack.
21127   void PushGTestTrace(const internal::TraceInfo& trace)
21128       GTEST_LOCK_EXCLUDED_(mutex_);
21129 
21130   // Pops a trace from the per-thread Google Test trace stack.
21131   void PopGTestTrace()
21132       GTEST_LOCK_EXCLUDED_(mutex_);
21133 
21134   // Protects mutable state in *impl_.  This is mutable as some const
21135   // methods need to lock it too.
21136   mutable internal::Mutex mutex_;
21137 
21138   // Opaque implementation object.  This field is never changed once
21139   // the object is constructed.  We don't mark it as const here, as
21140   // doing so will cause a warning in the constructor of UnitTest.
21141   // Mutable state in *impl_ is protected by mutex_.
21142   internal::UnitTestImpl* impl_;
21143 
21144   // We disallow copying UnitTest.
21145   GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
21146 };
21147 
21148 // A convenient wrapper for adding an environment for the test
21149 // program.
21150 //
21151 // You should call this before RUN_ALL_TESTS() is called, probably in
21152 // main().  If you use gtest_main, you need to call this before main()
21153 // starts for it to take effect.  For example, you can define a global
21154 // variable like this:
21155 //
21156 //   testing::Environment* const foo_env =
21157 //       testing::AddGlobalTestEnvironment(new FooEnvironment);
21158 //
21159 // However, we strongly recommend you to write your own main() and
21160 // call AddGlobalTestEnvironment() there, as relying on initialization
21161 // of global variables makes the code harder to read and may cause
21162 // problems when you register multiple environments from different
21163 // translation units and the environments have dependencies among them
21164 // (remember that the compiler doesn't guarantee the order in which
21165 // global variables from different translation units are initialized).
21166 inline Environment* AddGlobalTestEnvironment(Environment* env) {
21167   return UnitTest::GetInstance()->AddEnvironment(env);
21168 }
21169 
21170 // Initializes Google Test.  This must be called before calling
21171 // RUN_ALL_TESTS().  In particular, it parses a command line for the
21172 // flags that Google Test recognizes.  Whenever a Google Test flag is
21173 // seen, it is removed from argv, and *argc is decremented.
21174 //
21175 // No value is returned.  Instead, the Google Test flag variables are
21176 // updated.
21177 //
21178 // Calling the function for the second time has no user-visible effect.
21179 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
21180 
21181 // This overloaded version can be used in Windows programs compiled in
21182 // UNICODE mode.
21183 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
21184 
21185 namespace internal {
21186 
21187 // Separate the error generating code from the code path to reduce the stack
21188 // frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
21189 // when calling EXPECT_* in a tight loop.
21190 template <typename T1, typename T2>
21191 AssertionResult CmpHelperEQFailure(const char* lhs_expression,
21192                                    const char* rhs_expression,
21193                                    const T1& lhs, const T2& rhs) {
21194   return EqFailure(lhs_expression,
21195                    rhs_expression,
21196                    FormatForComparisonFailureMessage(lhs, rhs),
21197                    FormatForComparisonFailureMessage(rhs, lhs),
21198                    false);
21199 }
21200 
21201 // The helper function for {ASSERT|EXPECT}_EQ.
21202 template <typename T1, typename T2>
21203 AssertionResult CmpHelperEQ(const char* lhs_expression,
21204                             const char* rhs_expression,
21205                             const T1& lhs,
21206                             const T2& rhs) {
21207   if (lhs == rhs) {
21208     return AssertionSuccess();
21209   }
21210 
21211   return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
21212 }
21213 
21214 // With this overloaded version, we allow anonymous enums to be used
21215 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
21216 // can be implicitly cast to BiggestInt.
21217 GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
21218                                        const char* rhs_expression,
21219                                        BiggestInt lhs,
21220                                        BiggestInt rhs);
21221 
21222 // The helper class for {ASSERT|EXPECT}_EQ.  The template argument
21223 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
21224 // is a null pointer literal.  The following default implementation is
21225 // for lhs_is_null_literal being false.
21226 template <bool lhs_is_null_literal>
21227 class EqHelper {
21228  public:
21229   // This templatized version is for the general case.
21230   template <typename T1, typename T2>
21231   static AssertionResult Compare(const char* lhs_expression,
21232                                  const char* rhs_expression,
21233                                  const T1& lhs,
21234                                  const T2& rhs) {
21235     return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
21236   }
21237 
21238   // With this overloaded version, we allow anonymous enums to be used
21239   // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
21240   // enums can be implicitly cast to BiggestInt.
21241   //
21242   // Even though its body looks the same as the above version, we
21243   // cannot merge the two, as it will make anonymous enums unhappy.
21244   static AssertionResult Compare(const char* lhs_expression,
21245                                  const char* rhs_expression,
21246                                  BiggestInt lhs,
21247                                  BiggestInt rhs) {
21248     return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
21249   }
21250 };
21251 
21252 // This specialization is used when the first argument to ASSERT_EQ()
21253 // is a null pointer literal, like NULL, false, or 0.
21254 template <>
21255 class EqHelper<true> {
21256  public:
21257   // We define two overloaded versions of Compare().  The first
21258   // version will be picked when the second argument to ASSERT_EQ() is
21259   // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
21260   // EXPECT_EQ(false, a_bool).
21261   template <typename T1, typename T2>
21262   static AssertionResult Compare(
21263       const char* lhs_expression,
21264       const char* rhs_expression,
21265       const T1& lhs,
21266       const T2& rhs,
21267       // The following line prevents this overload from being considered if T2
21268       // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
21269       // expands to Compare("", "", NULL, my_ptr), which requires a conversion
21270       // to match the Secret* in the other overload, which would otherwise make
21271       // this template match better.
21272       typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
21273     return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
21274   }
21275 
21276   // This version will be picked when the second argument to ASSERT_EQ() is a
21277   // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
21278   template <typename T>
21279   static AssertionResult Compare(
21280       const char* lhs_expression,
21281       const char* rhs_expression,
21282       // We used to have a second template parameter instead of Secret*.  That
21283       // template parameter would deduce to 'long', making this a better match
21284       // than the first overload even without the first overload's EnableIf.
21285       // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
21286       // non-pointer argument" (even a deduced integral argument), so the old
21287       // implementation caused warnings in user code.
21288       Secret* /* lhs (NULL) */,
21289       T* rhs) {
21290     // We already know that 'lhs' is a null pointer.
21291     return CmpHelperEQ(lhs_expression, rhs_expression,
21292                        static_cast<T*>(NULL), rhs);
21293   }
21294 };
21295 
21296 // Separate the error generating code from the code path to reduce the stack
21297 // frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
21298 // when calling EXPECT_OP in a tight loop.
21299 template <typename T1, typename T2>
21300 AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
21301                                    const T1& val1, const T2& val2,
21302                                    const char* op) {
21303   return AssertionFailure()
21304          << "Expected: (" << expr1 << ") " << op << " (" << expr2
21305          << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
21306          << " vs " << FormatForComparisonFailureMessage(val2, val1);
21307 }
21308 
21309 // A macro for implementing the helper functions needed to implement
21310 // ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
21311 // of similar code.
21312 //
21313 // For each templatized helper function, we also define an overloaded
21314 // version for BiggestInt in order to reduce code bloat and allow
21315 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
21316 // with gcc 4.
21317 //
21318 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21319 
21320 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
21321 template <typename T1, typename T2>\
21322 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
21323                                    const T1& val1, const T2& val2) {\
21324   if (val1 op val2) {\
21325     return AssertionSuccess();\
21326   } else {\
21327     return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
21328   }\
21329 }\
21330 GTEST_API_ AssertionResult CmpHelper##op_name(\
21331     const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
21332 
21333 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21334 
21335 // Implements the helper function for {ASSERT|EXPECT}_NE
21336 GTEST_IMPL_CMP_HELPER_(NE, !=);
21337 // Implements the helper function for {ASSERT|EXPECT}_LE
21338 GTEST_IMPL_CMP_HELPER_(LE, <=);
21339 // Implements the helper function for {ASSERT|EXPECT}_LT
21340 GTEST_IMPL_CMP_HELPER_(LT, <);
21341 // Implements the helper function for {ASSERT|EXPECT}_GE
21342 GTEST_IMPL_CMP_HELPER_(GE, >=);
21343 // Implements the helper function for {ASSERT|EXPECT}_GT
21344 GTEST_IMPL_CMP_HELPER_(GT, >);
21345 
21346 #undef GTEST_IMPL_CMP_HELPER_
21347 
21348 // The helper function for {ASSERT|EXPECT}_STREQ.
21349 //
21350 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21351 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
21352                                           const char* s2_expression,
21353                                           const char* s1,
21354                                           const char* s2);
21355 
21356 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
21357 //
21358 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21359 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
21360                                               const char* s2_expression,
21361                                               const char* s1,
21362                                               const char* s2);
21363 
21364 // The helper function for {ASSERT|EXPECT}_STRNE.
21365 //
21366 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21367 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
21368                                           const char* s2_expression,
21369                                           const char* s1,
21370                                           const char* s2);
21371 
21372 // The helper function for {ASSERT|EXPECT}_STRCASENE.
21373 //
21374 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21375 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
21376                                               const char* s2_expression,
21377                                               const char* s1,
21378                                               const char* s2);
21379 
21380 
21381 // Helper function for *_STREQ on wide strings.
21382 //
21383 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21384 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
21385                                           const char* s2_expression,
21386                                           const wchar_t* s1,
21387                                           const wchar_t* s2);
21388 
21389 // Helper function for *_STRNE on wide strings.
21390 //
21391 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21392 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
21393                                           const char* s2_expression,
21394                                           const wchar_t* s1,
21395                                           const wchar_t* s2);
21396 
21397 }  // namespace internal
21398 
21399 // IsSubstring() and IsNotSubstring() are intended to be used as the
21400 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
21401 // themselves.  They check whether needle is a substring of haystack
21402 // (NULL is considered a substring of itself only), and return an
21403 // appropriate error message when they fail.
21404 //
21405 // The {needle,haystack}_expr arguments are the stringified
21406 // expressions that generated the two real arguments.
21407 GTEST_API_ AssertionResult IsSubstring(
21408     const char* needle_expr, const char* haystack_expr,
21409     const char* needle, const char* haystack);
21410 GTEST_API_ AssertionResult IsSubstring(
21411     const char* needle_expr, const char* haystack_expr,
21412     const wchar_t* needle, const wchar_t* haystack);
21413 GTEST_API_ AssertionResult IsNotSubstring(
21414     const char* needle_expr, const char* haystack_expr,
21415     const char* needle, const char* haystack);
21416 GTEST_API_ AssertionResult IsNotSubstring(
21417     const char* needle_expr, const char* haystack_expr,
21418     const wchar_t* needle, const wchar_t* haystack);
21419 GTEST_API_ AssertionResult IsSubstring(
21420     const char* needle_expr, const char* haystack_expr,
21421     const ::std::string& needle, const ::std::string& haystack);
21422 GTEST_API_ AssertionResult IsNotSubstring(
21423     const char* needle_expr, const char* haystack_expr,
21424     const ::std::string& needle, const ::std::string& haystack);
21425 
21426 #if GTEST_HAS_STD_WSTRING
21427 GTEST_API_ AssertionResult IsSubstring(
21428     const char* needle_expr, const char* haystack_expr,
21429     const ::std::wstring& needle, const ::std::wstring& haystack);
21430 GTEST_API_ AssertionResult IsNotSubstring(
21431     const char* needle_expr, const char* haystack_expr,
21432     const ::std::wstring& needle, const ::std::wstring& haystack);
21433 #endif  // GTEST_HAS_STD_WSTRING
21434 
21435 namespace internal {
21436 
21437 // Helper template function for comparing floating-points.
21438 //
21439 // Template parameter:
21440 //
21441 //   RawType: the raw floating-point type (either float or double)
21442 //
21443 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21444 template <typename RawType>
21445 AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
21446                                          const char* rhs_expression,
21447                                          RawType lhs_value,
21448                                          RawType rhs_value) {
21449   const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
21450 
21451   if (lhs.AlmostEquals(rhs)) {
21452     return AssertionSuccess();
21453   }
21454 
21455   ::std::stringstream lhs_ss;
21456   lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
21457          << lhs_value;
21458 
21459   ::std::stringstream rhs_ss;
21460   rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
21461          << rhs_value;
21462 
21463   return EqFailure(lhs_expression,
21464                    rhs_expression,
21465                    StringStreamToString(&lhs_ss),
21466                    StringStreamToString(&rhs_ss),
21467                    false);
21468 }
21469 
21470 // Helper function for implementing ASSERT_NEAR.
21471 //
21472 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
21473 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
21474                                                 const char* expr2,
21475                                                 const char* abs_error_expr,
21476                                                 double val1,
21477                                                 double val2,
21478                                                 double abs_error);
21479 
21480 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
21481 // A class that enables one to stream messages to assertion macros
21482 class GTEST_API_ AssertHelper {
21483  public:
21484   // Constructor.
21485   AssertHelper(TestPartResult::Type type,
21486                const char* file,
21487                int line,
21488                const char* message);
21489   ~AssertHelper();
21490 
21491   // Message assignment is a semantic trick to enable assertion
21492   // streaming; see the GTEST_MESSAGE_ macro below.
21493   void operator=(const Message& message) const;
21494 
21495  private:
21496   // We put our data in a struct so that the size of the AssertHelper class can
21497   // be as small as possible.  This is important because gcc is incapable of
21498   // re-using stack space even for temporary variables, so every EXPECT_EQ
21499   // reserves stack space for another AssertHelper.
21500   struct AssertHelperData {
21501     AssertHelperData(TestPartResult::Type t,
21502                      const char* srcfile,
21503                      int line_num,
21504                      const char* msg)
21505         : type(t), file(srcfile), line(line_num), message(msg) { }
21506 
21507     TestPartResult::Type const type;
21508     const char* const file;
21509     int const line;
21510     std::string const message;
21511 
21512    private:
21513     GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
21514   };
21515 
21516   AssertHelperData* const data_;
21517 
21518   GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
21519 };
21520 
21521 }  // namespace internal
21522 
21523 // The pure interface class that all value-parameterized tests inherit from.
21524 // A value-parameterized class must inherit from both ::testing::Test and
21525 // ::testing::WithParamInterface. In most cases that just means inheriting
21526 // from ::testing::TestWithParam, but more complicated test hierarchies
21527 // may need to inherit from Test and WithParamInterface at different levels.
21528 //
21529 // This interface has support for accessing the test parameter value via
21530 // the GetParam() method.
21531 //
21532 // Use it with one of the parameter generator defining functions, like Range(),
21533 // Values(), ValuesIn(), Bool(), and Combine().
21534 //
21535 // class FooTest : public ::testing::TestWithParam<int> {
21536 //  protected:
21537 //   FooTest() {
21538 //     // Can use GetParam() here.
21539 //   }
21540 //   virtual ~FooTest() {
21541 //     // Can use GetParam() here.
21542 //   }
21543 //   virtual void SetUp() {
21544 //     // Can use GetParam() here.
21545 //   }
21546 //   virtual void TearDown {
21547 //     // Can use GetParam() here.
21548 //   }
21549 // };
21550 // TEST_P(FooTest, DoesBar) {
21551 //   // Can use GetParam() method here.
21552 //   Foo foo;
21553 //   ASSERT_TRUE(foo.DoesBar(GetParam()));
21554 // }
21555 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
21556 
21557 template <typename T>
21558 class WithParamInterface {
21559  public:
21560   typedef T ParamType;
21561   virtual ~WithParamInterface() {}
21562 
21563   // The current parameter value. Is also available in the test fixture's
21564   // constructor. This member function is non-static, even though it only
21565   // references static data, to reduce the opportunity for incorrect uses
21566   // like writing 'WithParamInterface<bool>::GetParam()' for a test that
21567   // uses a fixture whose parameter type is int.
21568   const ParamType& GetParam() const {
21569     GTEST_CHECK_(parameter_ != NULL)
21570         << "GetParam() can only be called inside a value-parameterized test "
21571         << "-- did you intend to write TEST_P instead of TEST_F?";
21572     return *parameter_;
21573   }
21574 
21575  private:
21576   // Sets parameter value. The caller is responsible for making sure the value
21577   // remains alive and unchanged throughout the current test.
21578   static void SetParam(const ParamType* parameter) {
21579     parameter_ = parameter;
21580   }
21581 
21582   // Static value used for accessing parameter during a test lifetime.
21583   static const ParamType* parameter_;
21584 
21585   // TestClass must be a subclass of WithParamInterface<T> and Test.
21586   template <class TestClass> friend class internal::ParameterizedTestFactory;
21587 };
21588 
21589 template <typename T>
21590 const T* WithParamInterface<T>::parameter_ = NULL;
21591 
21592 // Most value-parameterized classes can ignore the existence of
21593 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
21594 
21595 template <typename T>
21596 class TestWithParam : public Test, public WithParamInterface<T> {
21597 };
21598 
21599 // Macros for indicating success/failure in test code.
21600 
21601 // ADD_FAILURE unconditionally adds a failure to the current test.
21602 // SUCCEED generates a success - it doesn't automatically make the
21603 // current test successful, as a test is only successful when it has
21604 // no failure.
21605 //
21606 // EXPECT_* verifies that a certain condition is satisfied.  If not,
21607 // it behaves like ADD_FAILURE.  In particular:
21608 //
21609 //   EXPECT_TRUE  verifies that a Boolean condition is true.
21610 //   EXPECT_FALSE verifies that a Boolean condition is false.
21611 //
21612 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
21613 // that they will also abort the current function on failure.  People
21614 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
21615 // writing data-driven tests often find themselves using ADD_FAILURE
21616 // and EXPECT_* more.
21617 
21618 // Generates a nonfatal failure with a generic message.
21619 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
21620 
21621 // Generates a nonfatal failure at the given source file location with
21622 // a generic message.
21623 #define ADD_FAILURE_AT(file, line) \
21624   GTEST_MESSAGE_AT_(file, line, "Failed", \
21625                     ::testing::TestPartResult::kNonFatalFailure)
21626 
21627 // Generates a fatal failure with a generic message.
21628 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
21629 
21630 // Define this macro to 1 to omit the definition of FAIL(), which is a
21631 // generic name and clashes with some other libraries.
21632 #if !GTEST_DONT_DEFINE_FAIL
21633 # define FAIL() GTEST_FAIL()
21634 #endif
21635 
21636 // Generates a success with a generic message.
21637 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
21638 
21639 // Define this macro to 1 to omit the definition of SUCCEED(), which
21640 // is a generic name and clashes with some other libraries.
21641 #if !GTEST_DONT_DEFINE_SUCCEED
21642 # define SUCCEED() GTEST_SUCCEED()
21643 #endif
21644 
21645 // Macros for testing exceptions.
21646 //
21647 //    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
21648 //         Tests that the statement throws the expected exception.
21649 //    * {ASSERT|EXPECT}_NO_THROW(statement):
21650 //         Tests that the statement doesn't throw any exception.
21651 //    * {ASSERT|EXPECT}_ANY_THROW(statement):
21652 //         Tests that the statement throws an exception.
21653 
21654 #define EXPECT_THROW(statement, expected_exception) \
21655   GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
21656 #define EXPECT_NO_THROW(statement) \
21657   GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
21658 #define EXPECT_ANY_THROW(statement) \
21659   GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
21660 #define ASSERT_THROW(statement, expected_exception) \
21661   GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
21662 #define ASSERT_NO_THROW(statement) \
21663   GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
21664 #define ASSERT_ANY_THROW(statement) \
21665   GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
21666 
21667 // Boolean assertions. Condition can be either a Boolean expression or an
21668 // AssertionResult. For more information on how to use AssertionResult with
21669 // these macros see comments on that class.
21670 #define EXPECT_TRUE(condition) \
21671   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
21672                       GTEST_NONFATAL_FAILURE_)
21673 #define EXPECT_FALSE(condition) \
21674   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
21675                       GTEST_NONFATAL_FAILURE_)
21676 #define ASSERT_TRUE(condition) \
21677   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
21678                       GTEST_FATAL_FAILURE_)
21679 #define ASSERT_FALSE(condition) \
21680   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
21681                       GTEST_FATAL_FAILURE_)
21682 
21683 // Macros for testing equalities and inequalities.
21684 //
21685 //    * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
21686 //    * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
21687 //    * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
21688 //    * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
21689 //    * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
21690 //    * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
21691 //
21692 // When they are not, Google Test prints both the tested expressions and
21693 // their actual values.  The values must be compatible built-in types,
21694 // or you will get a compiler error.  By "compatible" we mean that the
21695 // values can be compared by the respective operator.
21696 //
21697 // Note:
21698 //
21699 //   1. It is possible to make a user-defined type work with
21700 //   {ASSERT|EXPECT}_??(), but that requires overloading the
21701 //   comparison operators and is thus discouraged by the Google C++
21702 //   Usage Guide.  Therefore, you are advised to use the
21703 //   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
21704 //   equal.
21705 //
21706 //   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
21707 //   pointers (in particular, C strings).  Therefore, if you use it
21708 //   with two C strings, you are testing how their locations in memory
21709 //   are related, not how their content is related.  To compare two C
21710 //   strings by content, use {ASSERT|EXPECT}_STR*().
21711 //
21712 //   3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
21713 //   {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
21714 //   what the actual value is when it fails, and similarly for the
21715 //   other comparisons.
21716 //
21717 //   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
21718 //   evaluate their arguments, which is undefined.
21719 //
21720 //   5. These macros evaluate their arguments exactly once.
21721 //
21722 // Examples:
21723 //
21724 //   EXPECT_NE(Foo(), 5);
21725 //   EXPECT_EQ(a_pointer, NULL);
21726 //   ASSERT_LT(i, array_size);
21727 //   ASSERT_GT(records.size(), 0) << "There is no record left.";
21728 
21729 #define EXPECT_EQ(val1, val2) \
21730   EXPECT_PRED_FORMAT2(::testing::internal:: \
21731                       EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
21732                       val1, val2)
21733 #define EXPECT_NE(val1, val2) \
21734   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
21735 #define EXPECT_LE(val1, val2) \
21736   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
21737 #define EXPECT_LT(val1, val2) \
21738   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
21739 #define EXPECT_GE(val1, val2) \
21740   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
21741 #define EXPECT_GT(val1, val2) \
21742   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
21743 
21744 #define GTEST_ASSERT_EQ(val1, val2) \
21745   ASSERT_PRED_FORMAT2(::testing::internal:: \
21746                       EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
21747                       val1, val2)
21748 #define GTEST_ASSERT_NE(val1, val2) \
21749   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
21750 #define GTEST_ASSERT_LE(val1, val2) \
21751   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
21752 #define GTEST_ASSERT_LT(val1, val2) \
21753   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
21754 #define GTEST_ASSERT_GE(val1, val2) \
21755   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
21756 #define GTEST_ASSERT_GT(val1, val2) \
21757   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
21758 
21759 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
21760 // ASSERT_XY(), which clashes with some users' own code.
21761 
21762 #if !GTEST_DONT_DEFINE_ASSERT_EQ
21763 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
21764 #endif
21765 
21766 #if !GTEST_DONT_DEFINE_ASSERT_NE
21767 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
21768 #endif
21769 
21770 #if !GTEST_DONT_DEFINE_ASSERT_LE
21771 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
21772 #endif
21773 
21774 #if !GTEST_DONT_DEFINE_ASSERT_LT
21775 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
21776 #endif
21777 
21778 #if !GTEST_DONT_DEFINE_ASSERT_GE
21779 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
21780 #endif
21781 
21782 #if !GTEST_DONT_DEFINE_ASSERT_GT
21783 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
21784 #endif
21785 
21786 // C-string Comparisons.  All tests treat NULL and any non-NULL string
21787 // as different.  Two NULLs are equal.
21788 //
21789 //    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
21790 //    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
21791 //    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
21792 //    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
21793 //
21794 // For wide or narrow string objects, you can use the
21795 // {ASSERT|EXPECT}_??() macros.
21796 //
21797 // Don't depend on the order in which the arguments are evaluated,
21798 // which is undefined.
21799 //
21800 // These macros evaluate their arguments exactly once.
21801 
21802 #define EXPECT_STREQ(s1, s2) \
21803   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
21804 #define EXPECT_STRNE(s1, s2) \
21805   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
21806 #define EXPECT_STRCASEEQ(s1, s2) \
21807   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
21808 #define EXPECT_STRCASENE(s1, s2)\
21809   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
21810 
21811 #define ASSERT_STREQ(s1, s2) \
21812   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
21813 #define ASSERT_STRNE(s1, s2) \
21814   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
21815 #define ASSERT_STRCASEEQ(s1, s2) \
21816   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
21817 #define ASSERT_STRCASENE(s1, s2)\
21818   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
21819 
21820 // Macros for comparing floating-point numbers.
21821 //
21822 //    * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
21823 //         Tests that two float values are almost equal.
21824 //    * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
21825 //         Tests that two double values are almost equal.
21826 //    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
21827 //         Tests that v1 and v2 are within the given distance to each other.
21828 //
21829 // Google Test uses ULP-based comparison to automatically pick a default
21830 // error bound that is appropriate for the operands.  See the
21831 // FloatingPoint template class in gtest-internal.h if you are
21832 // interested in the implementation details.
21833 
21834 #define EXPECT_FLOAT_EQ(val1, val2)\
21835   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
21836                       val1, val2)
21837 
21838 #define EXPECT_DOUBLE_EQ(val1, val2)\
21839   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
21840                       val1, val2)
21841 
21842 #define ASSERT_FLOAT_EQ(val1, val2)\
21843   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
21844                       val1, val2)
21845 
21846 #define ASSERT_DOUBLE_EQ(val1, val2)\
21847   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
21848                       val1, val2)
21849 
21850 #define EXPECT_NEAR(val1, val2, abs_error)\
21851   EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
21852                       val1, val2, abs_error)
21853 
21854 #define ASSERT_NEAR(val1, val2, abs_error)\
21855   ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
21856                       val1, val2, abs_error)
21857 
21858 // These predicate format functions work on floating-point values, and
21859 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
21860 //
21861 //   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
21862 
21863 // Asserts that val1 is less than, or almost equal to, val2.  Fails
21864 // otherwise.  In particular, it fails if either val1 or val2 is NaN.
21865 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
21866                                    float val1, float val2);
21867 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
21868                                     double val1, double val2);
21869 
21870 
21871 #if GTEST_OS_WINDOWS
21872 
21873 // Macros that test for HRESULT failure and success, these are only useful
21874 // on Windows, and rely on Windows SDK macros and APIs to compile.
21875 //
21876 //    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
21877 //
21878 // When expr unexpectedly fails or succeeds, Google Test prints the
21879 // expected result and the actual result with both a human-readable
21880 // string representation of the error, if available, as well as the
21881 // hex result code.
21882 # define EXPECT_HRESULT_SUCCEEDED(expr) \
21883     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
21884 
21885 # define ASSERT_HRESULT_SUCCEEDED(expr) \
21886     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
21887 
21888 # define EXPECT_HRESULT_FAILED(expr) \
21889     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
21890 
21891 # define ASSERT_HRESULT_FAILED(expr) \
21892     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
21893 
21894 #endif  // GTEST_OS_WINDOWS
21895 
21896 // Macros that execute statement and check that it doesn't generate new fatal
21897 // failures in the current thread.
21898 //
21899 //   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
21900 //
21901 // Examples:
21902 //
21903 //   EXPECT_NO_FATAL_FAILURE(Process());
21904 //   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
21905 //
21906 #define ASSERT_NO_FATAL_FAILURE(statement) \
21907     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
21908 #define EXPECT_NO_FATAL_FAILURE(statement) \
21909     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
21910 
21911 // Causes a trace (including the given source file path and line number,
21912 // and the given message) to be included in every test failure message generated
21913 // by code in the scope of the lifetime of an instance of this class. The effect
21914 // is undone with the destruction of the instance.
21915 //
21916 // The message argument can be anything streamable to std::ostream.
21917 //
21918 // Example:
21919 //   testing::ScopedTrace trace("file.cc", 123, "message");
21920 //
21921 class GTEST_API_ ScopedTrace {
21922  public:
21923   // The c'tor pushes the given source file location and message onto
21924   // a trace stack maintained by Google Test.
21925 
21926   // Template version. Uses Message() to convert the values into strings.
21927   // Slow, but flexible.
21928   template <typename T>
21929   ScopedTrace(const char* file, int line, const T& message) {
21930     PushTrace(file, line, (Message() << message).GetString());
21931   }
21932 
21933   // Optimize for some known types.
21934   ScopedTrace(const char* file, int line, const char* message) {
21935     PushTrace(file, line, message ? message : "(null)");
21936   }
21937 
21938 #if GTEST_HAS_GLOBAL_STRING
21939   ScopedTrace(const char* file, int line, const ::string& message) {
21940     PushTrace(file, line, message);
21941   }
21942 #endif
21943 
21944   ScopedTrace(const char* file, int line, const std::string& message) {
21945     PushTrace(file, line, message);
21946   }
21947 
21948   // The d'tor pops the info pushed by the c'tor.
21949   //
21950   // Note that the d'tor is not virtual in order to be efficient.
21951   // Don't inherit from ScopedTrace!
21952   ~ScopedTrace();
21953 
21954  private:
21955   void PushTrace(const char* file, int line, std::string message);
21956 
21957   GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
21958 } GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
21959                             // c'tor and d'tor.  Therefore it doesn't
21960                             // need to be used otherwise.
21961 
21962 // Causes a trace (including the source file path, the current line
21963 // number, and the given message) to be included in every test failure
21964 // message generated by code in the current scope.  The effect is
21965 // undone when the control leaves the current scope.
21966 //
21967 // The message argument can be anything streamable to std::ostream.
21968 //
21969 // In the implementation, we include the current line number as part
21970 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
21971 // to appear in the same block - as long as they are on different
21972 // lines.
21973 //
21974 // Assuming that each thread maintains its own stack of traces.
21975 // Therefore, a SCOPED_TRACE() would (correctly) only affect the
21976 // assertions in its own thread.
21977 #define SCOPED_TRACE(message) \
21978   ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
21979     __FILE__, __LINE__, (message))
21980 
21981 
21982 // Compile-time assertion for type equality.
21983 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
21984 // the same type.  The value it returns is not interesting.
21985 //
21986 // Instead of making StaticAssertTypeEq a class template, we make it a
21987 // function template that invokes a helper class template.  This
21988 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
21989 // defining objects of that type.
21990 //
21991 // CAVEAT:
21992 //
21993 // When used inside a method of a class template,
21994 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
21995 // instantiated.  For example, given:
21996 //
21997 //   template <typename T> class Foo {
21998 //    public:
21999 //     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
22000 //   };
22001 //
22002 // the code:
22003 //
22004 //   void Test1() { Foo<bool> foo; }
22005 //
22006 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
22007 // actually instantiated.  Instead, you need:
22008 //
22009 //   void Test2() { Foo<bool> foo; foo.Bar(); }
22010 //
22011 // to cause a compiler error.
22012 template <typename T1, typename T2>
22013 bool StaticAssertTypeEq() {
22014   (void)internal::StaticAssertTypeEqHelper<T1, T2>();
22015   return true;
22016 }
22017 
22018 // Defines a test.
22019 //
22020 // The first parameter is the name of the test case, and the second
22021 // parameter is the name of the test within the test case.
22022 //
22023 // The convention is to end the test case name with "Test".  For
22024 // example, a test case for the Foo class can be named FooTest.
22025 //
22026 // Test code should appear between braces after an invocation of
22027 // this macro.  Example:
22028 //
22029 //   TEST(FooTest, InitializesCorrectly) {
22030 //     Foo foo;
22031 //     EXPECT_TRUE(foo.StatusIsOK());
22032 //   }
22033 
22034 // Note that we call GetTestTypeId() instead of GetTypeId<
22035 // ::testing::Test>() here to get the type ID of testing::Test.  This
22036 // is to work around a suspected linker bug when using Google Test as
22037 // a framework on Mac OS X.  The bug causes GetTypeId<
22038 // ::testing::Test>() to return different values depending on whether
22039 // the call is from the Google Test framework itself or from user test
22040 // code.  GetTestTypeId() is guaranteed to always return the same
22041 // value, as it always calls GetTypeId<>() from the Google Test
22042 // framework.
22043 #define GTEST_TEST(test_case_name, test_name)\
22044   GTEST_TEST_(test_case_name, test_name, \
22045               ::testing::Test, ::testing::internal::GetTestTypeId())
22046 
22047 // Define this macro to 1 to omit the definition of TEST(), which
22048 // is a generic name and clashes with some other libraries.
22049 #if !GTEST_DONT_DEFINE_TEST
22050 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
22051 #endif
22052 
22053 // Defines a test that uses a test fixture.
22054 //
22055 // The first parameter is the name of the test fixture class, which
22056 // also doubles as the test case name.  The second parameter is the
22057 // name of the test within the test case.
22058 //
22059 // A test fixture class must be declared earlier.  The user should put
22060 // the test code between braces after using this macro.  Example:
22061 //
22062 //   class FooTest : public testing::Test {
22063 //    protected:
22064 //     virtual void SetUp() { b_.AddElement(3); }
22065 //
22066 //     Foo a_;
22067 //     Foo b_;
22068 //   };
22069 //
22070 //   TEST_F(FooTest, InitializesCorrectly) {
22071 //     EXPECT_TRUE(a_.StatusIsOK());
22072 //   }
22073 //
22074 //   TEST_F(FooTest, ReturnsElementCountCorrectly) {
22075 //     EXPECT_EQ(a_.size(), 0);
22076 //     EXPECT_EQ(b_.size(), 1);
22077 //   }
22078 
22079 #define TEST_F(test_fixture, test_name)\
22080   GTEST_TEST_(test_fixture, test_name, test_fixture, \
22081               ::testing::internal::GetTypeId<test_fixture>())
22082 
22083 // Returns a path to temporary directory.
22084 // Tries to determine an appropriate directory for the platform.
22085 GTEST_API_ std::string TempDir();
22086 
22087 #ifdef _MSC_VER
22088 #  pragma warning(pop)
22089 #endif
22090 
22091 }  // namespace testing
22092 
22093 // Use this function in main() to run all tests.  It returns 0 if all
22094 // tests are successful, or 1 otherwise.
22095 //
22096 // RUN_ALL_TESTS() should be invoked after the command line has been
22097 // parsed by InitGoogleTest().
22098 //
22099 // This function was formerly a macro; thus, it is in the global
22100 // namespace and has an all-caps name.
22101 int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
22102 
22103 inline int RUN_ALL_TESTS() {
22104   return ::testing::UnitTest::GetInstance()->Run();
22105 }
22106 
22107 GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251
22108 
22109 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_
22110