4#include "../Foundation/PrimitiveTypes.h"
5#include "ContainersExport.h"
8template <
typename TagType,
typename IDType =
int32_t, IDType InvalidValue = -1>
18template <
typename TagType,
typename IDType, IDType Inval
idValue>
21 using NumericType = IDType;
24 constexpr StrongID() : identifier(InvalidValue) {}
26 explicit constexpr StrongID(IDType value) : identifier(value) {}
28 [[nodiscard]]
constexpr bool operator==(
StrongID other)
const {
return identifier == other.identifier; }
30 [[nodiscard]]
constexpr bool operator!=(
StrongID other)
const {
return identifier != other.identifier; }
33 [[nodiscard]]
constexpr bool isValid()
const {
return identifier != InvalidValue; }
39 template <
typename Container>
43 while (container.contains(test))
int int32_t
Platform independent (4) bytes signed int.
Definition PrimitiveTypes.h:37
Strongly typed ID (cannot be assigned incorrectly to another ID)
Definition StrongID.h:20
static constexpr StrongID generateUniqueKey(const Container &container)
Generates an unique StrongID for a given container.
Definition StrongID.h:40
constexpr bool isValid() const
Check if StrongID is valid.
Definition StrongID.h:33