reverse_fold.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef BOOST_MPL_REVERSE_FOLD_HPP_INCLUDED
  2. #define BOOST_MPL_REVERSE_FOLD_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2001-2004
  4. // Copyright David 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/aux_/reverse_fold_impl.hpp>
  18. #include <boost/mpl/aux_/na_spec.hpp>
  19. namespace boost { namespace mpl {
  20. template<
  21. typename BOOST_MPL_AUX_NA_PARAM(Sequence)
  22. , typename BOOST_MPL_AUX_NA_PARAM(State)
  23. , typename BOOST_MPL_AUX_NA_PARAM(BackwardOp)
  24. , typename ForwardOp = arg<1>
  25. >
  26. struct reverse_fold
  27. {
  28. typedef typename aux::reverse_fold_impl<
  29. ::boost::mpl::O1_size<Sequence>::value
  30. , typename begin<Sequence>::type
  31. , typename end<Sequence>::type
  32. , State
  33. , BackwardOp
  34. , ForwardOp
  35. >::state type;
  36. BOOST_MPL_AUX_LAMBDA_SUPPORT(3,reverse_fold,(Sequence,State,BackwardOp))
  37. };
  38. BOOST_MPL_AUX_NA_SPEC(3, reverse_fold)
  39. }}
  40. #endif // BOOST_MPL_REVERSE_FOLD_HPP_INCLUDED