Add Span<T> support for scripting fields
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
/// Universal representation of a contiguous region of arbitrary memory.
|
||||
/// </summary>
|
||||
template<typename T>
|
||||
class Span
|
||||
API_CLASS(InBuild) class Span
|
||||
{
|
||||
protected:
|
||||
T* _data;
|
||||
|
||||
@@ -499,8 +499,8 @@ namespace MUtils
|
||||
/// </summary>
|
||||
/// <param name="data">The native array object.</param>
|
||||
/// <returns>The output array pointer and size.</returns>
|
||||
template<typename T>
|
||||
FORCE_INLINE Span<T> ToSpan(const Array<T>& data)
|
||||
template<typename T, typename AllocationType = HeapAllocation>
|
||||
FORCE_INLINE Span<T> ToSpan(const Array<T, AllocationType>& data)
|
||||
{
|
||||
return Span<T>(data.Get(), data.Count());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user