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

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

© 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.9.0 (Wed Feb 27 2013)