Make Span compatible with std::Container Needed this to play nice with one of the triangulation libraries I'm experimenting with (so I don't have to make vectors and/or copy data around). Diffs= d56be39f4 Make Span compatible with std::Container
diff --git a/.rive_head b/.rive_head index 01d41b0..a229925 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -758647ef64eb80195b5c7678671b254545491b42 +d56be39f44ce9d21121b088bcfc09b19ef3a1832
diff --git a/include/rive/span.hpp b/include/rive/span.hpp index c7e867b..ac899f4 100644 --- a/include/rive/span.hpp +++ b/include/rive/span.hpp
@@ -58,6 +58,16 @@ assert(size <= m_Size - offset); return {m_Ptr + offset, size}; } + + // Makes rive::Span std::Container compatible + // https://en.cppreference.com/w/cpp/named_req/Container + typedef typename std::remove_cv<T>::type value_type; + typedef T& reference; + typedef T const& const_reference; + typedef T* iterator; + typedef T const* const_iterator; + typedef std::ptrdiff_t difference_type; + typedef size_t size_type; }; template <typename Container>