BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslmf_switch.h
Go to the documentation of this file.
1/// @file bslmf_switch.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslmf_switch.h -*-C++-*-
8#ifndef INCLUDED_BSLMF_SWITCH
9#define INCLUDED_BSLMF_SWITCH
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslmf_switch bslmf_switch
15/// @brief Provide a compile-time `switch` meta-function.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslmf
19/// @{
20/// @addtogroup bslmf_switch
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslmf_switch-purpose"> Purpose</a>
25/// * <a href="#bslmf_switch-classes"> Classes </a>
26/// * <a href="#bslmf_switch-description"> Description </a>
27/// * <a href="#bslmf_switch-usage"> Usage </a>
28///
29/// # Purpose {#bslmf_switch-purpose}
30/// Provide a compile-time `switch` meta-function.
31///
32/// # Classes {#bslmf_switch-classes}
33///
34/// - bslmf::Switch: `switch` meta-function (variable number of types)
35/// - bslmf::Switch2: `switch` meta-function (among two types)
36/// - bslmf::Switch3: `switch` meta-function (among three types)
37/// - bslmf::Switch4: `switch` meta-function (among four types)
38/// - bslmf::Switch5: `switch` meta-function (among five types)
39/// - bslmf::Switch6: `switch` meta-function (among six types)
40/// - bslmf::Switch7: `switch` meta-function (among seven types)
41/// - bslmf::Switch8: `switch` meta-function (among eight types)
42/// - bslmf::Switch9: `switch` meta-function (among nine types)
43///
44/// @see bslmf_typelist
45///
46/// # Description {#bslmf_switch-description}
47/// This component provides a compile-time `switch` meta-function.
48/// Its main class, `bslmf::Switch`, parameterized by an integral
49/// `t_SWITCH_SELECTOR` and a variable number `N` of types, `t_T0` up to
50/// `T{N - 1}`, contains a single type named `Type`, which is the result of the
51/// meta-function and is an alias to `T{t_SWITCH_SELECTOR}` or to `bslmf::Nil`
52/// if `t_SWITCH_SELECTOR` is outside the range `[ 0 .. N - 1 ]`. The analogy
53/// between the following "meta-code" and its valid C++ version using
54/// `bslmf::Switch` may serve as a useful mental picture to understand and
55/// memorize the usage of this component.
56/// @code
57/// "Meta-code" (not C++) Valid C++ using 'bslmf::Switch'
58/// --------------------- ------------------------------
59/// typedef typedef typename
60/// switch (t_SWITCH_SELECTOR) { bslmf::Switch<t_SWITCH_SELECTOR,
61/// case 0: t_T0; t_T0,
62/// case 1: t_T1; t_T1,
63/// // . . . // . . .
64/// case N - 1: T{N - 1}; T{N - 1}
65/// default: bslmf::Nil; >
66/// } ::
67/// Type; Type;
68/// @endcode
69/// Note the use of the keyword `typename`, necessary *only* if one or more of
70/// the `t_SWITCH_SELECTOR` or `t_T0` up to `T{N - 1}` is dependent on a
71/// template parameter of the local context (i.e., that of the block using
72/// `bslmf::Switch`). In particular, it should be omitted if the
73/// `bslmf::Switch` is not used within a class or function template, as in the
74/// usage example below.
75///
76/// For most situations, the number `N` of template type arguments is known and
77/// the `bslmf::SwitchN` meta-functions, which take exactly the indicated number
78/// of arguments, should be preferred. Their usage leads to shorter mangled
79/// symbol names in object files (e.g., no extra defaulted template type
80/// arguments are included in the name), and shorter compilation times, as well.
81///
82/// ## Usage {#bslmf_switch-usage}
83///
84///
85/// Assume an external server API for storing and retrieving data:
86/// @code
87/// class data_Server {
88/// // Dummy implementation of data server
89///
90/// int d_data;
91///
92/// public:
93/// void store(char data) { d_data = data | 0Xefface00; }
94/// void store(short data) { d_data = data | 0Xdead0000; }
95/// void store(int data) { d_data = data; }
96///
97/// void retrieve(char *data) {
98/// *data = static_cast<char>(d_data & 0x000000ff);
99/// }
100/// void retrieve(short *data) {
101/// *data = static_cast<short>(d_data & 0x0000ffff);
102/// }
103/// void retrieve(int *data) { *data = d_data; }
104/// };
105/// @endcode
106/// In our application, we need some very small (1, 2, and 4-byte),
107/// special-purpose string types, so we create the following `ShortString` class
108/// template:
109/// @code
110/// template <int LEN>
111/// class ShortString {
112/// // Store a short, fixed-length string.
113///
114/// char d_buffer[LEN];
115///
116/// public:
117/// ShortString(const char *s = "") { std::strncpy(d_buffer, s, LEN); }
118/// // Construct a 'ShortString' from a NTCS.
119///
120/// void retrieve(data_Server *server);
121/// // Retrieve this string from a data server.
122///
123/// void store(data_Server *server) const;
124/// // Store this string to a data server.
125///
126/// char operator[](int n) const { return d_buffer[n]; }
127/// // Return the nth byte in this string.
128/// };
129///
130/// template <int LEN>
131/// bool operator==(const ShortString<LEN>& lhs, const ShortString<LEN>& rhs)
132/// // Return true if a 'lhs' is equal to 'rhs'
133/// {
134/// return 0 == std::memcmp(&lhs, &rhs, LEN);
135/// }
136///
137/// template <int LEN>
138/// bool operator==(const ShortString<LEN>& lhs, const char *rhs)
139/// // Return true if a 'ShortString' 'lhs' is equal to a NTCS 'rhs'.
140/// {
141/// int i;
142/// for (i = 0; LEN > i && lhs[i]; ++i) {
143/// if (lhs[i] != rhs[i]) {
144/// return false;
145/// }
146/// }
147///
148/// return ('\0' == rhs[i]);
149/// }
150/// @endcode
151/// We would like to store our short strings in the data server, but the data
152/// server only handles `char`, `short` and `int` types. Since our strings fit
153/// into these simple types, we can transform `ShortString` into these integral
154/// types when calling `store` and `retrieve`, using `bslmf::Switch` to choose
155/// which integral type to use for each `ShortString` type:
156/// @code
157/// template <int LEN>
158/// void ShortString<LEN>::retrieve(data_Server *server)
159/// {
160/// // 'transferType will be 'char' if 'LEN' is 1, 'short' if 'LEN' is 2,
161/// // and 'int' if 'LEN' 4. Will choose 'void' and thus not compile if
162/// // 'LEN' is 0 or 3.
163///
164/// typedef typename
165/// bslmf::Switch<LEN, void, char, short, void, int>::Type transferType;
166///
167/// transferType x = 0;
168/// server->retrieve(&x);
169/// std::memcpy(d_buffer, &x, LEN);
170/// }
171///
172/// template <int LEN>
173/// void ShortString<LEN>::store(data_Server *server) const
174/// {
175/// // 'transferType will be 'char' if 'LEN' is 1, 'short' if 'LEN' is 2,
176/// // and 'int' if 'LEN' 4. Will choose 'void' and thus not compile if
177/// // 'LEN' is 0 or 3.
178/// typedef typename
179/// bslmf::Switch<LEN, void, char, short, void, int>::Type transferType;
180///
181/// transferType x = 0;
182/// std::memcpy(&x, d_buffer, LEN);
183/// server->store(x);
184/// }
185/// @endcode
186/// In our main program, we first assert our basic assumptions, then we store
187/// and retrieve strings using our `ShortString` template.
188/// @code
189/// int main()
190/// {
191/// assert(2 == sizeof(short));
192/// assert(4 == sizeof(int));
193///
194/// data_Server server;
195///
196/// ShortString<1> a("A");
197/// ShortString<1> b("B");
198/// assert(a == "A");
199/// assert(b == "B");
200/// assert(! (a == b));
201///
202/// a.store(&server);
203/// b.retrieve(&server);
204/// assert(a == "A");
205/// assert(b == "A");
206/// assert(a == b);
207///
208/// ShortString<2> cd("CD");
209/// ShortString<2> ef("EF");
210/// assert(cd == "CD");
211/// assert(ef == "EF");
212/// assert(! (cd == ef));
213///
214/// cd.store(&server);
215/// ef.retrieve(&server);
216/// assert(cd == "CD");
217/// assert(ef == "CD");
218/// assert(cd == ef);
219///
220/// ShortString<4> ghij("GHIJ");
221/// ShortString<4> klmn("KLMN");
222/// assert(ghij == "GHIJ");
223/// assert(klmn == "KLMN");
224/// assert(! (ghij == klmn));
225///
226/// ghij.store(&server);
227/// klmn.retrieve(&server);
228/// assert(ghij == "GHIJ");
229/// assert(klmn == "GHIJ");
230/// assert(ghij == klmn);
231///
232/// return 0;
233/// }
234/// @endcode
235/// @}
236/** @} */
237/** @} */
238
239/** @addtogroup bsl
240 * @{
241 */
242/** @addtogroup bslmf
243 * @{
244 */
245/** @addtogroup bslmf_switch
246 * @{
247 */
248
249#include <bslscm_version.h>
250
251#include <bslmf_nil.h>
252
254
255#include <stddef.h>
256
257
258#if defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES) \
259 && defined(BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES)
260/// This macro indicates that we have all the needed features for an
261/// implementation of the type-switch facility that is source-compatible
262/// with the pre-existing C++03 facility. The main change is that the
263/// numbered classes Switch0-Switch9 are no longer distinct classes, but
264/// aliases of specific instantiations of the primary Switch template.
265/// Eventually these partial template specializations will be eliminated,
266/// when the individually named members are no longer used throughout the
267/// whole of the Bloomberg codebase.
268#define BSLMF_SWITCH_USING_VARIADIC_TEMPLATES
269#endif
270
271
272
273namespace bslmf {
274
275#if defined(BSLMF_SWITCH_USING_VARIADIC_TEMPLATES)
276/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
277/// types `t_T0` up to `t_T9`, provides a single type alias, `Type`, which
278/// resolves, through specialization for a particular value `N` of
279/// `t_SWITCH_SELECTOR`, to the type `TN`, or to `Nil` if
280/// `t_SWITCH_SELECTOR` is negative or larger than the number of template
281/// arguments provided for the types.
282///
283/// See @ref bslmf_switch
284template <size_t t_SWITCH_SELECTOR, class... t_TYPES>
285struct Switch {
286
287 /// This `Type` is an alias to the parameterized `TN`, where `N` is the
288 /// integral value of the parameterized `t_SWITCH_SELECTOR`.
289 ///
290 /// \note Note that the first type in the list corresponds to `t_T0`, not `t_T1`.
291 typedef Nil Type;
292};
293
294// SPECIALIZATIONS
295template <class t_T0, class... t_TYPES>
296struct Switch<0u, t_T0, t_TYPES...> {
297 typedef t_T0 Type;
298};
299
300template <class t_T0, class t_T1, class... t_TYPES>
301struct Switch<1u, t_T0, t_T1, t_TYPES...> {
302 typedef t_T1 Type;
303};
304
305template <class t_T0, class t_T1, class t_T2, class... t_TYPES>
306struct Switch<2u, t_T0, t_T1, t_T2, t_TYPES...> {
307 typedef t_T2 Type;
308};
309
310template <class t_T0, class t_T1, class t_T2, class t_T3, class... t_TYPES>
311struct Switch<3u, t_T0, t_T1, t_T2, t_T3, t_TYPES...> {
312 typedef t_T3 Type;
313};
314
315template <class t_T0,
316 class t_T1,
317 class t_T2,
318 class t_T3,
319 class t_T4,
320 class... t_TYPES>
321struct Switch<4u, t_T0, t_T1, t_T2, t_T3, t_T4, t_TYPES...> {
322 typedef t_T4 Type;
323};
324
325template <class t_T0,
326 class t_T1,
327 class t_T2,
328 class t_T3,
329 class t_T4,
330 class t_T5,
331 class... t_TYPES>
332struct Switch<5u, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_TYPES...> {
333 typedef t_T5 Type;
334};
335
336template <class t_T0,
337 class t_T1,
338 class t_T2,
339 class t_T3,
340 class t_T4,
341 class t_T5,
342 class t_T6,
343 class... t_TYPES>
344struct Switch<6u, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_TYPES...> {
345 typedef t_T6 Type;
346};
347
348template <class t_T0,
349 class t_T1,
350 class t_T2,
351 class t_T3,
352 class t_T4,
353 class t_T5,
354 class t_T6,
355 class t_T7,
356 class... t_TYPES>
357struct Switch<7u, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_TYPES...> {
358 typedef t_T7 Type;
359};
360
361template <class t_T0,
362 class t_T1,
363 class t_T2,
364 class t_T3,
365 class t_T4,
366 class t_T5,
367 class t_T6,
368 class t_T7,
369 class t_T8,
370 class... t_TYPES>
371struct Switch<8u,
372 t_T0,
373 t_T1,
374 t_T2,
375 t_T3,
376 t_T4,
377 t_T5,
378 t_T6,
379 t_T7,
380 t_T8,
381 t_TYPES...> {
382 typedef t_T8 Type;
383};
384
385template <class t_T0,
386 class t_T1,
387 class t_T2,
388 class t_T3,
389 class t_T4,
390 class t_T5,
391 class t_T6,
392 class t_T7,
393 class t_T8,
394 class t_T9,
395 class... t_TYPES>
396struct Switch<9u,
397 t_T0,
398 t_T1,
399 t_T2,
400 t_T3,
401 t_T4,
402 t_T5,
403 t_T6,
404 t_T7,
405 t_T8,
406 t_T9,
407 t_TYPES...> {
408 typedef t_T9 Type;
409};
410
411template <size_t t_SWITCH_SELECTOR,
412 class t_T0,
413 class t_T1,
414 class t_T2,
415 class t_T3,
416 class t_T4,
417 class t_T5,
418 class t_T6,
419 class t_T7,
420 class t_T8,
421 class t_T9,
422 class t_T10,
423 class... t_TYPES>
424struct Switch<t_SWITCH_SELECTOR,
425 t_T0,
426 t_T1,
427 t_T2,
428 t_T3,
429 t_T4,
430 t_T5,
431 t_T6,
432 t_T7,
433 t_T8,
434 t_T9,
435 t_T10,
436 t_TYPES...> {
437 typedef
438 typename Switch<t_SWITCH_SELECTOR - 10, t_T10, t_TYPES...>::Type Type;
439};
440
441#ifndef BDE_OMIT_INTERNAL_DEPRECATED
442template <size_t t_SWITCH_SELECTOR, class t_T0, class t_T1>
443using Switch2 = Switch<t_SWITCH_SELECTOR, t_T0, t_T1>;
444
445template <size_t t_SWITCH_SELECTOR, class t_T0, class t_T1, class t_T2>
446using Switch3 = Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2>;
447
448template <size_t t_SWITCH_SELECTOR,
449 class t_T0,
450 class t_T1,
451 class t_T2,
452 class t_T3>
453using Switch4 = Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3>;
454
455template <size_t t_SWITCH_SELECTOR,
456 class t_T0,
457 class t_T1,
458 class t_T2,
459 class t_T3,
460 class t_T4>
461using Switch5 = Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4>;
462
463template <size_t t_SWITCH_SELECTOR,
464 class t_T0,
465 class t_T1,
466 class t_T2,
467 class t_T3,
468 class t_T4,
469 class t_T5>
470using Switch6 = Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5>;
471
472template <size_t t_SWITCH_SELECTOR,
473 class t_T0,
474 class t_T1,
475 class t_T2,
476 class t_T3,
477 class t_T4,
478 class t_T5,
479 class t_T6>
480using Switch7 =
481 Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6>;
482
483template <size_t t_SWITCH_SELECTOR,
484 class t_T0,
485 class t_T1,
486 class t_T2,
487 class t_T3,
488 class t_T4,
489 class t_T5,
490 class t_T6,
491 class t_T7>
492using Switch8 =
493 Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7>;
494
495template <size_t t_SWITCH_SELECTOR,
496 class t_T0,
497 class t_T1,
498 class t_T2,
499 class t_T3,
500 class t_T4,
501 class t_T5,
502 class t_T6,
503 class t_T7,
504 class t_T8>
505using Switch9 = Switch<t_SWITCH_SELECTOR,
506 t_T0,
507 t_T1,
508 t_T2,
509 t_T3,
510 t_T4,
511 t_T5,
512 t_T6,
513 t_T7,
514 t_T8>;
515#endif // BDE_OMIT_INTERNAL_DEPRECATED
516
517#else
518
519 // =============
520 // struct Switch
521 // =============
522
523/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
524/// types `t_T0` up to `t_T9`, provides a single type alias, `Type`, which
525/// resolves, through specialization for a particular value `N` of
526/// `t_SWITCH_SELECTOR`, to the type `TN`, or to `Nil` if
527/// `t_SWITCH_SELECTOR` is negative or larger than the number of template
528/// arguments provided for the types.
529///
530/// See @ref bslmf_switch
531template <size_t t_SWITCH_SELECTOR,
532 class t_T0,
533 class t_T1 = Nil,
534 class t_T2 = Nil,
535 class t_T3 = Nil,
536 class t_T4 = Nil,
537 class t_T5 = Nil,
538 class t_T6 = Nil,
539 class t_T7 = Nil,
540 class t_T8 = Nil,
541 class t_T9 = Nil>
542struct Switch {
543
544 /// This `Type` is an alias to the parameterized `TN`, where `N` is the
545 /// integral value of the parameterized `t_SWITCH_SELECTOR`.
546 ///
547 /// \note Note that the first type in the list corresponds to `t_T0`, not `t_T1`.
548 typedef Nil Type;
549};
550
551// SPECIALIZATIONS
552
553/// This specialization of `Switch` for a value of 0 of the parameterized
554/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
555template <class t_T0,
556 class t_T1,
557 class t_T2,
558 class t_T3,
559 class t_T4,
560 class t_T5,
561 class t_T6,
562 class t_T7,
563 class t_T8,
564 class t_T9>
565struct Switch<0, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
566
567 typedef t_T0 Type;
568};
569
570/// This specialization of `Switch` for a value of 1 of the parameterized
571/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
572template <class t_T0,
573 class t_T1,
574 class t_T2,
575 class t_T3,
576 class t_T4,
577 class t_T5,
578 class t_T6,
579 class t_T7,
580 class t_T8,
581 class t_T9>
582struct Switch<1, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
583
584 typedef t_T1 Type;
585};
586
587/// This specialization of `Switch` for a value of 2 of the parameterized
588/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
589template <class t_T0,
590 class t_T1,
591 class t_T2,
592 class t_T3,
593 class t_T4,
594 class t_T5,
595 class t_T6,
596 class t_T7,
597 class t_T8,
598 class t_T9>
599struct Switch<2, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
600
601 typedef t_T2 Type;
602};
603
604/// This specialization of `Switch` for a value of 3 of the parameterized
605/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
606template <class t_T0,
607 class t_T1,
608 class t_T2,
609 class t_T3,
610 class t_T4,
611 class t_T5,
612 class t_T6,
613 class t_T7,
614 class t_T8,
615 class t_T9>
616struct Switch<3, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
617
618 typedef t_T3 Type;
619};
620
621/// This specialization of `Switch` for a value of 4 of the parameterized
622/// `t_SWITCH_SELECTOR` selects the parameterized `t_T4` as `Type`.
623template <class t_T0,
624 class t_T1,
625 class t_T2,
626 class t_T3,
627 class t_T4,
628 class t_T5,
629 class t_T6,
630 class t_T7,
631 class t_T8,
632 class t_T9>
633struct Switch<4, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
634
635 typedef t_T4 Type;
636};
637
638/// This specialization of `Switch` for a value of 5 of the parameterized
639/// `t_SWITCH_SELECTOR` selects the parameterized `t_T5` as `Type`.
640template <class t_T0,
641 class t_T1,
642 class t_T2,
643 class t_T3,
644 class t_T4,
645 class t_T5,
646 class t_T6,
647 class t_T7,
648 class t_T8,
649 class t_T9>
650struct Switch<5, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
651
652 typedef t_T5 Type;
653};
654
655/// This specialization of `Switch` for a value of 6 of the parameterized
656/// `t_SWITCH_SELECTOR` selects the parameterized `t_T6` as `Type`.
657template <class t_T0,
658 class t_T1,
659 class t_T2,
660 class t_T3,
661 class t_T4,
662 class t_T5,
663 class t_T6,
664 class t_T7,
665 class t_T8,
666 class t_T9>
667struct Switch<6, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
668
669 typedef t_T6 Type;
670};
671
672/// This specialization of `Switch` for a value of 7 of the parameterized
673/// `t_SWITCH_SELECTOR` selects the parameterized `t_T7` as `Type`.
674template <class t_T0,
675 class t_T1,
676 class t_T2,
677 class t_T3,
678 class t_T4,
679 class t_T5,
680 class t_T6,
681 class t_T7,
682 class t_T8,
683 class t_T9>
684struct Switch<7, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
685
686 typedef t_T7 Type;
687};
688
689/// This specialization of `Switch` for a value of 8 of the parameterized
690/// `t_SWITCH_SELECTOR` selects the parameterized `t_T8` as `Type`.
691template <class t_T0,
692 class t_T1,
693 class t_T2,
694 class t_T3,
695 class t_T4,
696 class t_T5,
697 class t_T6,
698 class t_T7,
699 class t_T8,
700 class t_T9>
701struct Switch<8, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
702
703 typedef t_T8 Type;
704};
705
706/// This specialization of `Switch` for a value of 9 of the parameterized
707/// `t_SWITCH_SELECTOR` selects the parameterized `t_T9` as `Type`.
708template <class t_T0,
709 class t_T1,
710 class t_T2,
711 class t_T3,
712 class t_T4,
713 class t_T5,
714 class t_T6,
715 class t_T7,
716 class t_T8,
717 class t_T9>
718struct Switch<9, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8, t_T9> {
719
720 typedef t_T9 Type;
721};
722
723 // ==============
724 // struct Switch2
725 // ==============
726
727/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
728/// exactly two types `t_T0` and `t_T1`, offers functionality identical to
729/// `Switch<t_SWITCH_SELECTOR, t_T0, t_T1>`.
730///
731/// See @ref bslmf_switch
732template <size_t t_SWITCH_SELECTOR, class t_T0, class t_T1>
733struct Switch2 {
734
735 typedef Nil Type;
736};
737
738// SPECIALIZATIONS
739
740/// This specialization of `Switch2` for a value of 0 of the parameterized
741/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
742template <class t_T0, class t_T1>
743struct Switch2<0, t_T0, t_T1> {
744
745 typedef t_T0 Type;
746};
747
748/// This specialization of `Switch2` for a value of 1 of the parameterized
749/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
750template <class t_T0, class t_T1>
751struct Switch2<1, t_T0, t_T1> {
752
753 typedef t_T1 Type;
754};
755
756 // ==============
757 // struct Switch3
758 // ==============
759
760/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
761/// exactly three types `t_T0` up to `t_T2`, offers functionality identical
762/// to `Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2>`.
763///
764/// See @ref bslmf_switch
765template <size_t t_SWITCH_SELECTOR, class t_T0, class t_T1, class t_T2>
766struct Switch3 {
767
768 typedef Nil Type;
769};
770
771// SPECIALIZATIONS
772
773/// This specialization of `Switch3` for a value of 0 of the parameterized
774/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
775template <class t_T0, class t_T1, class t_T2>
776struct Switch3<0, t_T0, t_T1, t_T2> {
777
778 typedef t_T0 Type;
779};
780
781/// This specialization of `Switch3` for a value of 1 of the parameterized
782/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
783template <class t_T0, class t_T1, class t_T2>
784struct Switch3<1, t_T0, t_T1, t_T2> {
785
786 typedef t_T1 Type;
787};
788
789/// This specialization of `Switch3` for a value of 2 of the parameterized
790/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
791template <class t_T0, class t_T1, class t_T2>
792struct Switch3<2, t_T0, t_T1, t_T2> {
793
794 typedef t_T2 Type;
795};
796
797 // ==============
798 // struct Switch4
799 // ==============
800
801/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
802/// exactly four types `t_T0` up to `t_T3`, offers functionality identical
803/// to `Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3>`.
804///
805/// See @ref bslmf_switch
806template <size_t t_SWITCH_SELECTOR,
807 class t_T0,
808 class t_T1,
809 class t_T2,
810 class t_T3>
811struct Switch4 {
812
813 typedef Nil Type;
814};
815
816// SPECIALIZATIONS
817
818/// This specialization of `Switch4` for a value of 0 of the parameterized
819/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
820template <class t_T0, class t_T1, class t_T2, class t_T3>
821struct Switch4<0, t_T0, t_T1, t_T2, t_T3> {
822
823 typedef t_T0 Type;
824};
825
826/// This specialization of `Switch4` for a value of 1 of the parameterized
827/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
828template <class t_T0, class t_T1, class t_T2, class t_T3>
829struct Switch4<1, t_T0, t_T1, t_T2, t_T3> {
830
831 typedef t_T1 Type;
832};
833
834/// This specialization of `Switch4` for a value of 2 of the parameterized
835/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
836template <class t_T0, class t_T1, class t_T2, class t_T3>
837struct Switch4<2, t_T0, t_T1, t_T2, t_T3> {
838
839 typedef t_T2 Type;
840};
841
842/// This specialization of `Switch4` for a value of 3 of the parameterized
843/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
844template <class t_T0, class t_T1, class t_T2, class t_T3>
845struct Switch4<3, t_T0, t_T1, t_T2, t_T3> {
846
847 typedef t_T3 Type;
848};
849
850 // ==============
851 // struct Switch5
852 // ==============
853
854/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
855/// exactly five types `t_T0` up to `t_T4`, offers functionality identical
856/// to `Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4>`.
857///
858/// See @ref bslmf_switch
859template <size_t t_SWITCH_SELECTOR,
860 class t_T0,
861 class t_T1,
862 class t_T2,
863 class t_T3,
864 class t_T4>
865struct Switch5 {
866
867 typedef Nil Type;
868};
869
870// SPECIALIZATIONS
871
872/// This specialization of `Switch5` for a value of 0 of the parameterized
873/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
874template <class t_T0, class t_T1, class t_T2, class t_T3, class t_T4>
875struct Switch5<0, t_T0, t_T1, t_T2, t_T3, t_T4> {
876
877 typedef t_T0 Type;
878};
879
880/// This specialization of `Switch5` for a value of 1 of the parameterized
881/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
882template <class t_T0, class t_T1, class t_T2, class t_T3, class t_T4>
883struct Switch5<1, t_T0, t_T1, t_T2, t_T3, t_T4> {
884
885 typedef t_T1 Type;
886};
887
888/// This specialization of `Switch5` for a value of 2 of the parameterized
889/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
890template <class t_T0, class t_T1, class t_T2, class t_T3, class t_T4>
891struct Switch5<2, t_T0, t_T1, t_T2, t_T3, t_T4> {
892
893 typedef t_T2 Type;
894};
895
896/// This specialization of `Switch5` for a value of 3 of the parameterized
897/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
898template <class t_T0, class t_T1, class t_T2, class t_T3, class t_T4>
899struct Switch5<3, t_T0, t_T1, t_T2, t_T3, t_T4> {
900
901 typedef t_T3 Type;
902};
903
904/// This specialization of `Switch5` for a value of 4 of the parameterized
905/// `t_SWITCH_SELECTOR` selects the parameterized `t_T4` as `Type`.
906template <class t_T0, class t_T1, class t_T2, class t_T3, class t_T4>
907struct Switch5<4, t_T0, t_T1, t_T2, t_T3, t_T4> {
908
909 typedef t_T4 Type;
910};
911
912 // ==============
913 // struct Switch6
914 // ==============
915
916/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
917/// exactly six types `t_T0` up to `t_T5`, offers functionality identical to
918/// `Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5>`.
919///
920/// See @ref bslmf_switch
921template <size_t t_SWITCH_SELECTOR,
922 class t_T0,
923 class t_T1,
924 class t_T2,
925 class t_T3,
926 class t_T4,
927 class t_T5>
928struct Switch6 {
929
930 typedef Nil Type;
931};
932
933// SPECIALIZATIONS
934
935/// This specialization of `Switch6` for a value of 0 of the parameterized
936/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
937template <class t_T0,
938 class t_T1,
939 class t_T2,
940 class t_T3,
941 class t_T4,
942 class t_T5>
943struct Switch6<0, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5> {
944
945 typedef t_T0 Type;
946};
947
948/// This specialization of `Switch6` for a value of 1 of the parameterized
949/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
950template <class t_T0,
951 class t_T1,
952 class t_T2,
953 class t_T3,
954 class t_T4,
955 class t_T5>
956struct Switch6<1, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5> {
957
958 typedef t_T1 Type;
959};
960
961/// This specialization of `Switch6` for a value of 2 of the parameterized
962/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
963template <class t_T0,
964 class t_T1,
965 class t_T2,
966 class t_T3,
967 class t_T4,
968 class t_T5>
969struct Switch6<2, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5> {
970
971 typedef t_T2 Type;
972};
973
974/// This specialization of `Switch6` for a value of 3 of the parameterized
975/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
976template <class t_T0,
977 class t_T1,
978 class t_T2,
979 class t_T3,
980 class t_T4,
981 class t_T5>
982struct Switch6<3, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5> {
983
984 typedef t_T3 Type;
985};
986
987/// This specialization of `Switch6` for a value of 4 of the parameterized
988/// `t_SWITCH_SELECTOR` selects the parameterized `t_T4` as `Type`.
989template <class t_T0,
990 class t_T1,
991 class t_T2,
992 class t_T3,
993 class t_T4,
994 class t_T5>
995struct Switch6<4, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5> {
996
997 typedef t_T4 Type;
998};
999
1000/// This specialization of `Switch6` for a value of 5 of the parameterized
1001/// `t_SWITCH_SELECTOR` selects the parameterized `t_T5` as `Type`.
1002template <class t_T0,
1003 class t_T1,
1004 class t_T2,
1005 class t_T3,
1006 class t_T4,
1007 class t_T5>
1008struct Switch6<5, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5> {
1009
1010 typedef t_T5 Type;
1011};
1012
1013 // ==============
1014 // struct Switch7
1015 // ==============
1016
1017/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
1018/// exactly seven types `t_T0` up to `t_T6`, offers functionality identical
1019/// to
1020/// `Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6>`.
1021///
1022/// See @ref bslmf_switch
1023template <size_t t_SWITCH_SELECTOR,
1024 class t_T0,
1025 class t_T1,
1026 class t_T2,
1027 class t_T3,
1028 class t_T4,
1029 class t_T5,
1030 class t_T6>
1031struct Switch7 {
1032
1033 typedef Nil Type;
1034};
1035
1036// SPECIALIZATIONS
1037
1038/// This specialization of `Switch7` for a value of 0 of the parameterized
1039/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
1040template <class t_T0,
1041 class t_T1,
1042 class t_T2,
1043 class t_T3,
1044 class t_T4,
1045 class t_T5,
1046 class t_T6>
1047struct Switch7<0, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1048
1049 typedef t_T0 Type;
1050};
1051
1052/// This specialization of `Switch7` for a value of 1 of the parameterized
1053/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
1054template <class t_T0,
1055 class t_T1,
1056 class t_T2,
1057 class t_T3,
1058 class t_T4,
1059 class t_T5,
1060 class t_T6>
1061struct Switch7<1, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1062
1063 typedef t_T1 Type;
1064};
1065
1066/// This specialization of `Switch7` for a value of 2 of the parameterized
1067/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
1068template <class t_T0,
1069 class t_T1,
1070 class t_T2,
1071 class t_T3,
1072 class t_T4,
1073 class t_T5,
1074 class t_T6>
1075struct Switch7<2, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1076
1077 typedef t_T2 Type;
1078};
1079
1080/// This specialization of `Switch7` for a value of 3 of the parameterized
1081/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
1082template <class t_T0,
1083 class t_T1,
1084 class t_T2,
1085 class t_T3,
1086 class t_T4,
1087 class t_T5,
1088 class t_T6>
1089struct Switch7<3, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1090
1091 typedef t_T3 Type;
1092};
1093
1094/// This specialization of `Switch7` for a value of 4 of the parameterized
1095/// `t_SWITCH_SELECTOR` selects the parameterized `t_T4` as `Type`.
1096template <class t_T0,
1097 class t_T1,
1098 class t_T2,
1099 class t_T3,
1100 class t_T4,
1101 class t_T5,
1102 class t_T6>
1103struct Switch7<4, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1104
1105 typedef t_T4 Type;
1106};
1107
1108/// This specialization of `Switch7` for a value of 5 of the parameterized
1109/// `t_SWITCH_SELECTOR` selects the parameterized `t_T5` as `Type`.
1110template <class t_T0,
1111 class t_T1,
1112 class t_T2,
1113 class t_T3,
1114 class t_T4,
1115 class t_T5,
1116 class t_T6>
1117struct Switch7<5, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1118
1119 typedef t_T5 Type;
1120};
1121
1122/// This specialization of `Switch7` for a value of 6 of the parameterized
1123/// `t_SWITCH_SELECTOR` selects the parameterized `t_T6` as `Type`.
1124template <class t_T0,
1125 class t_T1,
1126 class t_T2,
1127 class t_T3,
1128 class t_T4,
1129 class t_T5,
1130 class t_T6>
1131struct Switch7<6, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6> {
1132
1133 typedef t_T6 Type;
1134};
1135
1136 // ==============
1137 // struct Switch8
1138 // ==============
1139
1140/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
1141/// exactly eight types `t_T0` up to `t_T7`, offers functionality identical
1142/// to
1143/// 'Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4,
1144/// t_T5, t_T6, t_T7>'.
1145///
1146/// See @ref bslmf_switch
1147template <size_t t_SWITCH_SELECTOR,
1148 class t_T0,
1149 class t_T1,
1150 class t_T2,
1151 class t_T3,
1152 class t_T4,
1153 class t_T5,
1154 class t_T6,
1155 class t_T7>
1156struct Switch8 {
1157
1158 typedef Nil Type;
1159};
1160
1161// SPECIALIZATIONS
1162
1163/// This specialization of `Switch8` for a value of 0 of the parameterized
1164/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
1165template <class t_T0,
1166 class t_T1,
1167 class t_T2,
1168 class t_T3,
1169 class t_T4,
1170 class t_T5,
1171 class t_T6,
1172 class t_T7>
1173struct Switch8<0, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1174
1175 typedef t_T0 Type;
1176};
1177
1178/// This specialization of `Switch8` for a value of 1 of the parameterized
1179/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
1180template <class t_T0,
1181 class t_T1,
1182 class t_T2,
1183 class t_T3,
1184 class t_T4,
1185 class t_T5,
1186 class t_T6,
1187 class t_T7>
1188struct Switch8<1, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1189
1190 typedef t_T1 Type;
1191};
1192
1193/// This specialization of `Switch8` for a value of 2 of the parameterized
1194/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
1195template <class t_T0,
1196 class t_T1,
1197 class t_T2,
1198 class t_T3,
1199 class t_T4,
1200 class t_T5,
1201 class t_T6,
1202 class t_T7>
1203struct Switch8<2, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1204
1205 typedef t_T2 Type;
1206};
1207
1208/// This specialization of `Switch8` for a value of 3 of the parameterized
1209/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
1210template <class t_T0,
1211 class t_T1,
1212 class t_T2,
1213 class t_T3,
1214 class t_T4,
1215 class t_T5,
1216 class t_T6,
1217 class t_T7>
1218struct Switch8<3, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1219
1220 typedef t_T3 Type;
1221};
1222
1223/// This specialization of `Switch8` for a value of 4 of the parameterized
1224/// `t_SWITCH_SELECTOR` selects the parameterized `t_T4` as `Type`.
1225template <class t_T0,
1226 class t_T1,
1227 class t_T2,
1228 class t_T3,
1229 class t_T4,
1230 class t_T5,
1231 class t_T6,
1232 class t_T7>
1233struct Switch8<4, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1234
1235 typedef t_T4 Type;
1236};
1237
1238/// This specialization of `Switch8` for a value of 5 of the parameterized
1239/// `t_SWITCH_SELECTOR` selects the parameterized `t_T5` as `Type`.
1240template <class t_T0,
1241 class t_T1,
1242 class t_T2,
1243 class t_T3,
1244 class t_T4,
1245 class t_T5,
1246 class t_T6,
1247 class t_T7>
1248struct Switch8<5, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1249
1250 typedef t_T5 Type;
1251};
1252
1253/// This specialization of `Switch8` for a value of 6 of the parameterized
1254/// `t_SWITCH_SELECTOR` selects the parameterized `t_T6` as `Type`.
1255template <class t_T0,
1256 class t_T1,
1257 class t_T2,
1258 class t_T3,
1259 class t_T4,
1260 class t_T5,
1261 class t_T6,
1262 class t_T7>
1263struct Switch8<6, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1264
1265 typedef t_T6 Type;
1266};
1267
1268/// This specialization of `Switch8` for a value of 7 of the parameterized
1269/// `t_SWITCH_SELECTOR` selects the parameterized `t_T7` as `Type`.
1270template <class t_T0,
1271 class t_T1,
1272 class t_T2,
1273 class t_T3,
1274 class t_T4,
1275 class t_T5,
1276 class t_T6,
1277 class t_T7>
1278struct Switch8<7, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7> {
1279
1280 typedef t_T7 Type;
1281};
1282
1283 // ==============
1284 // struct Switch9
1285 // ==============
1286
1287/// This meta-function, parameterized by an integral `t_SWITCH_SELECTOR` and
1288/// exactly nine types `t_T0` up to `t_T8`, offers functionality identical
1289/// to
1290/// 'Switch<t_SWITCH_SELECTOR, t_T0, t_T1, t_T2, t_T3, t_T4,
1291/// t_T5, t_T6, t_T7, t_T8>'.
1292///
1293/// See @ref bslmf_switch
1294template <size_t t_SWITCH_SELECTOR,
1295 class t_T0,
1296 class t_T1,
1297 class t_T2,
1298 class t_T3,
1299 class t_T4,
1300 class t_T5,
1301 class t_T6,
1302 class t_T7,
1303 class t_T8>
1304struct Switch9 {
1305
1306 typedef Nil Type;
1307};
1308
1309// SPECIALIZATIONS
1310
1311/// This specialization of `Switch9` for a value of 0 of the parameterized
1312/// `t_SWITCH_SELECTOR` selects the parameterized `t_T0` as `Type`.
1313template <class t_T0,
1314 class t_T1,
1315 class t_T2,
1316 class t_T3,
1317 class t_T4,
1318 class t_T5,
1319 class t_T6,
1320 class t_T7,
1321 class t_T8>
1322struct Switch9<0, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1323
1324 typedef t_T0 Type;
1325};
1326
1327/// This specialization of `Switch9` for a value of 1 of the parameterized
1328/// `t_SWITCH_SELECTOR` selects the parameterized `t_T1` as `Type`.
1329template <class t_T0,
1330 class t_T1,
1331 class t_T2,
1332 class t_T3,
1333 class t_T4,
1334 class t_T5,
1335 class t_T6,
1336 class t_T7,
1337 class t_T8>
1338struct Switch9<1, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1339
1340 typedef t_T1 Type;
1341};
1342
1343/// This specialization of `Switch9` for a value of 2 of the parameterized
1344/// `t_SWITCH_SELECTOR` selects the parameterized `t_T2` as `Type`.
1345template <class t_T0,
1346 class t_T1,
1347 class t_T2,
1348 class t_T3,
1349 class t_T4,
1350 class t_T5,
1351 class t_T6,
1352 class t_T7,
1353 class t_T8>
1354struct Switch9<2, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1355
1356 typedef t_T2 Type;
1357};
1358
1359/// This specialization of `Switch9` for a value of 3 of the parameterized
1360/// `t_SWITCH_SELECTOR` selects the parameterized `t_T3` as `Type`.
1361template <class t_T0,
1362 class t_T1,
1363 class t_T2,
1364 class t_T3,
1365 class t_T4,
1366 class t_T5,
1367 class t_T6,
1368 class t_T7,
1369 class t_T8>
1370struct Switch9<3, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1371
1372 typedef t_T3 Type;
1373};
1374
1375/// This specialization of `Switch9` for a value of 4 of the parameterized
1376/// `t_SWITCH_SELECTOR` selects the parameterized `t_T4` as `Type`.
1377template <class t_T0,
1378 class t_T1,
1379 class t_T2,
1380 class t_T3,
1381 class t_T4,
1382 class t_T5,
1383 class t_T6,
1384 class t_T7,
1385 class t_T8>
1386struct Switch9<4, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1387
1388 typedef t_T4 Type;
1389};
1390
1391/// This specialization of `Switch9` for a value of 5 of the parameterized
1392/// `t_SWITCH_SELECTOR` selects the parameterized `t_T5` as `Type`.
1393template <class t_T0,
1394 class t_T1,
1395 class t_T2,
1396 class t_T3,
1397 class t_T4,
1398 class t_T5,
1399 class t_T6,
1400 class t_T7,
1401 class t_T8>
1402struct Switch9<5, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1403
1404 typedef t_T5 Type;
1405};
1406
1407/// This specialization of `Switch9` for a value of 6 of the parameterized
1408/// `t_SWITCH_SELECTOR` selects the parameterized `t_T6` as `Type`.
1409template <class t_T0,
1410 class t_T1,
1411 class t_T2,
1412 class t_T3,
1413 class t_T4,
1414 class t_T5,
1415 class t_T6,
1416 class t_T7,
1417 class t_T8>
1418struct Switch9<6, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1419
1420 typedef t_T6 Type;
1421};
1422
1423/// This specialization of `Switch9` for a value of 7 of the parameterized
1424/// `t_SWITCH_SELECTOR` selects the parameterized `t_T7` as `Type`.
1425template <class t_T0,
1426 class t_T1,
1427 class t_T2,
1428 class t_T3,
1429 class t_T4,
1430 class t_T5,
1431 class t_T6,
1432 class t_T7,
1433 class t_T8>
1434struct Switch9<7, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1435
1436 typedef t_T7 Type;
1437};
1438
1439/// This specialization of `Switch9` for a value of 8 of the parameterized
1440/// `t_SWITCH_SELECTOR` selects the parameterized `t_T8` as `Type`.
1441template <class t_T0,
1442 class t_T1,
1443 class t_T2,
1444 class t_T3,
1445 class t_T4,
1446 class t_T5,
1447 class t_T6,
1448 class t_T7,
1449 class t_T8>
1450struct Switch9<8, t_T0, t_T1, t_T2, t_T3, t_T4, t_T5, t_T6, t_T7, t_T8> {
1451
1452 typedef t_T8 Type;
1453};
1454#endif
1455
1456} // close package namespace
1457
1458
1459#ifndef BDE_OPENSOURCE_PUBLICATION // BACKWARD_COMPATIBILITY
1460
1461// ============================================================================
1462// BACKWARD COMPATIBILITY
1463// ============================================================================
1464
1465#ifdef bslmf_Switch
1466#undef bslmf_Switch
1467#endif
1468/// This alias is defined for backward compatibility.
1469#define bslmf_Switch bslmf::Switch
1470
1471#ifdef bslmf_Switch2
1472#undef bslmf_Switch2
1473#endif
1474/// This alias is defined for backward compatibility.
1475#define bslmf_Switch2 bslmf::Switch2
1476
1477#ifdef bslmf_Switch3
1478#undef bslmf_Switch3
1479#endif
1480/// This alias is defined for backward compatibility.
1481#define bslmf_Switch3 bslmf::Switch3
1482
1483#ifdef bslmf_Switch4
1484#undef bslmf_Switch4
1485#endif
1486/// This alias is defined for backward compatibility.
1487#define bslmf_Switch4 bslmf::Switch4
1488
1489#ifdef bslmf_Switch5
1490#undef bslmf_Switch5
1491#endif
1492/// This alias is defined for backward compatibility.
1493#define bslmf_Switch5 bslmf::Switch5
1494
1495#ifdef bslmf_Switch6
1496#undef bslmf_Switch6
1497#endif
1498/// This alias is defined for backward compatibility.
1499#define bslmf_Switch6 bslmf::Switch6
1500
1501#ifdef bslmf_Switch7
1502#undef bslmf_Switch7
1503#endif
1504/// This alias is defined for backward compatibility.
1505#define bslmf_Switch7 bslmf::Switch7
1506
1507#ifdef bslmf_Switch8
1508#undef bslmf_Switch8
1509#endif
1510/// This alias is defined for backward compatibility.
1511#define bslmf_Switch8 bslmf::Switch8
1512
1513#ifdef bslmf_Switch9
1514#undef bslmf_Switch9
1515#endif
1516/// This alias is defined for backward compatibility.
1517#define bslmf_Switch9 bslmf::Switch9
1518#endif // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY
1519
1520
1521
1522#endif
1523
1524// ----------------------------------------------------------------------------
1525// Copyright 2013 Bloomberg Finance L.P.
1526//
1527// Licensed under the Apache License, Version 2.0 (the "License");
1528// you may not use this file except in compliance with the License.
1529// You may obtain a copy of the License at
1530//
1531// http://www.apache.org/licenses/LICENSE-2.0
1532//
1533// Unless required by applicable law or agreed to in writing, software
1534// distributed under the License is distributed on an "AS IS" BASIS,
1535// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1536// See the License for the specific language governing permissions and
1537// limitations under the License.
1538// ----------------------------- END-OF-FILE ----------------------------------
1539
1540/** @} */
1541/** @} */
1542/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlbb_blob.h:579
Definition bslmf_nil.h:133
t_T0 Type
Definition bslmf_switch.h:745
t_T1 Type
Definition bslmf_switch.h:753
Definition bslmf_switch.h:733
Nil Type
Definition bslmf_switch.h:735
t_T0 Type
Definition bslmf_switch.h:778
t_T1 Type
Definition bslmf_switch.h:786
t_T2 Type
Definition bslmf_switch.h:794
Definition bslmf_switch.h:766
Nil Type
Definition bslmf_switch.h:768
t_T0 Type
Definition bslmf_switch.h:823
t_T1 Type
Definition bslmf_switch.h:831
t_T2 Type
Definition bslmf_switch.h:839
t_T3 Type
Definition bslmf_switch.h:847
Definition bslmf_switch.h:811
Nil Type
Definition bslmf_switch.h:813
t_T0 Type
Definition bslmf_switch.h:877
t_T1 Type
Definition bslmf_switch.h:885
t_T2 Type
Definition bslmf_switch.h:893
t_T3 Type
Definition bslmf_switch.h:901
t_T4 Type
Definition bslmf_switch.h:909
Definition bslmf_switch.h:865
Nil Type
Definition bslmf_switch.h:867
Definition bslmf_switch.h:928
Nil Type
Definition bslmf_switch.h:930
Definition bslmf_switch.h:1031
Nil Type
Definition bslmf_switch.h:1033
Definition bslmf_switch.h:1156
Nil Type
Definition bslmf_switch.h:1158
Definition bslmf_switch.h:1304
Nil Type
Definition bslmf_switch.h:1306
Definition bslmf_switch.h:542
Nil Type
Definition bslmf_switch.h:548