From 25d17a88311743f520538c4d053d9abc8e780a04 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sat, 10 Feb 2024 05:41:42 +0200 Subject: [PATCH] Add fill() function to std::algorithm --- include_std/algorithm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include_std/algorithm b/include_std/algorithm index 4febbdd..85eb61b 100644 --- a/include_std/algorithm +++ b/include_std/algorithm @@ -103,4 +103,11 @@ namespace std *first++ = std::move(*i); return first; } + + template + void fill(ForwardIt first, ForwardIt last, const T &value) + { + for (; first != last; ++first) + *first = value; + } }