Monotonic allocator for non-zero document ItemIds. More...
#include <clip.hpp>
Public Member Functions | |
| constexpr | ItemIdAllocator (std::uint64_t next=1) noexcept |
| Creates an allocator whose next successful result is next. | |
| runtime::Result< ItemId, ModelError > | allocate () noexcept |
| Returns the next identity and advances the allocator. | |
| constexpr std::uint64_t | next_value () const noexcept |
| Returns the numeric value that the next successful allocation uses. | |
Monotonic allocator for non-zero document ItemIds.
Allocation never wraps or reuses an identity; exhaustion is returned as a ModelError and leaves the allocator exhausted.
|
inlineexplicitconstexprnoexcept |
Creates an allocator whose next successful result is next.
Zero and UINT64_MAX construct an exhausted allocator.
|
noexcept |
Returns the next identity and advances the allocator.
|
inlineconstexprnoexcept |
Returns the numeric value that the next successful allocation uses.