size_impl.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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(FUSION_NVIEW_SIZE_IMPL_OCT_06_2009_0525PM)
  7. #define FUSION_NVIEW_SIZE_IMPL_OCT_06_2009_0525PM
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/iterator/distance.hpp>
  10. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  11. #include <boost/fusion/sequence/intrinsic/end.hpp>
  12. namespace boost { namespace fusion
  13. {
  14. struct nview_tag;
  15. namespace extension
  16. {
  17. template <typename Tag>
  18. struct size_impl;
  19. template <>
  20. struct size_impl<nview_tag>
  21. {
  22. template <typename Sequence>
  23. struct apply
  24. : result_of::distance<
  25. typename result_of::begin<Sequence>::type
  26. , typename result_of::end<Sequence>::type>
  27. {};
  28. };
  29. }
  30. }}
  31. #endif