Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions algorithms_task_6/student/include/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ void insert_to_sorted(Sequence& target, const FwIt sourceBegin, const FwIt sourc
static_assert(std::is_const<typename std::remove_reference<
typename std::iterator_traits<FwIt>::reference>::type>::value,
"FwIt must point to const data");

for (auto it = sourceBegin; it != sourceEnd; ++it) {
target.insert(std::upper_bound(target.begin(), target.end(), *it), *it);
}
}