Initialize span from raw array extracted from https://github.com/rive-app/rive/pull/4169 Diffs= c1a6b2946 Initialize span from raw array
diff --git a/.rive_head b/.rive_head index ae0cfb9..b0494da 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -82de255b9de142d023036bafb340bf5f73e5ffbb +c1a6b2946685948fefae37ab17d74fcaea6d0d3f
diff --git a/include/rive/span.hpp b/include/rive/span.hpp index d5910a8..de21bbf 100644 --- a/include/rive/span.hpp +++ b/include/rive/span.hpp
@@ -32,6 +32,7 @@ constexpr Span(const Span&) = default; template <typename Container> constexpr Span(Container& c) : Span{std::data(c), std::size(c)} {} constexpr Span(std::initializer_list<T> il) : Span(std::data(il), std::size(il)) {} + template <size_t N> constexpr Span(T (&a)[N]) : Span(a, N) {} constexpr T& operator[](size_t index) const { assert(index < m_Size);
diff --git a/test/span_test.cpp b/test/span_test.cpp index c4f3f45..605c17e 100644 --- a/test/span_test.cpp +++ b/test/span_test.cpp
@@ -52,7 +52,9 @@ funcb({carray, 4}); int array[] = {1, 2, 3, 4}; + funca(array); funca({array, 4}); + funcb(array); funcb({array, 4}); std::vector<int> v;