#pragma once namespace floormat::impl_handle { template struct Handle; template struct Item; template class Page; template class Pool; template struct Handle final { uint32_t index = (uint32_t)-1; uint32_t counter = 0; #if 0 using Obj = OBJ; static constexpr auto PageSize = PAGE_SIZE; #endif const OBJ& get() const; OBJ& get(); bool operator==(const Handle& other) const noexcept; explicit operator bool() const noexcept; private: static Item& get_from_pool(uint32_t index, uint32_t counter); }; } // namespace floormat::impl_handle namespace floormat { template using handle = struct impl_handle::Handle; } // namespace floormat