cpp/algorithm/adjacent difference

If is not empty, computes the differences between the second and the first of each adjacent pair of its elements and writes the differences to the range beginning at. An unmodified copy of is written to. Overloads use  to calculate the differences, overloads  use the given binary function.

Equivalent operation for overload, if is not empty, uses the accumulator  to store the value to be subtracted:

Equivalent operation for overload, if is not empty:

If invalidates any iterator (including any of the end iterators) or modify any elements of the ranges involved, the behavior is undefined.

For overloads, if is not , the behavior is undefined.

Return value
Iterator to the element past the last element written, or if  is empty.

Complexity
Given as : @1,2@ exactly applications of @3,4@ exactly  applications of the binary function