This commit is contained in:
2024-01-30 18:06:16 -08:00
parent 4a4116da45
commit 174ae36894
5 changed files with 73 additions and 7 deletions

View File

@@ -142,10 +142,10 @@ namespace ehs
Type* result = new Type[hierarchySize + 1];
result[0] = newType;
result[0] = (Type&&)newType;
for (UInt_64 i = 1; i < hierarchySize; i++)
result[i] = hierarchy[i];
for (UInt_64 i = 0; i < hierarchySize; i++)
result[i + 1] = (Type&&)hierarchy[i];
hierarchySize++;
delete[] hierarchy;

View File

@@ -12,6 +12,47 @@ namespace ehs
{
}
Type::Type(Type&& type) noexcept
: size(type.size), id(type.id), hashId(type.hashId)
{
type.size = 0;
type.id = nullptr;
type.hashId = 0;
}
Type::Type(const Type& type)
: size(type.size), id(type.id), hashId(type.hashId)
{
}
Type& Type::operator=(Type&& type) noexcept
{
if (this == &type)
return *this;
size = type.size;
id = type.id;
hashId = type.hashId;
type.size = 0;
type.id = nullptr;
type.hashId = 0;
return *this;
}
Type& Type::operator=(const Type& type)
{
if (this == &type)
return *this;
size = type.size;
id = type.id;
hashId = type.hashId;
return *this;
}
bool Type::operator==(const Type& type) const
{
return hashId == type.hashId;