From 6fa87ec35f9ee8cd65cfdcb16c31af6dff7911d2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 2 May 2022 20:55:21 +0300 Subject: Autocommit at 02.05.2022 @ 20:55 --- src/.!lazygit.swo | Bin 24576 -> 24576 bytes src/List/List.cpp | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/.!lazygit.swo b/src/.!lazygit.swo index 7fb9838..510dcb8 100644 Binary files a/src/.!lazygit.swo and b/src/.!lazygit.swo differ diff --git a/src/List/List.cpp b/src/List/List.cpp index f65cbba..617bbcf 100644 --- a/src/List/List.cpp +++ b/src/List/List.cpp @@ -42,7 +42,10 @@ void List::add(const T& element) { } template -bool List::insertAt(const T& element) { +bool List::insertAt(const T& element, unsigned index) { + if (index >= count) + return add(element); + } -- cgit v1.3.1-23-gd82d