diff options
Diffstat (limited to 'include/fud_span.hpp')
-rw-r--r-- | include/fud_span.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/fud_span.hpp b/include/fud_span.hpp index 5b8497e..ed4bcc7 100644 --- a/include/fud_span.hpp +++ b/include/fud_span.hpp @@ -18,7 +18,6 @@ #ifndef FUD_SPAN_HPP #define FUD_SPAN_HPP -#include "fud_array.hpp" #include "fud_result.hpp" #include "fud_status.hpp" @@ -27,11 +26,17 @@ namespace fud { +template <typename T, size_t Size> +struct Array; + template <typename T, size_t Size = SIZE_MAX> struct Span { static_assert(Size > 0); using ValueType = T; + T* m_data; + const size_t m_size; + static Span make(Array<T, Size>& array) { Span<T, Size> output{array.data(), Size}; @@ -89,9 +94,6 @@ struct Span { return output; } - T* m_data; - const size_t m_size; - [[nodiscard]] constexpr size_t size() const { if constexpr (Size < SIZE_MAX) { |