reverse_iter_fold.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef BOOST_MPL_ITER_FOLD_BACKWARD_HPP_INCLUDED
  2. #define BOOST_MPL_ITER_FOLD_BACKWARD_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2001-2004
  4. // Copyright Dave Abrahams 2001-2002
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/begin_end.hpp>
  15. #include <boost/mpl/O1_size.hpp>
  16. #include <boost/mpl/arg.hpp>
  17. #include <boost/mpl/lambda.hpp>
  18. #include <boost/mpl/aux_/reverse_iter_fold_impl.hpp>
  19. #include <boost/mpl/aux_/na_spec.hpp>
  20. #include <boost/mpl/aux_/lambda_support.hpp>
  21. namespace boost { namespace mpl {
  22. template<
  23. typename BOOST_MPL_AUX_NA_PARAM(Sequence)
  24. , typename BOOST_MPL_AUX_NA_PARAM(State)
  25. , typename BOOST_MPL_AUX_NA_PARAM(BackwardOp)
  26. , typename ForwardOp = arg<1>
  27. >
  28. struct reverse_iter_fold
  29. {
  30. typedef typename aux::reverse_iter_fold_impl<
  31. ::boost::mpl::O1_size<Sequence>::value
  32. , typename begin<Sequence>::type
  33. , typename end<Sequence>::type
  34. , State
  35. , typename lambda<BackwardOp>::type
  36. , typename lambda<ForwardOp>::type
  37. >::state type;
  38. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  39. 4
  40. , reverse_iter_fold
  41. , (Sequence,State,BackwardOp,ForwardOp)
  42. )
  43. };
  44. BOOST_MPL_AUX_NA_SPEC(3, reverse_iter_fold)
  45. }}
  46. #endif // BOOST_MPL_ITER_FOLD_BACKWARD_HPP_INCLUDED