diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-18 21:43:44 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-18 21:43:44 -0500 |
commit | e94db4695e236b42ae1be44b2605075161d5144f (patch) | |
tree | ada1a0442abdd08375df7f9a8f9cd50924e0840a /include/fud_span.hpp | |
parent | 8249b28bea29e8ce17eac12776a60ec3f9e47176 (diff) |
Add temporary work for formatting.
Diffstat (limited to 'include/fud_span.hpp')
-rw-r--r-- | include/fud_span.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/fud_span.hpp b/include/fud_span.hpp index e8c5704..cc693f8 100644 --- a/include/fud_span.hpp +++ b/include/fud_span.hpp @@ -43,6 +43,22 @@ struct Span { return output; } + template <typename U> + static Span make(Array<U, Size>& array) { + static_assert(std::convertible_to<U, T>); + Span<T, Size> output{}; + output.m_data = array.data(); + return output; + } + + template <size_t ArraySize> + static Span makeCStringBuffer(Array<T, ArraySize>& array) { + static_assert(ArraySize > Size); + Span<T, Size> output{}; + output.m_data = array.data(); + return output; + } + T* m_data; [[nodiscard]] constexpr size_t size() const |