value_of_impl.hpp 1.4 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_VALUE_OF_PRIOR_IMPL_SEP_24_2009_0158PM)
  7. #define BOOST_FUSION_VALUE_OF_PRIOR_IMPL_SEP_24_2009_0158PM
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/iterator/deref.hpp>
  10. #include <boost/fusion/container/vector.hpp>
  11. namespace boost { namespace fusion
  12. {
  13. struct nview_iterator_tag;
  14. template <typename Sequence, typename Pos>
  15. struct nview_iterator;
  16. namespace extension
  17. {
  18. template <typename Tag>
  19. struct value_of_impl;
  20. template <>
  21. struct value_of_impl<nview_iterator_tag>
  22. {
  23. template <typename Iterator>
  24. struct apply
  25. {
  26. typedef typename Iterator::first_type first_type;
  27. typedef typename Iterator::sequence_type sequence_type;
  28. typedef typename result_of::deref<first_type>::type index;
  29. typedef typename result_of::at<
  30. typename sequence_type::sequence_type, index>::type type;
  31. };
  32. };
  33. }
  34. }}
  35. #endif