at_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_AT_IMPL_HPP
  7. #define BOOST_FUSION_ADAPTED_ARRAY_AT_IMPL_HPP
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/type_traits/add_reference.hpp>
  10. #include <boost/type_traits/remove_extent.hpp>
  11. namespace boost { namespace fusion { namespace extension
  12. {
  13. template<typename>
  14. struct at_impl;
  15. template<>
  16. struct at_impl<po_array_tag>
  17. {
  18. template<typename Seq, typename N>
  19. struct apply
  20. {
  21. typedef typename
  22. add_reference<typename remove_extent<Seq>::type>::type
  23. type;
  24. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  25. static type
  26. call(Seq& seq)
  27. {
  28. return seq[N::value];
  29. }
  30. };
  31. };
  32. }}}
  33. #endif