distance_impl.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_DISTANCE_IMPL_SEP_23_2009_0328PM)
  7. #define BOOST_FUSION_NVIEW_DISTANCE_IMPL_SEP_23_2009_0328PM
  8. #include <boost/fusion/iterator/distance.hpp>
  9. namespace boost { namespace fusion
  10. {
  11. struct nview_iterator_tag;
  12. namespace extension
  13. {
  14. template<typename Tag>
  15. struct distance_impl;
  16. template<>
  17. struct distance_impl<nview_iterator_tag>
  18. {
  19. template<typename First, typename Last>
  20. struct apply
  21. : result_of::distance<typename First::first_type, typename Last::first_type>
  22. {
  23. typedef typename result_of::distance<
  24. typename First::first_type, typename Last::first_type
  25. >::type type;
  26. static type
  27. call(First const& /*first*/, Last const& /*last*/)
  28. {
  29. return type();
  30. }
  31. };
  32. };
  33. }
  34. }}
  35. #endif