forked from boostorg/fusion
added as_map
fixed bug: wrong iterator category for map_iterator [SVN r82721]
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user