end_impl.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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_END_IMPL_09242011_1744)
  7. #define BOOST_FUSION_END_IMPL_09242011_1744
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
  10. #include <boost/type_traits/remove_const.hpp>
  11. #include <tuple>
  12. namespace boost { namespace fusion
  13. {
  14. struct std_tuple_tag;
  15. namespace extension
  16. {
  17. template<typename T>
  18. struct end_impl;
  19. template <>
  20. struct end_impl<std_tuple_tag>
  21. {
  22. template <typename Sequence>
  23. struct apply
  24. {
  25. typedef typename remove_const<Sequence>::type seq_type;
  26. static int const size = std::tuple_size<seq_type>::value;
  27. typedef std_tuple_iterator<Sequence, size> type;
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. static type
  30. call(Sequence& v)
  31. {
  32. return type(v);
  33. }
  34. };
  35. };
  36. }
  37. }}
  38. #endif