1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-17 23:56:05 +02:00
Beef/BeefLibs/corlib/src/Pointer.bf
2020-06-05 07:23:46 -07:00

41 lines
614 B
Beef

namespace System
{
[AlwaysInclude]
struct Pointer : IHashable
{
void* mVal;
public int GetHashCode()
{
return (int)mVal;
}
[AlwaysInclude]
Object GetBoxed()
{
return new box this;
}
public override void ToString(String strBuffer)
{
strBuffer.AppendF("0x{0:A}", (uint)(void*)mVal);
}
}
struct Pointer<T> : IHashable
{
T* mVal;
public int GetHashCode()
{
return (int)(void*)mVal;
}
public override void ToString(String strBuffer)
{
strBuffer.Append("(");
typeof(T).GetFullName(strBuffer);
strBuffer.AppendF("*)0x{0:A}", (uint)(void*)mVal);
}
}
}