From 64bb4225138e31e5c45e099ed6c185afe770b8c2 Mon Sep 17 00:00:00 2001 From: MarianVJ Date: Sat, 1 Apr 2023 10:05:28 +0200 Subject: [PATCH] First Commit --- algorithms_task_3/student/include/impl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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