forked from lix-project/lix
eldritch horrors
d4c738fe4c
(cherry picked from commit c62c21e29af20f1c14a59ab37d7a25dd0b70f69e)
Change-Id: Id4ea2fc33b0874b2f1f2a32cabcbeb0afa26808f
48 lines
607 B
C++
48 lines
607 B
C++
#pragma once
|
|
|
|
#include <cinttypes>
|
|
|
|
namespace nix {
|
|
|
|
class PosIdx
|
|
{
|
|
friend class PosTable;
|
|
|
|
private:
|
|
uint32_t id;
|
|
|
|
explicit PosIdx(uint32_t id)
|
|
: id(id)
|
|
{
|
|
}
|
|
|
|
public:
|
|
PosIdx()
|
|
: id(0)
|
|
{
|
|
}
|
|
|
|
explicit operator bool() const
|
|
{
|
|
return id > 0;
|
|
}
|
|
|
|
bool operator<(const PosIdx other) const
|
|
{
|
|
return id < other.id;
|
|
}
|
|
|
|
bool operator==(const PosIdx other) const
|
|
{
|
|
return id == other.id;
|
|
}
|
|
|
|
bool operator!=(const PosIdx other) const
|
|
{
|
|
return id != other.id;
|
|
}
|
|
};
|
|
|
|
inline PosIdx noPos = {};
|
|
|
|
}
|