Template Function sgpl::slide_n

Function Documentation

template<typename RandomIt>
RandomIt sgpl::slide_n(RandomIt first, RandomIt last, const int amount)

Slide a selected window over n positions.

Empty space is filled by shifting existing elements outside the window, like dragging and dropping a contiguous selection up or down a list.

Return

new position of selection window front

Parameters
  • first: front of sliding window

  • last: back of sliding window

  • amount: how far to slide, left if negative and right if positive

Template Parameters
  • RandomIt: random access iterator