[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

metaprogramming.hxx VIGRA

1 /************************************************************************/
2 /* */
3 /* Copyright 1998-2002 by Ullrich Koethe */
4 /* */
5 /* This file is part of the VIGRA computer vision library. */
6 /* The VIGRA Website is */
7 /* http://hci.iwr.uni-heidelberg.de/vigra/ */
8 /* Please direct questions, bug reports, and contributions to */
9 /* ullrich.koethe@iwr.uni-heidelberg.de or */
10 /* vigra@informatik.uni-hamburg.de */
11 /* */
12 /* Permission is hereby granted, free of charge, to any person */
13 /* obtaining a copy of this software and associated documentation */
14 /* files (the "Software"), to deal in the Software without */
15 /* restriction, including without limitation the rights to use, */
16 /* copy, modify, merge, publish, distribute, sublicense, and/or */
17 /* sell copies of the Software, and to permit persons to whom the */
18 /* Software is furnished to do so, subject to the following */
19 /* conditions: */
20 /* */
21 /* The above copyright notice and this permission notice shall be */
22 /* included in all copies or substantial portions of the */
23 /* Software. */
24 /* */
25 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */
26 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */
27 /* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */
28 /* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */
29 /* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */
30 /* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */
31 /* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */
32 /* OTHER DEALINGS IN THE SOFTWARE. */
33 /* */
34 /************************************************************************/
35 
36 #ifndef VIGRA_METAPROGRAMMING_HXX
37 #define VIGRA_METAPROGRAMMING_HXX
38 
39 #include "config.hxx"
40 #include <climits>
41 #include <limits>
42 #include <algorithm>
43 
44 namespace vigra {
45 
46 // mask cl.exe shortcomings [begin]
47 #if defined(_MSC_VER)
48 #pragma warning( push )
49 #pragma warning( disable : 4503 )
50 #endif
51 
52 #ifdef __APPLE__
53 #include <AssertMacros.h>
54 #undef check
55 #endif
56 
57 template <int N>
58 class MetaInt
59 {
60  public:
61  static const int value = N;
62 };
63 
64 template <int N1, int N2>
65 class MetaMax
66 {
67  public:
68  static const int value = N1 < N2 ? N2 : N1;
69 };
70 
71 template <int N1, int N2>
72 class MetaMin
73 {
74  public:
75  static const int value = N1 < N2 ? N1 : N2;
76 };
77 
78 struct VigraTrueType
79 {
80  static const bool asBool = true, value = true;
81 };
82 
83 struct VigraFalseType
84 {
85  static const bool asBool = false, value = false;
86 };
87 
88 /** \addtogroup MultiArrayTags Multi-dimensional Array Tags
89  Meta-programming tags to mark array's as strided or unstrided.
90 */
91 
92 //@{
93 
94 /********************************************************/
95 /* */
96 /* tags for MultiArray memory layout */
97 /* */
98 /********************************************************/
99 
100 /** tag for marking a MultiArray strided.
101 
102  <b>\#include</b> <vigra/metaprogramming.hxx> <br/>
103  Namespace: vigra
104 */
105 struct StridedArrayTag {};
106 
107 /** tag for marking a MultiArray unstrided.
108 
109  <b>\#include</b> <vigra/metaprogramming.hxx> <br/>
110  Namespace: vigra
111 */
113 
114 /** tag for marking a MultiArray chunked.
115 
116  <b>\#include</b> <vigra/metaprogramming.hxx> <br/>
117  Namespace: vigra
118 */
119 struct ChunkedArrayTag {};
120 
121 /********************************************************/
122 /* */
123 /* TypeTraits */
124 /* */
125 /********************************************************/
126 
127 template<class T>
128 class TypeTraits
129 {
130  public:
131  typedef VigraFalseType isConst;
132  typedef VigraFalseType isPOD;
133  typedef VigraFalseType isBuiltinType;
134 };
135 
136 #ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION
137 
138 template<class T>
139 class TypeTraits<T const>
140 : public TypeTraits<T>
141 {
142  public:
143  typedef VigraTrueType isConst;
144 };
145 
146 template<class T>
147 class TypeTraits<T *>
148 {
149  public:
150  typedef VigraFalseType isConst;
151  typedef VigraTrueType isPOD;
152  typedef VigraTrueType isBuiltinType;
153 };
154 
155 template<class T>
156 class TypeTraits<T const *>
157 {
158  public:
159  typedef VigraFalseType isConst;
160  typedef VigraTrueType isPOD;
161  typedef VigraTrueType isBuiltinType;
162 };
163 
164 #endif // NO_PARTIAL_TEMPLATE_SPECIALIZATION
165 
166 namespace detail {
167 
168 template <int size>
169 struct SizeToType;
170 
171 } // namespace detail
172 
173 #define VIGRA_TYPE_TRAITS(type, size) \
174 template<> \
175 class TypeTraits<type> \
176 { \
177  public: \
178  typedef VigraFalseType isConst; \
179  typedef VigraTrueType isPOD; \
180  typedef VigraTrueType isBuiltinType; \
181  typedef char TypeToSize[size]; \
182 }; \
183  \
184 namespace detail { \
185  TypeTraits<type>::TypeToSize * typeToSize(type); \
186  \
187  template <> \
188  struct SizeToType<size> \
189  { \
190  typedef type result; \
191  }; \
192 }
193 
194 VIGRA_TYPE_TRAITS(char, 1)
195 VIGRA_TYPE_TRAITS(signed char, 2)
196 VIGRA_TYPE_TRAITS(unsigned char, 3)
197 VIGRA_TYPE_TRAITS(short, 4)
198 VIGRA_TYPE_TRAITS(unsigned short, 5)
199 VIGRA_TYPE_TRAITS(int, 6)
200 VIGRA_TYPE_TRAITS(unsigned int, 7)
201 VIGRA_TYPE_TRAITS(long, 8)
202 VIGRA_TYPE_TRAITS(unsigned long, 9)
203 VIGRA_TYPE_TRAITS(float, 10)
204 VIGRA_TYPE_TRAITS(double, 11)
205 VIGRA_TYPE_TRAITS(long double, 12)
206 #ifdef LLONG_MAX
207 VIGRA_TYPE_TRAITS(long long, 13)
208 VIGRA_TYPE_TRAITS(unsigned long long, 14)
209 #endif
210 
211 #undef VIGRA_TYPE_TRAITS
212 
213 //@}
214 
215 template <class A>
216 struct Not;
217 
218 template <>
219 struct Not<VigraTrueType>
220 {
221  typedef VigraFalseType result; // deprecated
222  static const bool boolResult = false; // deprecated
223  typedef VigraFalseType type;
224  static const bool value = false;
225 };
226 
227 template <>
228 struct Not<VigraFalseType>
229 {
230  typedef VigraTrueType result; // deprecated
231  static const bool boolResult = true; // deprecated
232  typedef VigraTrueType type;
233  static const bool value = true;
234 };
235 
236 template <class L, class R>
237 struct And;
238 
239 template <>
240 struct And<VigraFalseType, VigraFalseType>
241 {
242  typedef VigraFalseType result; // deprecated
243  static const bool boolResult = false; // deprecated
244  typedef VigraFalseType type;
245  static const bool value = false;
246 };
247 
248 template <>
249 struct And<VigraFalseType, VigraTrueType>
250 {
251  typedef VigraFalseType result; // deprecated
252  static const bool boolResult = false; // deprecated
253  typedef VigraFalseType type;
254  static const bool value = false;
255 };
256 
257 template <>
258 struct And<VigraTrueType, VigraFalseType>
259 {
260  typedef VigraFalseType result; // deprecated
261  static const bool boolResult = false; // deprecated
262  typedef VigraFalseType type;
263  static const bool value = false;
264 };
265 
266 template <>
267 struct And<VigraTrueType, VigraTrueType>
268 {
269  typedef VigraTrueType result; // deprecated
270  static const bool boolResult = true; // deprecated
271  typedef VigraTrueType type;
272  static const bool value = true;
273 };
274 
275 template <class L, class R>
276 struct Or;
277 
278 template <>
279 struct Or<VigraFalseType, VigraFalseType>
280 {
281  typedef VigraFalseType result; // deprecated
282  static const bool boolResult = false; // deprecated
283  typedef VigraFalseType type;
284  static const bool value = false;
285 };
286 
287 template <>
288 struct Or<VigraTrueType, VigraFalseType>
289 {
290  typedef VigraTrueType result; // deprecated
291  static const bool boolResult = true; // deprecated
292  typedef VigraTrueType type;
293  static const bool value = true;
294 };
295 
296 template <>
297 struct Or<VigraFalseType, VigraTrueType>
298 {
299  typedef VigraTrueType result; // deprecated
300  static const bool boolResult = true; // deprecated
301  typedef VigraTrueType type;
302  static const bool value = true;
303 };
304 
305 template <>
306 struct Or<VigraTrueType, VigraTrueType>
307 {
308  typedef VigraTrueType result; // deprecated
309  static const bool boolResult = true; // deprecated
310  typedef VigraTrueType type;
311  static const bool value = true;
312 };
313 
314 #ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION
315 
316 template <class PREDICATE, class TRUECASE, class FALSECASE>
317 struct If;
318 
319 template <class TRUECASE, class FALSECASE>
320 struct If<VigraTrueType, TRUECASE, FALSECASE>
321 {
322  typedef TRUECASE type;
323 };
324 
325 template <class TRUECASE, class FALSECASE>
326 struct If<VigraFalseType, TRUECASE, FALSECASE>
327 {
328  typedef FALSECASE type;
329 };
330 
331 template <bool PREDICATE, class TRUECASE, class FALSECASE>
332 struct IfBool;
333 
334 template <class TRUECASE, class FALSECASE>
335 struct IfBool<true, TRUECASE, FALSECASE>
336 {
337  typedef TRUECASE type;
338 };
339 
340 template <class TRUECASE, class FALSECASE>
341 struct IfBool<false, TRUECASE, FALSECASE>
342 {
343  typedef FALSECASE type;
344 };
345 
346 template <class L, class R>
347 struct IsSameType
348 {
349  typedef VigraFalseType result; // deprecated
350  static const bool boolResult = false; // deprecated
351  typedef VigraFalseType type;
352  static const bool value = false;
353 };
354 
355 template <class T>
356 struct IsSameType<T, T>
357 {
358  typedef VigraTrueType result; // deprecated
359  static const bool boolResult = true; // deprecated
360  typedef VigraTrueType type;
361  static const bool value = true;
362 };
363 
364 template <class L, class R>
365 struct IsDifferentType
366 {
367  typedef VigraTrueType type;
368  static const bool value = true;
369 };
370 
371 template <class T>
372 struct IsDifferentType<T, T>
373 {
374  typedef VigraFalseType type;
375  static const bool value = false;
376 };
377 
378 #endif // NO_PARTIAL_TEMPLATE_SPECIALIZATION
379 
380 template <class From, class To>
381 struct IsConvertibleTo
382 {
383  typedef char falseResult[1];
384  typedef char trueResult[2];
385 
386  static From const & check();
387 
388  static falseResult * testIsConvertible(...);
389  static trueResult * testIsConvertible(To const &);
390 
391  enum { resultSize = sizeof(*testIsConvertible(check())) };
392 
393  static const bool value = (resultSize == 2);
394  typedef typename
395  IfBool<value, VigraTrueType, VigraFalseType>::type
396  type;
397 };
398 
399 template <class DERIVED, class BASE>
400 struct IsDerivedFrom
401 {
402  typedef char falseResult[1];
403  typedef char trueResult[2];
404 
405  static falseResult * testIsDerivedFrom(...);
406  static trueResult * testIsDerivedFrom(BASE const *);
407 
408  enum { resultSize = sizeof(*testIsDerivedFrom(static_cast<DERIVED const *>(0))) };
409 
410  static const bool value = (resultSize == 2);
411  typedef typename
412  IfBool<value, VigraTrueType, VigraFalseType>::type
413  type;
414 
415  static const bool boolResult = value; // deprecated
416  typedef type result; // deprecated
417 };
418 
419 template <class T>
420 struct UnqualifiedType
421 {
422  typedef T type;
423  static const bool isConst = false;
424  static const bool isReference = false;
425  static const bool isPointer = false;
426 };
427 
428 template <class T>
429 struct UnqualifiedType<T const>
430 {
431  typedef T type;
432  static const bool isConst = true;
433  static const bool isReference = false;
434  static const bool isPointer = false;
435 };
436 
437 template <class T>
438 struct UnqualifiedType<T &>
439 : public UnqualifiedType<T>
440 {
441  static const bool isReference = true;
442 };
443 
444 template <class T>
445 struct UnqualifiedType<T const &>
446 : public UnqualifiedType<T const>
447 {
448  static const bool isReference = true;
449 };
450 
451 template <class T>
452 struct UnqualifiedType<T *>
453 : public UnqualifiedType<T>
454 {
455  static const bool isPointer = true;
456 };
457 
458 template <class T>
459 struct UnqualifiedType<T const *>
460 : public UnqualifiedType<T const>
461 {
462  static const bool isPointer = true;
463 };
464 
465 template <bool, class T = void>
466 struct enable_if {};
467 template <class T>
468 struct enable_if<true, T> { typedef T type; };
469 
470 struct sfinae_void;
471 
472 template <class T, template<class> class USER>
473 struct sfinae_test
474 {
475  typedef char falseResult[1];
476  typedef char trueResult[2];
477 
478  static falseResult * test(...);
479  static trueResult * test(USER<sfinae_void>);
480 
481  enum { resultSize = sizeof(*test(static_cast<T*>(0))) };
482 
483  static const bool value = (resultSize == 2);
484  typedef typename
485  IfBool<value, VigraTrueType, VigraFalseType>::type
486  type;
487 };
488 
489 template <class T>
490 struct has_argument_type : public sfinae_test<T, has_argument_type>
491 {
492  template <class U> has_argument_type(U*, typename U::argument_type* = 0);
493 };
494 
495 template <class T>
496 struct has_result_type : public sfinae_test<T, has_result_type>
497 {
498  template <class U> has_result_type(U*, typename U::result_type* = 0);
499 };
500 
501 template <class T>
502 struct has_value_type : public sfinae_test<T, has_value_type>
503 {
504  template <class U> has_value_type(U*, typename U::value_type* = 0);
505 };
506 
507 template <class T>
508 struct IsIterator : public sfinae_test<T, IsIterator>
509 {
510  template <class U> IsIterator(U*, typename U::iterator_category* = 0);
511 };
512 
513 template <class T>
514 struct IsIterator<T*>
515 {
516  static const bool value = true;
517  typedef VigraTrueType type;
518 };
519 
520 template <class T>
521 struct IsIterator<T const *>
522 {
523  static const bool value = true;
524  typedef VigraTrueType type;
525 };
526 
527 template <class T>
528 struct has_real_promote_type : public sfinae_test<T, has_real_promote_type>
529 {
530  template <class U>
531  has_real_promote_type(U*, typename U::real_promote_type* = 0);
532 };
533 
534 template <class T, bool P = has_real_promote_type<T>::value>
535 struct get_optional_real_promote
536 {
537  typedef T type;
538 };
539 template <class T>
540 struct get_optional_real_promote<T, true>
541 {
542  typedef typename T::real_promote_type type;
543 };
544 
545 template <class T>
546 struct IsArray
547 {
548  typedef char falseResult[1];
549  typedef char trueResult[2];
550 
551  static falseResult * test(...);
552  template <class U, unsigned n>
553  static trueResult * test(U (*)[n]);
554 
555  enum { resultSize = sizeof(*test(static_cast<T*>(0))) };
556 
557  static const bool value = (resultSize == 2);
558  typedef typename
559  IfBool<value, VigraTrueType, VigraFalseType>::type
560  type;
561 };
562 
563 
564 template <class D, class B, class Z> inline
565 D & static_cast_2(Z & z)
566 {
567  return static_cast<D &>(static_cast<B &>(z));
568 }
569 
570 template <class A>
571 class copy_if_same_as
572 {
573  const bool copied;
574  const A *const data;
575  copy_if_same_as(const copy_if_same_as &);
576  void operator=(const copy_if_same_as &);
577 public:
578  copy_if_same_as(const A & x, const A & y)
579  : copied(&x == &y), data(copied ? new A(y) : &x) {}
580  ~copy_if_same_as()
581  {
582  if (copied)
583  delete data;
584  }
585  const A & operator()() const { return *data; }
586 };
587 
588 
589 template <class>
590 struct true_test : public VigraTrueType {};
591 
592 template <class>
593 struct false_test : VigraFalseType {};
594 
595 template <class PC, class T, class F>
596 struct ChooseBool
597 {
598  static const bool value = IfBool<PC::value, T, F>::type::value;
599 };
600 
601 template <bool>
602 struct choose_type
603 {
604  template <class A, class B>
605  static const A & at(const A & a, const B &) { return a; }
606  template <class A, class B>
607  static A & at( A & a, B &) { return a; }
608 };
609 template <>
610 struct choose_type<false>
611 {
612  template <class A, class B>
613  static const B & at(const A &, const B & b) { return b; }
614  template <class A, class B>
615  static B & at( A &, B & b) { return b; }
616 };
617 
618 template <class X>
619 struct HasMetaLog2
620 {
621  static const bool value = !std::numeric_limits<X>::is_signed
622  && std::numeric_limits<X>::is_integer;
623 };
624 template <class X>
625 struct EnableMetaLog2
626  : public enable_if<HasMetaLog2<X>::value> {};
627 template <class>
628 class vigra_error_MetaLog2_accepts_only_unsigned_types_and_no_;
629 
630 // use a conforming template depth here (below 15 for up to 128 bits)
631 template <class X = unsigned long,
632  X n = ~(X(0)), unsigned s = 1, unsigned t = 0, bool q = 1,
633  X m = 0, X z = 0, X u = 1, class = void>
634 class MetaLog2
635  : public vigra_error_MetaLog2_accepts_only_unsigned_types_and_no_<X>
636 {};
637 template <class X, X n, unsigned s, unsigned t, bool q, X m, X z, X u>
638 struct MetaLog2 <X, n, s, t, q, m, z, u, typename EnableMetaLog2<X>::type>
639 {
640  static const unsigned value
641  = t + MetaLog2<X, (n >> s), s * (1 + q), s, !q, n / 2, z, u>::value;
642 };
643 template <class X, unsigned s, unsigned t, bool q, X m, X z, X u>
644 struct MetaLog2<X, z, s, t, q, m, z, u, typename EnableMetaLog2<X>::type>
645 {
646  static const unsigned value
647  = 1 + MetaLog2<X, m / 2, 2, 1, 1, 0, z, u>::value;
648 };
649 template <class X, unsigned s, unsigned t, bool q, X z, X u>
650 struct MetaLog2<X, z, s, t, q, u, z, u, typename EnableMetaLog2<X>::type>
651 {
652  static const unsigned value = 2;
653 };
654 template <class X, unsigned s, unsigned t, bool q, X z, X u>
655 struct MetaLog2<X, z, s, t, q, z, z, u, typename EnableMetaLog2<X>::type>
656 {
657  static const unsigned value = 1;
658 };
659 template <class X, X z, X u>
660 struct MetaLog2<X, z, 1, 0, 1, z, z, u, typename EnableMetaLog2<X>::type>
661 {
662  // A value of zero for MetaLog2<X, 0> is likely to cause most harm,
663  // such as division by zero or zero array sizes, this is actually indended.
664  static const unsigned value = 0;
665 };
666 
667 template <int X, unsigned int N>
668 struct MetaPow
669 {
670  static const long long value = MetaPow<X, N-1>::value * X;
671 };
672 
673 template <int X>
674 struct MetaPow<X, 0>
675 {
676  static const long long value = 1;
677 };
678 
679 /****************************************************************************/
680 /* */
681 /* TypeList and its functions */
682 /* */
683 /****************************************************************************/
684 
685 template<class HEAD, class TAIL=void>
686 struct TypeList
687 {
688  typedef TypeList<HEAD, TAIL> type;
689  typedef HEAD Head;
690  typedef TAIL Tail;
691 };
692 
693 template <class List, class T>
694 struct Contains;
695 
696 template <class Head, class Tail, class T>
697 struct Contains<TypeList<Head, Tail>, T>
698 {
699  typedef typename Contains<Tail, T>::type type;
700 };
701 
702 template <class Head, class Tail>
703 struct Contains<TypeList<Head, Tail>, Head>
704 {
705  typedef VigraTrueType type;
706 };
707 
708 template <class T>
709 struct Contains<void, T>
710 {
711  typedef VigraFalseType type;
712 };
713 
714 template <class List, class T>
715 struct Remove;
716 
717 template <class Head, class Tail, class T>
718 struct Remove<TypeList<Head, Tail>, T>
719 {
720  typedef TypeList<Head, typename Remove<Tail, T>::type> type;
721 };
722 
723 template <class Head, class Tail>
724 struct Remove<TypeList<Head, Tail>, Head>
725 {
726  typedef Tail type;
727 };
728 
729 template <class T>
730 struct Remove<void, T>
731 {
732  typedef void type;
733 };
734 
735 template <class A, class Tail=void>
736 struct Push
737 {
738  typedef TypeList<A, typename Tail::type> type;
739 };
740 
741 template <class Head, class Tail, class List>
742 struct Push<TypeList<Head, Tail>, List>
743 {
744  typedef typename Push<Tail, List>::type Rest;
745  typedef TypeList<Head, Rest> type;
746 };
747 
748 template <class Head, class Tail>
749 struct Push<TypeList<Head, Tail>, void>
750 {
751  typedef TypeList<Head, Tail> type;
752 };
753 
754 template <class A>
755 struct Push<A, void>
756 {
757  typedef TypeList<A> type;
758 };
759 
760 template <class A>
761 struct Push<void, A>
762 {
763  typedef A type;
764 };
765 
766 template <>
767 struct Push<void, void>
768 {
769  typedef void type;
770 };
771 
772 template <class A, class Tail=void>
773 struct PushUnique
774 {
775  typedef typename Contains<Tail, A>::type AlreadyInList;
776  typedef typename If<AlreadyInList, typename Tail::type, TypeList<A, typename Tail::type> >::type type;
777 };
778 
779 template <class Head, class Tail, class List>
780 struct PushUnique<TypeList<Head, Tail>, List>
781 {
782  typedef typename PushUnique<Tail, List>::type Rest;
783  typedef typename Contains<Rest, Head>::type HeadAlreadyInList;
784  typedef typename If<HeadAlreadyInList, Rest, TypeList<Head, Rest> >::type type;
785 };
786 
787 template <class Head, class Tail>
788 struct PushUnique<TypeList<Head, Tail>, void>
789 {
790  typedef TypeList<Head, Tail> type;
791 };
792 
793 template <class A>
794 struct PushUnique<A, void>
795 {
796  typedef TypeList<A> type;
797 };
798 
799 template <class A>
800 struct PushUnique<void, A>
801 {
802  typedef A type;
803 };
804 
805 template <>
806 struct PushUnique<void, void>
807 {
808  typedef void type;
809 };
810 
811 template <class T01=void, class T02=void, class T03=void, class T04=void, class T05=void,
812  class T06=void, class T07=void, class T08=void, class T09=void, class T10=void,
813  class T11=void, class T12=void, class T13=void, class T14=void, class T15=void,
814  class T16=void, class T17=void, class T18=void, class T19=void, class T20=void>
815 struct MakeTypeList
816 {
817  typedef typename Push<T19, T20>::type L19;
818  typedef typename Push<T18, L19>::type L18;
819  typedef typename Push<T17, L18>::type L17;
820  typedef typename Push<T16, L17>::type L16;
821  typedef typename Push<T15, L16>::type L15;
822  typedef typename Push<T14, L15>::type L14;
823  typedef typename Push<T13, L14>::type L13;
824  typedef typename Push<T12, L13>::type L12;
825  typedef typename Push<T11, L12>::type L11;
826  typedef typename Push<T10, L11>::type L10;
827  typedef typename Push<T09, L10>::type L09;
828  typedef typename Push<T08, L09>::type L08;
829  typedef typename Push<T07, L08>::type L07;
830  typedef typename Push<T06, L07>::type L06;
831  typedef typename Push<T05, L06>::type L05;
832  typedef typename Push<T04, L05>::type L04;
833  typedef typename Push<T03, L04>::type L03;
834  typedef typename Push<T02, L03>::type L02;
835  typedef typename Push<T01, L02>::type L01;
836  typedef L01 type;
837 };
838 
839 template <class T01=void, class T02=void, class T03=void, class T04=void, class T05=void,
840  class T06=void, class T07=void, class T08=void, class T09=void, class T10=void,
841  class T11=void, class T12=void, class T13=void, class T14=void, class T15=void,
842  class T16=void, class T17=void, class T18=void, class T19=void, class T20=void>
843 struct MakeTypeListUnique
844 {
845  typedef typename PushUnique<T19, T20>::type L19;
846  typedef typename PushUnique<T18, L19>::type L18;
847  typedef typename PushUnique<T17, L18>::type L17;
848  typedef typename PushUnique<T16, L17>::type L16;
849  typedef typename PushUnique<T15, L16>::type L15;
850  typedef typename PushUnique<T14, L15>::type L14;
851  typedef typename PushUnique<T13, L14>::type L13;
852  typedef typename PushUnique<T12, L13>::type L12;
853  typedef typename PushUnique<T11, L12>::type L11;
854  typedef typename PushUnique<T10, L11>::type L10;
855  typedef typename PushUnique<T09, L10>::type L09;
856  typedef typename PushUnique<T08, L09>::type L08;
857  typedef typename PushUnique<T07, L08>::type L07;
858  typedef typename PushUnique<T06, L07>::type L06;
859  typedef typename PushUnique<T05, L06>::type L05;
860  typedef typename PushUnique<T04, L05>::type L04;
861  typedef typename PushUnique<T03, L04>::type L03;
862  typedef typename PushUnique<T02, L03>::type L02;
863  typedef typename PushUnique<T01, L02>::type L01;
864  typedef L01 type;
865 };
866 
867 // mask cl.exe shortcomings [end]
868 #if defined(_MSC_VER)
869 #pragma warning( pop )
870 #endif
871 
872 } // namespace vigra
873 
874 #endif /* VIGRA_METAPROGRAMMING_HXX */
Definition: accessor.hxx:43
Definition: metaprogramming.hxx:105
Definition: metaprogramming.hxx:112
Definition: metaprogramming.hxx:119

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.10.0