convert_impl.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  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_IMPL_09222005_1104)
  8. #define FUSION_CONVERT_IMPL_09222005_1104
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/fusion/container/vector/detail/as_vector.hpp>
  11. #include <boost/fusion/container/vector/vector.hpp>
  12. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  13. #include <boost/fusion/sequence/intrinsic/size.hpp>
  14. namespace boost { namespace fusion
  15. {
  16. struct vector_tag;
  17. namespace extension
  18. {
  19. template <typename T>
  20. struct convert_impl;
  21. template <>
  22. struct convert_impl<vector_tag>
  23. {
  24. template <typename Sequence>
  25. struct apply
  26. {
  27. typedef typename detail::as_vector<result_of::size<Sequence>::value> gen;
  28. typedef typename gen::
  29. template apply<typename result_of::begin<Sequence>::type>::type
  30. type;
  31. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  32. static type call(Sequence& seq)
  33. {
  34. return gen::call(fusion::begin(seq));
  35. }
  36. };
  37. };
  38. }
  39. }}
  40. #endif