Home | Libraries | People | FAQ | More |
template< class SinglePassRange, class OutputIterator > OutputIterator adjacent_difference( const SinglePassRange& source_rng, OutputIterator out_it); template< class SinglePassRange, class OutputIterator, class BinaryOperation > OutputIterator adjacent_difference( const SinglePassRange& source_rng, OutputIterator out_it, BinaryOperation op);
adjacent_difference
calculates
the differences of adjacent_elements in rng
.
The first version of adjacent_difference
uses operator-()
to calculate the differences. The second version uses BinaryOperation
instead of operator-()
.
Defined in the header file boost/range/numeric.hpp
SinglePassRange
is
a model of the Single
Pass Range Concept.
OutputIterator
is
a model of the OutputIteratorConcept
.
x
and y
are objects of SinglePassRange
's value type, then
x -
y
is defined.
SinglePassRange
is convertible to a type in OutputIterator
's
set of value types.
x - y
is convertible to a type in OutputIterator
's
set of value types.
SinglePassRange
is
a model of the Single
Pass Range Concept.
OutputIterator
is
a model of the OutputIteratorConcept
.
BinaryOperation
is
a model of the BinaryFunctionConcept
.
SinglePassRange
is convertible to BinaryOperation
's
first and second argument types.
SinglePassRange
is convertible to a type in OutputIterator
's
set of value types.
BinaryOperation
is convertible to a type in OutputIterator
's
set of value types.
[result, result
+ distance(rng))
is a valid range.
Linear. If empty(rng)
then zero applications, otherwise distance(rng) - 1
applications are performed.