Add ToSpan from 24c03c0e4b
This commit is contained in:
@@ -115,6 +115,12 @@ inline Span<T> ToSpan(const T* ptr, int32 length)
|
||||
return Span<T>(ptr, length);
|
||||
}
|
||||
|
||||
template<typename T, typename U = T, typename AllocationType = HeapAllocation>
|
||||
inline Span<U> ToSpan(const Array<T, AllocationType>& data)
|
||||
{
|
||||
return Span<U>((U*)data.Get(), data.Count());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline bool SpanContains(const Span<T> span, const T& value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user