inherit.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Copyright Aleksey Gurtovoy 2001-2004
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // *Preprocessed* version of the main "inherit.hpp" header
  8. // -- DO NOT modify by hand!
  9. namespace boost { namespace mpl {
  10. template<
  11. typename BOOST_MPL_AUX_NA_PARAM(T1)
  12. , typename BOOST_MPL_AUX_NA_PARAM(T2)
  13. >
  14. struct inherit2
  15. : T1, T2
  16. {
  17. typedef inherit2 type;
  18. BOOST_MPL_AUX_LAMBDA_SUPPORT(2, inherit2, (T1, T2))
  19. };
  20. template< typename T1 >
  21. struct inherit2< T1,empty_base >
  22. {
  23. typedef T1 type;
  24. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (T1, empty_base))
  25. };
  26. template< typename T2 >
  27. struct inherit2< empty_base,T2 >
  28. {
  29. typedef T2 type;
  30. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (empty_base, T2))
  31. };
  32. template<>
  33. struct inherit2< empty_base,empty_base >
  34. {
  35. typedef empty_base type;
  36. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (empty_base, empty_base))
  37. };
  38. BOOST_MPL_AUX_NA_SPEC(2, inherit2)
  39. template<
  40. typename T1 = na, typename T2 = na, typename T3 = na
  41. >
  42. struct inherit3
  43. : inherit2<
  44. typename inherit2<
  45. T1, T2
  46. >::type
  47. , T3
  48. >
  49. {
  50. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  51. 3
  52. , inherit3
  53. , ( T1, T2, T3)
  54. )
  55. };
  56. BOOST_MPL_AUX_NA_SPEC(3, inherit3)
  57. template<
  58. typename T1 = na, typename T2 = na, typename T3 = na, typename T4 = na
  59. >
  60. struct inherit4
  61. : inherit2<
  62. typename inherit3<
  63. T1, T2, T3
  64. >::type
  65. , T4
  66. >
  67. {
  68. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  69. 4
  70. , inherit4
  71. , ( T1, T2, T3, T4)
  72. )
  73. };
  74. BOOST_MPL_AUX_NA_SPEC(4, inherit4)
  75. template<
  76. typename T1 = na, typename T2 = na, typename T3 = na, typename T4 = na
  77. , typename T5 = na
  78. >
  79. struct inherit5
  80. : inherit2<
  81. typename inherit4<
  82. T1, T2, T3, T4
  83. >::type
  84. , T5
  85. >
  86. {
  87. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  88. 5
  89. , inherit5
  90. , ( T1, T2, T3, T4, T5)
  91. )
  92. };
  93. BOOST_MPL_AUX_NA_SPEC(5, inherit5)
  94. /// primary template
  95. template<
  96. typename T1 = empty_base, typename T2 = empty_base
  97. , typename T3 = empty_base, typename T4 = empty_base
  98. , typename T5 = empty_base
  99. >
  100. struct inherit
  101. : inherit5< T1,T2,T3,T4,T5 >
  102. {
  103. };
  104. template<>
  105. struct inherit< na,na,na,na,na >
  106. {
  107. template<
  108. typename T1, typename T2, typename T3, typename T4, typename T5
  109. >
  110. struct apply
  111. : inherit< T1,T2,T3,T4,T5 >
  112. {
  113. };
  114. };
  115. BOOST_MPL_AUX_NA_SPEC_LAMBDA(5, inherit)
  116. BOOST_MPL_AUX_NA_SPEC_ARITY(5, inherit)
  117. BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(5, 5, inherit)
  118. }}