3 Defines `boost::hana::detail::type_foldl1`.
5 @copyright Louis Dionne 2013-2017
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_DETAIL_TYPE_FOLDL1_HPP
11 #define BOOST_HANA_DETAIL_TYPE_FOLDL1_HPP
13 #include <boost/hana/config.hpp>
16 BOOST_HANA_NAMESPACE_BEGIN namespace detail {
21 struct type_foldl1_t<0> {
23 template <typename ...> class f,
30 struct type_foldl1_t<1> {
32 template <typename ...> class f,
36 using result = typename f<state, x1>::type;
40 struct type_foldl1_t<2> {
42 template <typename ...> class f,
44 typename x1, typename x2
46 using result = typename f<typename f<state, x1>::type, x2>::type;
50 struct type_foldl1_t<3> {
52 template <typename ...> class f,
54 typename x1, typename x2, typename x3
56 using result = typename f<
58 typename f<state, x1>::type,
66 struct type_foldl1_t<4> {
68 template <typename ...> class f,
70 typename x1, typename x2, typename x3, typename x4
72 using result = typename f<
75 typename f<state, x1>::type,
85 struct type_foldl1_t<5> {
87 template <typename ...> class f,
89 typename x1, typename x2, typename x3, typename x4, typename x5
91 using result = typename f<
95 typename f<state, x1>::type,
107 struct type_foldl1_t<6> {
109 template <typename ...> class f,
111 typename x1, typename x2, typename x3, typename x4, typename x5, typename x6,
115 typename type_foldl1_t<(sizeof...(xs) > 6 ? 6 : sizeof...(xs))>::
123 typename f<state, x1>::type,
138 template <template <typename ...> class f, typename x1, typename ...xn>
140 using type = typename type_foldl1_t<(sizeof...(xn) > 6 ? 6 : sizeof...(xn))>
141 ::template result<f, x1, xn...>;
143 } BOOST_HANA_NAMESPACE_END
145 #endif // !BOOST_HANA_DETAIL_TYPE_FOLDL1_HPP