1/*=============================================================================
2 Copyright (c) 2012 Paul Fultz II
3 seq.h
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6==============================================================================*/
7
8#ifndef BOOST_HOF_GUARD_FUNCTION_DETAIL_SEQ_H
9#define BOOST_HOF_GUARD_FUNCTION_DETAIL_SEQ_H
10
11#include <cstdlib>
12
13namespace boost { namespace hof {
14
15namespace detail {
16
17template<std::size_t ...>
18struct seq
19{
20 typedef seq type;
21};
22
23template <class, class>
24struct merge_seq;
25
26template <size_t... Xs, size_t... Ys>
27struct merge_seq<seq<Xs...>, seq<Ys...>>
28: seq<Xs..., (sizeof...(Xs)+Ys)...>
29{};
30
31template<std::size_t N>
32struct gens
33: merge_seq<
34 typename gens<N/2>::type,
35 typename gens<N - N/2>::type
36>
37{};
38
39template<> struct gens<0> : seq<> {};
40template<> struct gens<1> : seq<0> {};
41
42
43}
44}} // namespace boost::hof
45
46#endif
47

source code of boost/libs/hof/include/boost/hof/detail/seq.hpp