diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/range.h | 6 | ||||
-rw-r--r-- | src/utils/types.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/utils/range.h b/src/utils/range.h index ce25298..e4ef12f 100644 --- a/src/utils/range.h +++ b/src/utils/range.h @@ -7,7 +7,7 @@ struct range { constexpr explicit range(u64 start, u64 end) : start{start}, end{end} { - assert(start < end); + assert(start <= end); } constexpr bool overlaps(range rhs) const { @@ -18,6 +18,10 @@ struct range { return start <= rhs.start && rhs.end <= end; } + constexpr bool operator==(range rhs) const { + return start == rhs.start && end == rhs.end; + } + u64 start; u64 end; }; diff --git a/src/utils/types.h b/src/utils/types.h index a13b8ef..4f824f6 100644 --- a/src/utils/types.h +++ b/src/utils/types.h @@ -3,6 +3,7 @@ #include <cstdint> +using u8 = std::uint8_t; using u32 = std::uint32_t; using u64 = std::uint64_t; |