~tsarev/boostdc/cmake

« back to all changes in this revision

Viewing changes to boost/boost/fusion/view/nview/detail/nview_impl.hpp

  • Committer: bigmuscle
  • Date: 2010-05-08 08:47:15 UTC
  • Revision ID: svn-v4:5fb55d53-692c-0410-a46a-e90ab66e00ee:trunk:497
removed old boost version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=============================================================================
2
 
    Copyright (c) 2009 Hartmut Kaiser
3
 
 
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_PP_IS_ITERATING
9
 
 
10
 
#if !defined(BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM)
11
 
#define BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM
12
 
 
13
 
#include <climits>
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>
20
 
 
21
 
#define BOOST_PP_ITERATION_PARAMS_1                                           \
22
 
    (3, (1, FUSION_MAX_VECTOR_SIZE,                                           \
23
 
    "boost/fusion/view/nview/detail/nview_impl.hpp"))                         \
24
 
    /**/
25
 
 
26
 
///////////////////////////////////////////////////////////////////////////////
27
 
namespace boost { namespace fusion { namespace result_of
28
 
{
29
 
    template <typename Sequence
30
 
      , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, LONG_MAX)>
31
 
    struct as_nview
32
 
    {
33
 
        typedef mpl::vector_c<
34
 
            int, BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, I)
35
 
        > index_type;
36
 
        typedef nview<Sequence, index_type> type;
37
 
    };
38
 
}}}
39
 
 
40
 
#include BOOST_PP_ITERATE()
41
 
 
42
 
#endif
43
 
 
44
 
///////////////////////////////////////////////////////////////////////////////
45
 
//  Preprocessor vertical repetition code
46
 
///////////////////////////////////////////////////////////////////////////////
47
 
#else // defined(BOOST_PP_IS_ITERATING)
48
 
 
49
 
#define N BOOST_PP_ITERATION()
50
 
 
51
 
#if N < FUSION_MAX_VECTOR_SIZE
52
 
namespace boost { namespace fusion { namespace result_of
53
 
{
54
 
    template <typename Sequence, BOOST_PP_ENUM_PARAMS(N, int I)>
55
 
    struct as_nview<Sequence, BOOST_PP_ENUM_PARAMS(N, I)>
56
 
    {
57
 
        typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
58
 
        typedef nview<Sequence, index_type> type;
59
 
    };
60
 
}}}
61
 
#endif
62
 
 
63
 
namespace boost { namespace fusion
64
 
{
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)> >
67
 
    as_nview(Sequence& s)
68
 
    {
69
 
        typedef mpl::vector_c<int, BOOST_PP_ENUM_PARAMS(N, I)> index_type;
70
 
        return nview<Sequence, index_type>(s);
71
 
    }
72
 
 
73
 
}}
74
 
 
75
 
#undef N
76
 
 
77
 
#endif