1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-18 16:10:26 +02:00
Beef/BeefLibs/corlib/src/SizedArray.bf

42 lines
602 B
Beef
Raw Normal View History

2019-08-23 11:56:54 -07:00
namespace System
{
[AlwaysInclude]
struct SizedArray<T, CSize> where CSize : const int
{
T[CSize] mVal;
public int Count
{
[Inline]
get
{
return CSize;
}
}
public explicit static operator T[CSize] (Self val)
{
return val.mVal;
}
public override void ToString(String strBuffer) mut
{
if (typeof(T) == typeof(char8))
{
strBuffer.Append((char8*)&mVal, CSize);
return;
}
strBuffer.Append('(');
for (int i < CSize)
{
if (i != 0)
strBuffer.Append(", ");
mVal[i].ToString(strBuffer);
}
strBuffer.Append(')');
}
}
}