2 Copyright (c) Marshall Clow 2017.
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)
8 /// \file transform_exclusive_scan.hpp
10 /// \author Marshall Clow
12 #ifndef BOOST_ALGORITHM_TRANSFORM_EXCLUSIVE_SCAN_HPP
13 #define BOOST_ALGORITHM_TRANSFORM_EXCLUSIVE_SCAN_HPP
15 #include <functional> // for std::plus
16 #include <iterator> // for std::iterator_traits
18 #include <boost/config.hpp>
19 #include <boost/range/begin.hpp>
20 #include <boost/range/end.hpp>
21 #include <boost/range/value_type.hpp>
23 namespace boost { namespace algorithm {
25 template<class InputIterator, class OutputIterator, class T,
26 class BinaryOperation, class UnaryOperation>
27 OutputIterator transform_exclusive_scan(InputIterator first, InputIterator last,
28 OutputIterator result, T init,
29 BinaryOperation bOp, UnaryOperation uOp)
36 init = bOp(init, uOp(*first));
40 } while (++first != last);
45 }} // namespace boost and algorithm
47 #endif // BOOST_ALGORITHM_TRANSFORM_EXCLUSIVE_SCAN_HPP