end_impl.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  4. Copyright (c) 2009-2010 Christopher Schmidt
  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. #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
  9. #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
  10. #include <boost/fusion/support/config.hpp>
  11. #include <boost/fusion/iterator/basic_iterator.hpp>
  12. namespace boost { namespace fusion { namespace extension
  13. {
  14. template <typename>
  15. struct end_impl;
  16. template <>
  17. struct end_impl<struct_tag>
  18. {
  19. template <typename Seq>
  20. struct apply
  21. {
  22. typedef
  23. basic_iterator<
  24. struct_iterator_tag
  25. , random_access_traversal_tag
  26. , Seq
  27. , struct_size<typename remove_const<Seq>::type>::value
  28. >
  29. type;
  30. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  31. static type
  32. call(Seq& seq)
  33. {
  34. return type(seq,0);
  35. }
  36. };
  37. };
  38. template <>
  39. struct end_impl<assoc_struct_tag>
  40. {
  41. template <typename Seq>
  42. struct apply
  43. {
  44. typedef
  45. basic_iterator<
  46. struct_iterator_tag
  47. , assoc_struct_category
  48. , Seq
  49. , struct_size<typename remove_const<Seq>::type>::value
  50. >
  51. type;
  52. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  53. static type
  54. call(Seq& seq)
  55. {
  56. return type(seq,0);
  57. }
  58. };
  59. };
  60. }}}
  61. #endif