end_impl.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_09272006_0721)
  7. #define BOOST_FUSION_END_IMPL_09272006_0721
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp>
  10. #include <boost/mpl/if.hpp>
  11. #include <boost/type_traits/is_const.hpp>
  12. namespace boost { namespace tuples
  13. {
  14. struct null_type;
  15. }}
  16. namespace boost { namespace fusion
  17. {
  18. struct boost_tuple_tag;
  19. namespace extension
  20. {
  21. template <typename Tag>
  22. struct end_impl;
  23. template <>
  24. struct end_impl<boost_tuple_tag>
  25. {
  26. template <typename Sequence>
  27. struct apply
  28. {
  29. typedef
  30. boost_tuple_iterator<
  31. typename mpl::if_<
  32. is_const<Sequence>
  33. , tuples::null_type const
  34. , tuples::null_type
  35. >::type
  36. >
  37. type;
  38. BOOST_FUSION_GPU_ENABLED
  39. static type
  40. call(Sequence& seq)
  41. {
  42. return type(seq);
  43. }
  44. };
  45. };
  46. }
  47. }}
  48. #endif