convert_impl.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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_0120)
  7. #define BOOST_FUSION_CONVERT_IMPL_10172012_0120
  8. #include <boost/tuple/tuple.hpp>
  9. #include <boost/fusion/adapted/boost_tuple/detail/build_cons.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 boost_tuple_tag;
  15. namespace extension
  16. {
  17. template <typename T>
  18. struct convert_impl;
  19. template <>
  20. struct convert_impl<boost_tuple_tag>
  21. {
  22. template <typename Sequence>
  23. struct apply
  24. {
  25. typedef typename
  26. detail::build_tuple_cons<
  27. typename result_of::begin<Sequence>::type
  28. , typename result_of::end<Sequence>::type
  29. >
  30. build_tuple_cons;
  31. typedef typename build_tuple_cons::type type;
  32. BOOST_FUSION_GPU_ENABLED
  33. static type
  34. call(Sequence& seq)
  35. {
  36. return build_tuple_cons::call(fusion::begin(seq), fusion::end(seq));
  37. }
  38. };
  39. };
  40. }
  41. }}
  42. #endif