Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:14

0001 /*=============================================================================
0002     Copyright (c) 2012 Paul Fultz II
0003     seq.h
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 
0008 #ifndef BOOST_HOF_GUARD_FUNCTION_DETAIL_SEQ_H
0009 #define BOOST_HOF_GUARD_FUNCTION_DETAIL_SEQ_H
0010 
0011 #include <cstdlib>
0012 
0013 namespace boost { namespace hof { 
0014 
0015 namespace detail {
0016 
0017 template<std::size_t ...>
0018 struct seq 
0019 {
0020     typedef seq type;
0021 };
0022 
0023 template <class, class>
0024 struct merge_seq;
0025 
0026 template <size_t... Xs, size_t... Ys>
0027 struct merge_seq<seq<Xs...>, seq<Ys...>>
0028 : seq<Xs..., (sizeof...(Xs)+Ys)...>
0029 {};
0030 
0031 template<std::size_t N>
0032 struct gens 
0033 : merge_seq<
0034     typename gens<N/2>::type,
0035     typename gens<N - N/2>::type
0036 > 
0037 {};
0038 
0039 template<> struct gens<0> : seq<> {}; 
0040 template<> struct gens<1> : seq<0> {}; 
0041 
0042 
0043 }
0044 }} // namespace boost::hof
0045 
0046 #endif