added as_map

fixed bug: wrong iterator category for map_iterator

[SVN r82721]
This commit is contained in:
Joel de Guzman
2013-02-04 09:52:52 +00:00
parent 764a31e9f5
commit 85119dbd21
7 changed files with 156 additions and 25 deletions

View File

@ -24,28 +24,30 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply
{
typedef mpl::int_<N::value> index;
typedef
decltype(std::declval<Sequence>().get(N()))
decltype(std::declval<Sequence>().get(index()))
type;
static type
call(Sequence& m)
{
return m.get(N());
return m.get(index());
}
};
template <typename Sequence, typename N>
struct apply<Sequence const, N>
{
typedef mpl::int_<N::value> index;
typedef
decltype(std::declval<Sequence const>().get(N()))
decltype(std::declval<Sequence const>().get(index()))
type;
static type
call(Sequence const& m)
{
return m.get(N());
return m.get(index());
}
};
};