diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-21 12:49:43 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-21 12:49:43 -0500 |
commit | b2dbcb55e2832c373fecb4033a3ed77e5dbc77aa (patch) | |
tree | 1f294fcf1d85a02db86de3eea2b03393fd89ca5a /include/fud_memory.hpp | |
parent | 6a27a2a4032e88fa9154ef0f0741edc584f7a701 (diff) |
Add vector and option.
Diffstat (limited to 'include/fud_memory.hpp')
-rw-r--r-- | include/fud_memory.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/fud_memory.hpp b/include/fud_memory.hpp index 97328a9..6ce6312 100644 --- a/include/fud_memory.hpp +++ b/include/fud_memory.hpp @@ -57,6 +57,22 @@ constexpr void setMemory(Container<T, Size>& container, const T& value) } } +template <template <class, size_t> class Container, typename T, size_t Size> +constexpr void setMemory(Container<T, Size>& container, T&& value) +{ + for (auto& elt : container) { + elt = value; + } +} + +template <template <size_t> class Container, typename T, size_t Size> +constexpr void setMemory(Container<Size>& container, T&& value) +{ + for (auto& elt : container) { + elt = value; + } +} + template <size_t Count, typename T, typename U> void copyMem(T& destination, const U& source) { |