1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_CONVERT_10022005_1442)
8 #define FUSION_CONVERT_10022005_1442
10 #include <boost/fusion/support/config.hpp>
11 #if BOOST_WORKAROUND(BOOST_GCC, < 30500)
12 #include <boost/core/enable_if.hpp>
13 #include <boost/type_traits/is_const.hpp>
14 #define BOOST_FUSION_WA_GCC34(type1, type2) \
15 boost::lazy_disable_if<boost::is_const<Sequence>, type1, type2>
17 #define BOOST_FUSION_WA_GCC34(type1, type2) type1, type2
20 namespace boost { namespace fusion
24 template <typename Tag>
30 template <typename Tag, typename Sequence>
34 extension::convert_impl<Tag>::template apply<Sequence>
37 typedef typename gen::type type;
41 template <typename Tag, typename Sequence>
42 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
43 inline typename BOOST_FUSION_WA_GCC34(result_of::convert<Tag, Sequence>)::type
44 convert(Sequence& seq)
46 typedef typename result_of::convert<Tag, Sequence>::gen gen;
47 return gen::call(seq);
50 template <typename Tag, typename Sequence>
51 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
52 inline typename result_of::convert<Tag, Sequence const>::type
53 convert(Sequence const& seq)
55 typedef typename result_of::convert<Tag, Sequence const>::gen gen;
56 return gen::call(seq);
60 #undef BOOST_FUSION_WA_GCC34