diff options
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) { |