Add fill() function to std::algorithm

This commit is contained in:
EnderIce2 2024-02-10 05:41:42 +02:00
parent 3374eac741
commit 25d17a8831
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -103,4 +103,11 @@ namespace std
*first++ = std::move(*i); *first++ = std::move(*i);
return first; return first;
} }
template <class ForwardIt, class T>
void fill(ForwardIt first, ForwardIt last, const T &value)
{
for (; first != last; ++first)
*first = value;
}
} }