From 19abcac32009d58450d80add39c5b1d5e7d8a993 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Jul 2024 22:14:44 +0200 Subject: w --- src/handle.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/handle.hpp') diff --git a/src/handle.hpp b/src/handle.hpp index 7620e69b..89c1c480 100644 --- a/src/handle.hpp +++ b/src/handle.hpp @@ -2,11 +2,23 @@ #include "handle-fwd.hpp" #include "compat/assert.hpp" -namespace floormat::Handle { +namespace floormat::impl_handle { +template +bool Handle::operator==(const Handle& other) const noexcept +{ + bool ret = index == other.index; + fm_debug_assert(!ret || counter == other.counter); + return ret; +} +template +Handle::operator bool() const noexcept +{ + return index != (uint32_t)-1; +} -} // namespace floormat::Handle +} // namespace floormat::impl_handle namespace floormat { -- cgit v1.2.3