mirror of https://github.com/CGAL/cgal
Use std::size_t in ID
This commit is contained in:
parent
6eaeb7a148
commit
cd30d109fe
|
|
@ -29,14 +29,11 @@ namespace internal {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct ID {
|
struct ID {
|
||||||
public:
|
public:
|
||||||
using IDType = uint32_t;
|
using IDType = std::size_t;
|
||||||
static constexpr IDType invalid_value = (std::numeric_limits<IDType>::max)();
|
static constexpr IDType invalid_value = (std::numeric_limits<IDType>::max)();
|
||||||
|
|
||||||
ID(IDType id = invalid_value) : id(id) {}
|
ID(IDType id = invalid_value) : id(id) {}
|
||||||
|
|
||||||
ID(int sid) : id(static_cast<IDType>(sid)) { assert(sid < static_cast<int>(invalid_value)); }
|
|
||||||
ID(std::size_t sid) : id(static_cast<IDType>(sid)) { assert(sid < static_cast<std::size_t>(invalid_value)); }
|
|
||||||
|
|
||||||
operator IDType() const { return id; }
|
operator IDType() const { return id; }
|
||||||
IDType operator+(ID<T> other) const { return id + other.id; }
|
IDType operator+(ID<T> other) const { return id + other.id; }
|
||||||
IDType operator+(int offset) const { return id + offset; }
|
IDType operator+(int offset) const { return id + offset; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue