group.hpp
Go to the documentation of this file.
1 
2 // ----------------------------------------------------------------------------
3 // group.hpp : encapsulates a group of manipulators along with an argument
4 // ----------------------------------------------------------------------------
5 
6 // Copyright Samuel Krempp 2003. Use, modification, and distribution are
7 // subject to the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 
10 // See http://www.boost.org/libs/format for library home page
11 
12 // ----------------------------------------------------------------------------
13 
14 
15 // group_head : cut the last element of a group out.
16 // (is overloaded below on each type of group)
17 
18 // group_last : returns the last element of a group
19 // (is overloaded below on each type of group)
20 // ----------------------------------------------------------------------------
21 
22 
23 #ifndef BOOST_FORMAT_GROUP_HPP
24 #define BOOST_FORMAT_GROUP_HPP
25 
26 #include <boost/config.hpp>
27 
28 
29 namespace boost {
30 namespace io {
31 
32 
33 namespace detail {
34 
35 
36 // empty group, but useful even though.
37 struct group0
38 {
39  group0() {}
40 };
41 
42 template <class Ch, class Tr>
43 inline
44 BOOST_IO_STD basic_ostream<Ch, Tr>&
45 operator << ( BOOST_IO_STD basic_ostream<Ch, Tr>& os,
46  const group0& )
47 {
48  return os;
49 }
50 
51 template <class T1>
52 struct group1
53 {
54  T1 a1_;
55  group1(T1 a1)
56  : a1_(a1)
57  {}
58 private:
59  group1& operator=(const group1&);
60 };
61 
62 template <class Ch, class Tr, class T1>
63 inline
64 BOOST_IO_STD basic_ostream<Ch, Tr>&
65 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
66  const group1<T1>& x)
67 {
68  os << x.a1_;
69  return os;
70 }
71 
72 
73 
74 
75 template <class T1,class T2>
76 struct group2
77 {
78  T1 a1_;
79  T2 a2_;
80  group2(T1 a1,T2 a2)
81  : a1_(a1),a2_(a2)
82  {}
83 private:
84  group2& operator=(const group2&);
85 };
86 
87 template <class Ch, class Tr, class T1,class T2>
88 inline
89 BOOST_IO_STD basic_ostream<Ch, Tr>&
90 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
91  const group2<T1,T2>& x)
92 {
93  os << x.a1_<< x.a2_;
94  return os;
95 }
96 
97 template <class T1,class T2,class T3>
98 struct group3
99 {
100  T1 a1_;
101  T2 a2_;
102  T3 a3_;
103  group3(T1 a1,T2 a2,T3 a3)
104  : a1_(a1),a2_(a2),a3_(a3)
105  {}
106 private:
107  group3& operator=(const group3&);
108 };
109 
110 template <class Ch, class Tr, class T1,class T2,class T3>
111 inline
112 BOOST_IO_STD basic_ostream<Ch, Tr>&
113 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
114  const group3<T1,T2,T3>& x)
115 {
116  os << x.a1_<< x.a2_<< x.a3_;
117  return os;
118 }
119 
120 template <class T1,class T2,class T3,class T4>
121 struct group4
122 {
123  T1 a1_;
124  T2 a2_;
125  T3 a3_;
126  T4 a4_;
127  group4(T1 a1,T2 a2,T3 a3,T4 a4)
128  : a1_(a1),a2_(a2),a3_(a3),a4_(a4)
129  {}
130 private:
131  group4& operator=(const group4&);
132 };
133 
134 template <class Ch, class Tr, class T1,class T2,class T3,class T4>
135 inline
136 BOOST_IO_STD basic_ostream<Ch, Tr>&
137 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
138  const group4<T1,T2,T3,T4>& x)
139 {
140  os << x.a1_<< x.a2_<< x.a3_<< x.a4_;
141  return os;
142 }
143 
144 template <class T1,class T2,class T3,class T4,class T5>
145 struct group5
146 {
147  T1 a1_;
148  T2 a2_;
149  T3 a3_;
150  T4 a4_;
151  T5 a5_;
152  group5(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5)
153  : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5)
154  {}
155 };
156 
157 template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5>
158 inline
159 BOOST_IO_STD basic_ostream<Ch, Tr>&
160 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
161  const group5<T1,T2,T3,T4,T5>& x)
162 {
163  os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_;
164  return os;
165 }
166 
167 template <class T1,class T2,class T3,class T4,class T5,class T6>
168 struct group6
169 {
170  T1 a1_;
171  T2 a2_;
172  T3 a3_;
173  T4 a4_;
174  T5 a5_;
175  T6 a6_;
176  group6(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6)
177  : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6)
178  {}
179 };
180 
181 template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6>
182 inline
183 BOOST_IO_STD basic_ostream<Ch, Tr>&
184 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
186 {
187  os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_;
188  return os;
189 }
190 
191 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
192 struct group7
193 {
194  T1 a1_;
195  T2 a2_;
196  T3 a3_;
197  T4 a4_;
198  T5 a5_;
199  T6 a6_;
200  T7 a7_;
201  group7(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7)
202  : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7)
203  {}
204 };
205 
206 template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7>
207 inline
208 BOOST_IO_STD basic_ostream<Ch, Tr>&
209 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
211 {
212  os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_;
213  return os;
214 }
215 
216 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
217 struct group8
218 {
219  T1 a1_;
220  T2 a2_;
221  T3 a3_;
222  T4 a4_;
223  T5 a5_;
224  T6 a6_;
225  T7 a7_;
226  T8 a8_;
227  group8(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8)
228  : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8)
229  {}
230 };
231 
232 template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
233 inline
234 BOOST_IO_STD basic_ostream<Ch, Tr>&
235 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
237 {
238  os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_;
239  return os;
240 }
241 
242 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
243 struct group9
244 {
245  T1 a1_;
246  T2 a2_;
247  T3 a3_;
248  T4 a4_;
249  T5 a5_;
250  T6 a6_;
251  T7 a7_;
252  T8 a8_;
253  T9 a9_;
254  group9(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9)
255  : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8),a9_(a9)
256  {}
257 };
258 
259 template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
260 inline
261 BOOST_IO_STD basic_ostream<Ch, Tr>&
262 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
264 {
265  os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_<< x.a9_;
266  return os;
267 }
268 
269 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
270 struct group10
271 {
272  T1 a1_;
273  T2 a2_;
274  T3 a3_;
275  T4 a4_;
276  T5 a5_;
277  T6 a6_;
278  T7 a7_;
279  T8 a8_;
280  T9 a9_;
281  T10 a10_;
282  group10(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9,T10 a10)
283  : a1_(a1),a2_(a2),a3_(a3),a4_(a4),a5_(a5),a6_(a6),a7_(a7),a8_(a8),a9_(a9),a10_(a10)
284  {}
285 };
286 
287 template <class Ch, class Tr, class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
288 inline
289 BOOST_IO_STD basic_ostream<Ch, Tr>&
290 operator << (BOOST_IO_STD basic_ostream<Ch, Tr>& os,
292 {
293  os << x.a1_<< x.a2_<< x.a3_<< x.a4_<< x.a5_<< x.a6_<< x.a7_<< x.a8_<< x.a9_<< x.a10_;
294  return os;
295 }
296 
297 
298 
299 
300 template <class T1,class T2>
301 inline
302 group1<T1>
304 {
305  return group1<T1> (x.a1_);
306 }
307 
308 template <class T1,class T2>
309 inline
310 group1<T2>
312 {
313  return group1<T2> (x.a2_);
314 }
315 
316 
317 
318 template <class T1,class T2,class T3>
319 inline
322 {
323  return group2<T1,T2> (x.a1_,x.a2_);
324 }
325 
326 template <class T1,class T2,class T3>
327 inline
328 group1<T3>
330 {
331  return group1<T3> (x.a3_);
332 }
333 
334 
335 
336 template <class T1,class T2,class T3,class T4>
337 inline
340 {
341  return group3<T1,T2,T3> (x.a1_,x.a2_,x.a3_);
342 }
343 
344 template <class T1,class T2,class T3,class T4>
345 inline
346 group1<T4>
348 {
349  return group1<T4> (x.a4_);
350 }
351 
352 
353 
354 template <class T1,class T2,class T3,class T4,class T5>
355 inline
358 {
359  return group4<T1,T2,T3,T4> (x.a1_,x.a2_,x.a3_,x.a4_);
360 }
361 
362 template <class T1,class T2,class T3,class T4,class T5>
363 inline
364 group1<T5>
366 {
367  return group1<T5> (x.a5_);
368 }
369 
370 
371 
372 template <class T1,class T2,class T3,class T4,class T5,class T6>
373 inline
376 {
377  return group5<T1,T2,T3,T4,T5> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_);
378 }
379 
380 template <class T1,class T2,class T3,class T4,class T5,class T6>
381 inline
382 group1<T6>
384 {
385  return group1<T6> (x.a6_);
386 }
387 
388 
389 
390 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
391 inline
394 {
395  return group6<T1,T2,T3,T4,T5,T6> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_);
396 }
397 
398 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
399 inline
400 group1<T7>
402 {
403  return group1<T7> (x.a7_);
404 }
405 
406 
407 
408 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
409 inline
412 {
413  return group7<T1,T2,T3,T4,T5,T6,T7> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_);
414 }
415 
416 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
417 inline
418 group1<T8>
420 {
421  return group1<T8> (x.a8_);
422 }
423 
424 
425 
426 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
427 inline
430 {
431  return group8<T1,T2,T3,T4,T5,T6,T7,T8> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_,x.a8_);
432 }
433 
434 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9>
435 inline
436 group1<T9>
438 {
439  return group1<T9> (x.a9_);
440 }
441 
442 
443 
444 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
445 inline
448 {
449  return group9<T1,T2,T3,T4,T5,T6,T7,T8,T9> (x.a1_,x.a2_,x.a3_,x.a4_,x.a5_,x.a6_,x.a7_,x.a8_,x.a9_);
450 }
451 
452 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10>
453 inline
456 {
457  return group1<T10> (x.a10_);
458 }
459 
460 
461 
462 
463 
464 } // namespace detail
465 
466 
467 
468 // helper functions
469 
470 
473 
474 template <class T1, class Var>
475 inline
477  group(T1 a1, Var const& var)
478 {
481  (a1, var)
482  );
483 }
484 
485 template <class T1,class T2, class Var>
486 inline
488  group(T1 a1,T2 a2, Var const& var)
489 {
492  (a1,a2, var)
493  );
494 }
495 
496 template <class T1,class T2,class T3, class Var>
497 inline
499  group(T1 a1,T2 a2,T3 a3, Var const& var)
500 {
503  (a1,a2,a3, var)
504  );
505 }
506 
507 template <class T1,class T2,class T3,class T4, class Var>
508 inline
510  group(T1 a1,T2 a2,T3 a3,T4 a4, Var const& var)
511 {
514  (a1,a2,a3,a4, var)
515  );
516 }
517 
518 template <class T1,class T2,class T3,class T4,class T5, class Var>
519 inline
521  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5, Var const& var)
522 {
525  (a1,a2,a3,a4,a5, var)
526  );
527 }
528 
529 template <class T1,class T2,class T3,class T4,class T5,class T6, class Var>
530 inline
532  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6, Var const& var)
533 {
536  (a1,a2,a3,a4,a5,a6, var)
537  );
538 }
539 
540 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7, class Var>
541 inline
543  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7, Var const& var)
544 {
547  (a1,a2,a3,a4,a5,a6,a7, var)
548  );
549 }
550 
551 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8, class Var>
552 inline
554  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, Var const& var)
555 {
558  (a1,a2,a3,a4,a5,a6,a7,a8, var)
559  );
560 }
561 
562 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9, class Var>
563 inline
565  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9, Var const& var)
566 {
569  (a1,a2,a3,a4,a5,a6,a7,a8,a9, var)
570  );
571 }
572 
573 
574 #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
575 
576 template <class T1, class Var>
577 inline
579  group(T1 a1, Var& var)
580 {
583  (a1, var)
584  );
585 }
586 
587 template <class T1,class T2, class Var>
588 inline
590  group(T1 a1,T2 a2, Var& var)
591 {
594  (a1,a2, var)
595  );
596 }
597 
598 template <class T1,class T2,class T3, class Var>
599 inline
601  group(T1 a1,T2 a2,T3 a3, Var& var)
602 {
605  (a1,a2,a3, var)
606  );
607 }
608 
609 template <class T1,class T2,class T3,class T4, class Var>
610 inline
612  group(T1 a1,T2 a2,T3 a3,T4 a4, Var& var)
613 {
616  (a1,a2,a3,a4, var)
617  );
618 }
619 
620 template <class T1,class T2,class T3,class T4,class T5, class Var>
621 inline
623  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5, Var& var)
624 {
627  (a1,a2,a3,a4,a5, var)
628  );
629 }
630 
631 template <class T1,class T2,class T3,class T4,class T5,class T6, class Var>
632 inline
634  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6, Var& var)
635 {
638  (a1,a2,a3,a4,a5,a6, var)
639  );
640 }
641 
642 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7, class Var>
643 inline
645  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7, Var& var)
646 {
649  (a1,a2,a3,a4,a5,a6,a7, var)
650  );
651 }
652 
653 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8, class Var>
654 inline
656  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, Var& var)
657 {
660  (a1,a2,a3,a4,a5,a6,a7,a8, var)
661  );
662 }
663 
664 template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9, class Var>
665 inline
667  group(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8,T9 a9, Var& var)
668 {
671  (a1,a2,a3,a4,a5,a6,a7,a8,a9, var)
672  );
673 }
674 
675 
676 #endif // - BOOST_NO_OVERLOAD_FOR_NON_CONST
677 
678 
679 } // namespace io
680 
681 } // namespace boost
682 
683 
684 #endif // BOOST_FORMAT_GROUP_HPP
#define BOOST_IO_STD
group1< T2 > group_last(group2< T1, T2 > const &x)
Definition: group.hpp:311
group9(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
Definition: group.hpp:254
group7(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
Definition: group.hpp:201
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
group1< T1 > group_head(group2< T1, T2 > const &x)
Definition: group.hpp:303
GLdouble x
group3(T1 a1, T2 a2, T3 a3)
Definition: group.hpp:103
group8(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
Definition: group.hpp:227
group6(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
Definition: group.hpp:176
const char * detail
group10(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
Definition: group.hpp:282
detail::group1< detail::group0 > group()
Definition: group.hpp:472
group2(T1 a1, T2 a2)
Definition: group.hpp:80
group5(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
Definition: group.hpp:152
group4(T1 a1, T2 a2, T3 a3, T4 a4)
Definition: group.hpp:127


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:16