inherit.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 "boost/mpl/inherit.hpp" header
  8. // -- DO NOT modify by hand!
  9. namespace boost { namespace mpl {
  10. namespace aux {
  11. template< bool C1, bool C2 >
  12. struct inherit2_impl
  13. {
  14. template< typename Derived, typename T1, typename T2 > struct result_
  15. : T1, T2
  16. {
  17. typedef Derived type_;
  18. };
  19. };
  20. template<>
  21. struct inherit2_impl< false,true >
  22. {
  23. template< typename Derived, typename T1, typename T2 > struct result_
  24. : T1
  25. {
  26. typedef T1 type_;
  27. };
  28. };
  29. template<>
  30. struct inherit2_impl< true,false >
  31. {
  32. template< typename Derived, typename T1, typename T2 > struct result_
  33. : T2
  34. {
  35. typedef T2 type_;
  36. };
  37. };
  38. template<>
  39. struct inherit2_impl< true,true >
  40. {
  41. template< typename Derived, typename T1, typename T2 > struct result_
  42. {
  43. typedef T1 type_;
  44. };
  45. };
  46. } // namespace aux
  47. template<
  48. typename BOOST_MPL_AUX_NA_PARAM(T1)
  49. , typename BOOST_MPL_AUX_NA_PARAM(T2)
  50. >
  51. struct inherit2
  52. : aux::inherit2_impl<
  53. is_empty_base<T1>::value
  54. , is_empty_base<T2>::value
  55. >::template result_< inherit2< T1,T2 >,T1, T2 >
  56. {
  57. typedef typename inherit2::type_ type;
  58. BOOST_MPL_AUX_LAMBDA_SUPPORT(2, inherit2, (T1, T2))
  59. };
  60. BOOST_MPL_AUX_NA_SPEC(2, inherit2)
  61. template<
  62. typename T1 = na, typename T2 = na, typename T3 = na
  63. >
  64. struct inherit3
  65. : inherit2<
  66. typename inherit2<
  67. T1, T2
  68. >::type
  69. , T3
  70. >
  71. {
  72. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  73. 3
  74. , inherit3
  75. , ( T1, T2, T3)
  76. )
  77. };
  78. BOOST_MPL_AUX_NA_SPEC(3, inherit3)
  79. template<
  80. typename T1 = na, typename T2 = na, typename T3 = na, typename T4 = na
  81. >
  82. struct inherit4
  83. : inherit2<
  84. typename inherit3<
  85. T1, T2, T3
  86. >::type
  87. , T4
  88. >
  89. {
  90. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  91. 4
  92. , inherit4
  93. , ( T1, T2, T3, T4)
  94. )
  95. };
  96. BOOST_MPL_AUX_NA_SPEC(4, inherit4)
  97. template<
  98. typename T1 = na, typename T2 = na, typename T3 = na, typename T4 = na
  99. , typename T5 = na
  100. >
  101. struct inherit5
  102. : inherit2<
  103. typename inherit4<
  104. T1, T2, T3, T4
  105. >::type
  106. , T5
  107. >
  108. {
  109. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  110. 5
  111. , inherit5
  112. , ( T1, T2, T3, T4, T5)
  113. )
  114. };
  115. BOOST_MPL_AUX_NA_SPEC(5, inherit5)
  116. /// primary template
  117. template<
  118. typename T1 = empty_base, typename T2 = empty_base
  119. , typename T3 = empty_base, typename T4 = empty_base
  120. , typename T5 = empty_base
  121. >
  122. struct inherit
  123. : inherit5< T1,T2,T3,T4,T5 >
  124. {
  125. };
  126. template<>
  127. struct inherit< na,na,na,na,na >
  128. {
  129. template<
  130. typename T1 = empty_base, typename T2 = empty_base
  131. , typename T3 = empty_base, typename T4 = empty_base
  132. , typename T5 = empty_base
  133. >
  134. struct apply
  135. : inherit< T1,T2,T3,T4,T5 >
  136. {
  137. };
  138. };
  139. BOOST_MPL_AUX_NA_SPEC_LAMBDA(5, inherit)
  140. BOOST_MPL_AUX_NA_SPEC_ARITY(5, inherit)
  141. BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(5, 5, inherit)
  142. }}