BAN: Add basic GUID data structure

This commit is contained in:
Bananymous 2023-11-21 15:11:50 +02:00
parent d08e876319
commit 19ed0cb9bf
1 changed files with 25 additions and 0 deletions

25
BAN/include/BAN/GUID.h Normal file
View File

@ -0,0 +1,25 @@
#pragma once
#include <BAN/Optional.h>
#include <BAN/StringView.h>
#include <string.h>
namespace BAN
{
struct GUID
{
uint32_t component1 { 0 };
uint16_t component2 { 0 };
uint16_t component3 { 0 };
uint8_t component45[8] { };
bool operator==(const GUID& other) const
{
return memcmp(this, &other, sizeof(GUID)) == 0;
}
};
static_assert(sizeof(GUID) == 16);
}