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

@ -7,6 +7,51 @@
#if !defined(FUSION_CONVERT_MAIN_09232005_1340)
#define FUSION_CONVERT_MAIN_09232005_1340
#include <boost/fusion/container/map/detail/cpp03/convert.hpp>
#include <boost/fusion/container/map/map.hpp>
///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
# include <boost/fusion/container/map/detail/cpp03/convert.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 variadic implementation
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/map/detail/build_map.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence>
struct as_map :
detail::build_map<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type
>
{
};
}
template <typename Sequence>
inline typename result_of::as_map<Sequence>::type
as_map(Sequence& seq)
{
typedef result_of::as_map<Sequence> gen;
return gen::call(fusion::begin(seq), fusion::end(seq));
}
template <typename Sequence>
inline typename result_of::as_map<Sequence const>::type
as_map(Sequence const& seq)
{
typedef result_of::as_map<Sequence const> gen;
return gen::call(fusion::begin(seq), fusion::end(seq));
}
}}
#endif
#endif