File indexing completed on 2025-01-31 09:41:55
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_PP_IS_ITERATING
0009
0010 #if !defined(BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM)
0011 #define BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM
0012
0013 #include <climits>
0014 #include <boost/preprocessor/cat.hpp>
0015 #include <boost/preprocessor/repeat.hpp>
0016 #include <boost/preprocessor/iterate.hpp>
0017 #include <boost/preprocessor/repetition/enum_params.hpp>
0018 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0019 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
0020 #include <boost/mpl/vector_c.hpp>
0021 #include <boost/fusion/adapted/mpl.hpp>
0022 #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
0023
0024 #define BOOST_PP_ITERATION_PARAMS_1 \
0025 (3, (1, FUSION_MAX_VECTOR_SIZE, \
0026 "boost/fusion/view/nview/detail/cpp03/nview_impl.hpp")) \
0027
0028
0029
0030 namespace boost { namespace fusion { namespace result_of
0031 {
0032 template <typename Sequence
0033 , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, INT_MAX)>
0034 struct as_nview
0035 {
0036 typedef mpl::vector_c<
0037 int, BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, I)
0038 > index_type;
0039 typedef nview<Sequence, index_type> type;
0040 };
0041 }}}
0042
0043 #include BOOST_PP_ITERATE()
0044
0045 #endif
0046
0047
0048
0049
0050 #else
0051
0052 #define N BOOST_PP_ITERATION()
0053
0054 #if N < FUSION_MAX_VECTOR_SIZE
0055 namespace boost { namespace fusion { namespace result_of
0056 {
0057 template <typename Sequence, BOOST_PP_ENUM_PARAMS(N, int I)>
0058 struct as_nview<Sequence, BOOST_PP_ENUM_PARAMS(N, I)>
0059 {
0060 typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
0061 typedef nview<Sequence, index_type> type;
0062 };
0063 }}}
0064 #endif
0065
0066 namespace boost { namespace fusion
0067 {
0068 template<BOOST_PP_ENUM_PARAMS(N, int I), typename Sequence>
0069 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0070 inline nview<Sequence, mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> >
0071 as_nview(Sequence& s)
0072 {
0073 typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
0074 return nview<Sequence, index_type>(s);
0075 }
0076
0077 }}
0078
0079 #undef N
0080
0081 #endif