/Src/Dependencies/Boost/boost/fusion/container/deque/detail/begin_impl.hpp

http://hadesmem.googlecode.com/ · C++ Header · 46 lines · 31 code · 8 blank · 7 comment · 0 complexity · 403ea8ef51cae7e20733aa17a829aa42 MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2001-2006 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #if !defined(BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034)
  8. #define BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034
  9. #include <boost/fusion/container/deque/deque_iterator.hpp>
  10. #include <boost/mpl/equal_to.hpp>
  11. #include <boost/mpl/if.hpp>
  12. namespace boost { namespace fusion {
  13. struct deque_tag;
  14. namespace extension
  15. {
  16. template<typename T>
  17. struct begin_impl;
  18. template<>
  19. struct begin_impl<deque_tag>
  20. {
  21. template<typename Sequence>
  22. struct apply
  23. {
  24. typedef typename mpl::if_<
  25. mpl::equal_to<typename Sequence::next_down, typename Sequence::next_up>,
  26. deque_iterator<Sequence, 0>,
  27. deque_iterator<
  28. Sequence, mpl::plus<typename Sequence::next_down, mpl::int_<1> >::value> >::type type;
  29. static type call(Sequence& seq)
  30. {
  31. return type(seq);
  32. }
  33. };
  34. };
  35. }
  36. }}
  37. #endif