deref_impl.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*=============================================================================
  2. Copyright (c) 2010 Christopher Schmidt
  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. #ifndef BOOST_FUSION_ADAPTED_ARRAY_DEREF_IMPL_HPP
  7. #define BOOST_FUSION_ADAPTED_ARRAY_DEREF_IMPL_HPP
  8. #include <boost/type_traits/add_reference.hpp>
  9. #include <boost/type_traits/remove_extent.hpp>
  10. namespace boost { namespace fusion { namespace extension
  11. {
  12. template <typename>
  13. struct deref_impl;
  14. template <>
  15. struct deref_impl<po_array_iterator_tag>
  16. {
  17. template <typename It>
  18. struct apply
  19. {
  20. typedef typename
  21. add_reference<
  22. typename remove_extent<typename It::seq_type>::type
  23. >::type
  24. type;
  25. static type
  26. call(It const& it)
  27. {
  28. return (*it.seq)[It::index::value];
  29. }
  30. };
  31. };
  32. }}}
  33. #endif