/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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_CONVERT_MAIN_09232005_1340) #define FUSION_CONVERT_MAIN_09232005_1340 #include #include namespace boost { namespace fusion { namespace detail { template struct pair_from { typedef typename result_of::value_of::type type; BOOST_FUSION_GPU_ENABLED static inline type call(It const& it) { return *it; } }; template struct pair_from { typedef typename result_of::key_of::type key_type; typedef typename result_of::value_of_data::type data_type; typedef typename fusion::pair type; BOOST_FUSION_GPU_ENABLED static inline type call(It const& it) { return type(deref_data(it)); } }; }}} /////////////////////////////////////////////////////////////////////////////// // Without variadics, we will use the PP version /////////////////////////////////////////////////////////////////////////////// #if !defined(BOOST_FUSION_HAS_VARIADIC_MAP) # include #else /////////////////////////////////////////////////////////////////////////////// // C++11 variadic implementation /////////////////////////////////////////////////////////////////////////////// #include namespace boost { namespace fusion { namespace result_of { template struct as_map : detail::build_map< typename result_of::begin::type , typename result_of::end::type , is_base_of< associative_tag , typename traits::category_of::type>::value > { }; } template BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence& seq) { typedef result_of::as_map gen; return gen::call(fusion::begin(seq), fusion::end(seq)); } template BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence const& seq) { typedef result_of::as_map gen; return gen::call(fusion::begin(seq), fusion::end(seq)); } namespace extension { template struct convert_impl; template <> struct convert_impl { template struct apply { typedef typename result_of::as_map::type type; BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { typedef result_of::as_map gen; return gen::call(fusion::begin(seq), fusion::end(seq)); } }; }; } }} #endif #endif