at_impl.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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/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 at_impl;
  14. template<>
  15. struct at_impl<po_array_tag>
  16. {
  17. template<typename Seq, typename N>
  18. struct apply
  19. {
  20. typedef typename
  21. add_reference<typename remove_extent<Seq>::type>::type
  22. type;
  23. static type
  24. call(Seq& seq)
  25. {
  26. return seq[N::value];
  27. }
  28. };
  29. };
  30. }}}
  31. #endif