mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
19 lines
452 B
C
19 lines
452 B
C
|
#ifndef GMQCC_ALGO_HDR
|
||
|
#define GMQCC_ALGO_HDR
|
||
|
|
||
|
namespace algo {
|
||
|
|
||
|
template<typename ITER>
|
||
|
void shiftback(ITER element, ITER end) {
|
||
|
//typename ITER::value_type backup(move(*element)); // hold the element
|
||
|
typename std::remove_reference<decltype(*element)>::type backup(move(*element)); // hold the element
|
||
|
ITER p = element++;
|
||
|
for (; element != end; p = element++)
|
||
|
*p = move(*element);
|
||
|
*p = move(backup);
|
||
|
}
|
||
|
|
||
|
} // ::algo
|
||
|
|
||
|
#endif
|