convert_impl.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*=============================================================================
  2. Copyright (c) 2005-2012 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  4. Copyright (c) 2015 Kohei Takahashi
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. #if !defined(FUSION_CONVERT_IMPL_20061213_2207)
  9. #define FUSION_CONVERT_IMPL_20061213_2207
  10. #include <boost/fusion/support/config.hpp>
  11. #include <boost/fusion/container/deque/convert.hpp>
  12. #include <boost/fusion/container/deque/deque.hpp>
  13. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  14. #include <boost/fusion/sequence/intrinsic/end.hpp>
  15. namespace boost { namespace fusion
  16. {
  17. struct deque_tag;
  18. namespace result_of
  19. {
  20. template <typename Sequence>
  21. struct as_deque;
  22. }
  23. namespace extension
  24. {
  25. template <typename T>
  26. struct convert_impl;
  27. template <>
  28. struct convert_impl<deque_tag>
  29. {
  30. template <typename Sequence>
  31. struct apply
  32. {
  33. typedef result_of::as_deque<Sequence> gen;
  34. typedef typename gen::type type;
  35. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  36. static type call(Sequence& seq)
  37. {
  38. return gen::call(fusion::begin(seq)
  39. #if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
  40. , fusion::end(seq)
  41. #endif
  42. );
  43. }
  44. };
  45. };
  46. }
  47. }}
  48. #endif