3 Defines `boost::hana::detail::type_foldr1`.
5 @copyright Louis Dionne 2013-2016
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_FOLDR1_HPP
11 #define BOOST_HANA_DETAIL_TYPE_FOLDR1_HPP
13 #include <boost/hana/config.hpp>
16 BOOST_HANA_NAMESPACE_BEGIN namespace detail {
21 struct type_foldr1_t<0> {
23 template <typename ...> class f,
30 struct type_foldr1_t<1> {
32 template <typename ...> class f,
36 using result = typename f<x1, state>::type;
40 struct type_foldr1_t<2> {
42 template <typename ...> class f,
43 typename x1, typename x2,
46 using result = typename f<x1, typename f<x2, state>::type>::type;
50 struct type_foldr1_t<3> {
52 template <typename ...> class f,
53 typename x1, typename x2, typename x3,
56 using result = typename f<
69 struct type_foldr1_t<4> {
71 template <typename ...> class f,
72 typename x1, typename x2, typename x3, typename x4,
75 using result = typename f<
91 struct type_foldr1_t<5> {
93 template <typename ...> class f,
94 typename x1, typename x2, typename x3, typename x4, typename x5,
97 using result = typename f<
116 struct type_foldr1_t<6> {
118 template <typename ...> class f,
119 typename x1, typename x2, typename x3, typename x4, typename x5, typename x6,
133 typename type_foldr1_t<(sizeof...(xs) > 6 ? 6 : sizeof...(xs))>::
134 template result<f, x6, xs...>
142 template <template <typename ...> class f, typename x1, typename ...xn>
144 using type = typename type_foldr1_t<(sizeof...(xn) > 6 ? 6 : sizeof...(xn))>
145 ::template result<f, x1, xn...>;
147 } BOOST_HANA_NAMESPACE_END
149 #endif // !BOOST_HANA_DETAIL_TYPE_FOLDR1_HPP