inherit.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. 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. };
  19. template< typename T1 >
  20. struct inherit2< T1,empty_base >
  21. {
  22. typedef T1 type;
  23. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (T1, empty_base))
  24. };
  25. template< typename T2 >
  26. struct inherit2< empty_base,T2 >
  27. {
  28. typedef T2 type;
  29. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (empty_base, T2))
  30. };
  31. template<>
  32. struct inherit2< empty_base,empty_base >
  33. {
  34. typedef empty_base type;
  35. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (empty_base, empty_base))
  36. };
  37. BOOST_MPL_AUX_NA_SPEC(2, inherit2)
  38. template<
  39. typename T1 = na, typename T2 = na, typename T3 = na
  40. >
  41. struct inherit3
  42. : inherit2<
  43. typename inherit2<
  44. T1, T2
  45. >::type
  46. , T3
  47. >
  48. {
  49. };
  50. BOOST_MPL_AUX_NA_SPEC(3, inherit3)
  51. template<
  52. typename T1 = na, typename T2 = na, typename T3 = na, typename T4 = na
  53. >
  54. struct inherit4
  55. : inherit2<
  56. typename inherit3<
  57. T1, T2, T3
  58. >::type
  59. , T4
  60. >
  61. {
  62. };
  63. BOOST_MPL_AUX_NA_SPEC(4, inherit4)
  64. template<
  65. typename T1 = na, typename T2 = na, typename T3 = na, typename T4 = na
  66. , typename T5 = na
  67. >
  68. struct inherit5
  69. : inherit2<
  70. typename inherit4<
  71. T1, T2, T3, T4
  72. >::type
  73. , T5
  74. >
  75. {
  76. };
  77. BOOST_MPL_AUX_NA_SPEC(5, inherit5)
  78. /// primary template
  79. template<
  80. typename T1 = empty_base, typename T2 = empty_base
  81. , typename T3 = empty_base, typename T4 = empty_base
  82. , typename T5 = empty_base
  83. >
  84. struct inherit
  85. : inherit5< T1,T2,T3,T4,T5 >
  86. {
  87. };
  88. template<>
  89. struct inherit< na,na,na,na,na >
  90. {
  91. template<
  92. typename T1 = empty_base, typename T2 = empty_base
  93. , typename T3 = empty_base, typename T4 = empty_base
  94. , typename T5 = empty_base
  95. >
  96. struct apply
  97. : inherit< T1,T2,T3,T4,T5 >
  98. {
  99. };
  100. };
  101. BOOST_MPL_AUX_NA_SPEC_LAMBDA(5, inherit)
  102. BOOST_MPL_AUX_NA_SPEC_ARITY(5, inherit)
  103. BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(5, 5, inherit)
  104. }}