1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 08:58:00 +02:00

Support for operators with ref parameters, sized array->span

This commit is contained in:
Brian Fiete 2021-01-26 11:06:17 -08:00
parent 5c05b15b37
commit 1e52dce7c4
9 changed files with 183 additions and 31 deletions

View file

@ -20,11 +20,23 @@ namespace System
return val.mVal;
}
public implicit static operator Span<T> (ref Self val)
{
#unwarn
return .(&val.mVal, CSize);
}
public override void ToString(String strBuffer) mut
{
if (typeof(T) == typeof(char8))
{
strBuffer.Append((char8*)&mVal, CSize);
int len = 0;
for (; len < CSize; len++)
{
if (mVal[len] == default)
break;
}
strBuffer.Append((char8*)&mVal, len);
return;
}
@ -87,7 +99,7 @@ namespace System
get
{
return mIndex - 1;
}
}
}
public Result<T> GetNext() mut