forked from boostorg/fusion
fusion: merge of associative iterators/views and the new fold interface
[SVN r58618]
This commit is contained in:
@ -1,56 +1,43 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_BEGIN_IMPL_05222005_1108)
|
||||
#define FUSION_BEGIN_IMPL_05222005_1108
|
||||
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_BEGIN_IMPL_HPP
|
||||
#define BOOST_FUSION_CONTAINER_MAP_DETAIL_BEGIN_IMPL_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct map_tag;
|
||||
template <typename>
|
||||
struct begin_impl;
|
||||
|
||||
namespace extension
|
||||
template <>
|
||||
struct begin_impl<map_tag>
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<map_tag>
|
||||
template <typename Seq>
|
||||
struct apply
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
typedef
|
||||
basic_iterator<
|
||||
map_iterator_tag
|
||||
, typename Seq::category
|
||||
, Seq
|
||||
, 0
|
||||
>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Seq& seq)
|
||||
{
|
||||
typedef typename
|
||||
result_of::begin<typename Sequence::storage_type>::type
|
||||
iterator_type;
|
||||
|
||||
typedef typename
|
||||
result_of::begin<typename Sequence::storage_type const>::type
|
||||
const_iterator_type;
|
||||
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
is_const<Sequence>
|
||||
, mpl::identity<const_iterator_type>
|
||||
, mpl::identity<iterator_type>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Sequence& m)
|
||||
{
|
||||
return fusion::begin(m.get_data());
|
||||
}
|
||||
};
|
||||
return type(seq,0);
|
||||
}
|
||||
};
|
||||
}
|
||||
}}
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user