1
/*=============================================================================
2
Copyright (c) 2009 Hartmut Kaiser
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
==============================================================================*/
8
#ifndef BOOST_PP_IS_ITERATING
10
#if !defined(BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM)
11
#define BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM
14
#include <boost/preprocessor/cat.hpp>
15
#include <boost/preprocessor/repeat.hpp>
16
#include <boost/preprocessor/iterate.hpp>
17
#include <boost/preprocessor/repetition/enum_params.hpp>
18
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
19
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
21
#define BOOST_PP_ITERATION_PARAMS_1 \
22
(3, (1, FUSION_MAX_VECTOR_SIZE, \
23
"boost/fusion/view/nview/detail/nview_impl.hpp")) \
26
///////////////////////////////////////////////////////////////////////////////
27
namespace boost { namespace fusion { namespace result_of
29
template <typename Sequence
30
, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, LONG_MAX)>
33
typedef mpl::vector_c<
34
int, BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, I)
36
typedef nview<Sequence, index_type> type;
40
#include BOOST_PP_ITERATE()
44
///////////////////////////////////////////////////////////////////////////////
45
// Preprocessor vertical repetition code
46
///////////////////////////////////////////////////////////////////////////////
47
#else // defined(BOOST_PP_IS_ITERATING)
49
#define N BOOST_PP_ITERATION()
51
#if N < FUSION_MAX_VECTOR_SIZE
52
namespace boost { namespace fusion { namespace result_of
54
template <typename Sequence, BOOST_PP_ENUM_PARAMS(N, int I)>
55
struct as_nview<Sequence, BOOST_PP_ENUM_PARAMS(N, I)>
57
typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
58
typedef nview<Sequence, index_type> type;
63
namespace boost { namespace fusion
65
template<BOOST_PP_ENUM_PARAMS(N, int I), typename Sequence>
66
inline nview<Sequence, mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> >
69
typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
70
return nview<Sequence, index_type>(s);