iter_fold.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef BOOST_MPL_ITER_FOLD_HPP_INCLUDED
  2. #define BOOST_MPL_ITER_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/lambda.hpp>
  17. #include <boost/mpl/aux_/iter_fold_impl.hpp>
  18. #include <boost/mpl/aux_/na_spec.hpp>
  19. #include <boost/mpl/aux_/lambda_support.hpp>
  20. namespace boost { namespace mpl {
  21. template<
  22. typename BOOST_MPL_AUX_NA_PARAM(Sequence)
  23. , typename BOOST_MPL_AUX_NA_PARAM(State)
  24. , typename BOOST_MPL_AUX_NA_PARAM(ForwardOp)
  25. >
  26. struct iter_fold
  27. {
  28. typedef typename aux::iter_fold_impl<
  29. ::boost::mpl::O1_size<Sequence>::value
  30. , typename begin<Sequence>::type
  31. , typename end<Sequence>::type
  32. , State
  33. , typename lambda<ForwardOp>::type
  34. >::state type;
  35. BOOST_MPL_AUX_LAMBDA_SUPPORT(3,iter_fold,(Sequence,State,ForwardOp))
  36. };
  37. BOOST_MPL_AUX_NA_SPEC(3, iter_fold)
  38. }}
  39. #endif // BOOST_MPL_ITER_FOLD_HPP_INCLUDED