Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 618 Bytes

adjacent_difference.md

File metadata and controls

19 lines (13 loc) · 618 Bytes

hal::adjacent_difference

Calculates the difference between each pair of consecutive elements, stores the result in the first element of the pair.

template <typename... Elements>
void adjacent_difference(Elements&&... elements);

The difference is found by subtracting the left element from the right element for each pair. The return type for operator-(...) has to be assignable to the first element of the pair. The last element in the pack remains unmodified.

hal::reverse::adjacent_difference(...)

✔️ Modifying Algorithm

Examples