Fusion: resolved const correctness issue

[SVN r56381]
This commit is contained in:
Hartmut Kaiser
2009-09-25 13:57:30 +00:00
parent 10c0665ffa
commit 37f57fbf7f
5 changed files with 13 additions and 12 deletions

View File

@ -29,15 +29,14 @@ namespace boost { namespace fusion
template<typename Sequence>
struct apply
{
typedef typename Sequence::sequence_type sequence_type;
typedef typename Sequence::index_type index_type;
typedef nview_iterator<sequence_type,
typedef nview_iterator<Sequence,
typename mpl::begin<index_type>::type> type;
static type call(Sequence& v)
static type call(Sequence& s)
{
return type(v.seq);
return type(s);
}
};
};

View File

@ -30,11 +30,12 @@ namespace boost { namespace fusion
typedef typename Iterator::sequence_type sequence_type;
typedef typename result_of::deref<first_type>::type index;
typedef typename result_of::at<sequence_type, index>::type type;
typedef typename result_of::at<
typename sequence_type::sequence_type, index>::type type;
static type call(Iterator const& i)
{
return at<index>(i.seq);
return at<index>(i.seq.seq);
}
};
};

View File

@ -30,15 +30,14 @@ namespace boost { namespace fusion
template <typename Sequence>
struct apply
{
typedef typename Sequence::sequence_type sequence_type;
typedef typename Sequence::index_type index_type;
typedef nview_iterator<sequence_type,
typedef nview_iterator<Sequence,
typename mpl::end<index_type>::type> type;
static type call(Sequence& v)
static type call(Sequence& s)
{
return type(v.seq);
return type(s);
}
};
};

View File

@ -10,6 +10,7 @@
#if !defined(BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM)
#define BOOST_FUSION_NVIEW_IMPL_SEP_23_2009_1017PM
#include <climits>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/iterate.hpp>
@ -28,7 +29,7 @@
namespace boost { namespace fusion { namespace result_of
{
template <typename Sequence
, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, -1)>
, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, INT_MAX)>
struct as_nview
{
typedef mpl::vector_c<

View File

@ -33,7 +33,8 @@ namespace boost { namespace fusion
typedef typename Iterator::sequence_type sequence_type;
typedef typename result_of::deref<first_type>::type index;
typedef typename result_of::at<sequence_type, index>::type type;
typedef typename result_of::at<
typename sequence_type::sequence_type, index>::type type;
};
};
}