MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
bounded.hpp
Go to the documentation of this file.
1 
12 // GENERATED HEADER: DO NOT EDIT.
15 
16 #ifndef BOOST_MPL11_DETAIL_LEFT_FOLDS_BOUNDED_HPP
17 #define BOOST_MPL11_DETAIL_LEFT_FOLDS_BOUNDED_HPP
18 
21 
22 
23 namespace boost { namespace mpl11 { namespace detail { namespace left_folds {
24 
25 
26  template <
27  std_size_t n, template <typename ...> class f,
28  typename state, typename xs>
29  struct bounded_impl {
30  using left = bounded_impl<
31  (n - 6)/2,
32  f,
33  f<f<f<f<f<f<state, head<xs>>, head<tail<xs>>>, head<tail<tail<xs>>>>, head<tail<tail<tail<xs>>>>>, head<tail<tail<tail<tail<xs>>>>>>, head<tail<tail<tail<tail<tail<xs>>>>>>>,
34  tail<tail<tail<tail<tail<tail<xs>>>>>>
35  >;
36  using right = bounded_impl<
37  (n - 6) - (n - 6)/2,
38  f,
39  typename left::result,
40  typename left::rest
41  >;
42 
43  using rest = typename right::rest;
44  using result = typename right::result;
45  };
46 
47 
48  template <template <typename ...> class f, typename state, typename xs>
49  struct bounded_impl<0, f, state, xs> {
50  using rest = xs;
51  using result = state;
52  };
53 
54  template <template <typename ...> class f, typename state, typename xs>
55  struct bounded_impl<1, f, state, xs> {
56  using rest = tail<xs>;
57  using result = f<state, head<xs>>;
58  };
59 
60  template <template <typename ...> class f, typename state, typename xs>
61  struct bounded_impl<2, f, state, xs> {
62  using rest = tail<tail<xs>>;
63  using result = f<f<state, head<xs>>, head<tail<xs>>>;
64  };
65 
66  template <template <typename ...> class f, typename state, typename xs>
67  struct bounded_impl<3, f, state, xs> {
68  using rest = tail<tail<tail<xs>>>;
69  using result = f<f<f<state, head<xs>>, head<tail<xs>>>, head<tail<tail<xs>>>>;
70  };
71 
72  template <template <typename ...> class f, typename state, typename xs>
73  struct bounded_impl<4, f, state, xs> {
74  using rest = tail<tail<tail<tail<xs>>>>;
75  using result = f<f<f<f<state, head<xs>>, head<tail<xs>>>, head<tail<tail<xs>>>>, head<tail<tail<tail<xs>>>>>;
76  };
77 
78  template <template <typename ...> class f, typename state, typename xs>
79  struct bounded_impl<5, f, state, xs> {
80  using rest = tail<tail<tail<tail<tail<xs>>>>>;
81  using result = f<f<f<f<f<state, head<xs>>, head<tail<xs>>>, head<tail<tail<xs>>>>, head<tail<tail<tail<xs>>>>>, head<tail<tail<tail<tail<xs>>>>>>;
82  };
83 
84 
92  template <
93  std_size_t n,
94  template <typename ...> class f,
95  typename state,
96  typename xs
97  >
98  using bounded = typename bounded_impl<n, f, state, xs>::result;
99 }}}} // end namespace boost::mpl11::detail::left_folds
100 
101 #endif // !BOOST_MPL11_DETAIL_LEFT_FOLDS_BOUNDED_HPP
Defines boost::mpl11::detail::std_size_t.
Forward declares the Iterable typeclass.