at_impl.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Copyright (c) 2009 Hartmut Kaiser
  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_NVIEW_AT_IMPL_SEP_24_2009_0225PM)
  7. #define BOOST_FUSION_NVIEW_AT_IMPL_SEP_24_2009_0225PM
  8. #include <boost/fusion/sequence/intrinsic/at.hpp>
  9. namespace boost { namespace fusion
  10. {
  11. struct nview_tag;
  12. namespace extension
  13. {
  14. template<typename Tag>
  15. struct at_impl;
  16. template<>
  17. struct at_impl<nview_tag>
  18. {
  19. template<typename Sequence, typename N>
  20. struct apply
  21. {
  22. typedef typename Sequence::sequence_type sequence_type;
  23. typedef typename Sequence::index_type index_type;
  24. typedef typename result_of::at<index_type, N>::type index;
  25. typedef typename result_of::at<sequence_type, index>::type type;
  26. static type
  27. call(Sequence& seq)
  28. {
  29. return fusion::at<index>(seq.seq);
  30. }
  31. };
  32. };
  33. }
  34. }}
  35. #endif