4#include "../Foundation/PrimitiveTypes.h"
7template <
typename TagType,
typename IDType =
int32_t, IDType InvalidValue = -1>
17template <
typename TagType,
typename IDType, IDType Inval
idValue>
20 using NumericType = IDType;
23 constexpr StrongID() : identifier(InvalidValue) {}
25 explicit constexpr StrongID(IDType value) : identifier(value) {}
27 [[nodiscard]]
constexpr bool operator==(
StrongID other)
const {
return identifier == other.identifier; }
29 [[nodiscard]]
constexpr bool operator!=(
StrongID other)
const {
return identifier != other.identifier; }
32 [[nodiscard]]
constexpr bool isValid()
const {
return identifier != InvalidValue; }
38 template <
typename Container>
42 while (container.contains(test))
int int32_t
Platform independent (4) bytes signed int.
Definition: PrimitiveTypes.h:46
Strongly typed ID (cannot be assigned incorrectly to another ID)
Definition: StrongID.h:19
constexpr static StrongID generateUniqueKey(const Container &container)
Generates an unique StrongID for a given container.
Definition: StrongID.h:39
constexpr bool isValid() const
Check if StrongID is valid.
Definition: StrongID.h:32