convert_impl.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*=============================================================================
  2. Copyright (c) 2012-2014 Kohei Takahashi
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #if !defined(BOOST_FUSION_CONVERT_IMPL_10172012_0940)
  7. #define BOOST_FUSION_CONVERT_IMPL_10172012_0940
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp>
  10. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  11. #include <boost/fusion/sequence/intrinsic/end.hpp>
  12. namespace boost { namespace fusion
  13. {
  14. struct std_tuple_tag;
  15. namespace extension
  16. {
  17. template <typename T>
  18. struct convert_impl;
  19. template <>
  20. struct convert_impl<std_tuple_tag>
  21. {
  22. template <typename Sequence>
  23. struct apply
  24. {
  25. typedef detail::build_std_tuple<
  26. typename result_of::begin<Sequence>::type
  27. , typename result_of::end<Sequence>::type
  28. > gen;
  29. typedef typename gen::type type;
  30. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  31. static type
  32. call(Sequence& seq)
  33. {
  34. return gen::call(begin(seq), end(seq));
  35. }
  36. };
  37. };
  38. }
  39. }}
  40. #endif