diff --git a/algorithms_task_3/student/include/impl.h b/algorithms_task_3/student/include/impl.h index 88411e96..eee1ee09 100644 --- a/algorithms_task_3/student/include/impl.h +++ b/algorithms_task_3/student/include/impl.h @@ -1,5 +1,5 @@ #pragma once - +#include /** @todo Implement right-shifting algorithm for bidirectional ranges * * BI - bidirectional iterator type @@ -13,4 +13,6 @@ * @note behavior is undefined if shift out of bounds */ template -BiIt shift_right_n(BiIt begin, BiIt end, typename BiIt::difference_type shift); +BiIt shift_right_n(BiIt begin, BiIt end, typename BiIt::difference_type shift) { + return std::move_backward(begin, end, std::next(end, shift)); +} \ No newline at end of file