ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lang::IsAllocator Concept Reference

Description:

A concept to identify types that satisfy the interface documented with prototype class Allocator.
In fact, all methods which are defined in the non-existing class Allocator (which is purely living in the documentation to define what an allocator needs to provide) are tested with this concept. This way, its use verifies likewise the due implementation of (custom) allocators.

Template Parameters
TThe type to be tested.

Definition at line 480 of file allocation.inl.

Concept definition

template<typename T>
requires(T obj, size_t& size, size_t alignment, size_t oldSize, void* mem) {
typename T::ChainedAllocator;
{ T::MIN_ALIGNMENT } -> std::convertible_to<size_t>;
{ T::MAX_ALIGNMENT } -> std::convertible_to<size_t>;
{ obj.allocate (size, alignment) } -> std::same_as<void*>;
{ obj.reallocate( mem, oldSize, size, alignment ) } -> std::same_as<void*>;
{ obj.free (mem, size) } -> std::same_as<void>;
{ obj.operator()() } -> std::same_as<AllocatorInterface<T>>;
{ obj.allowsMemSplit() } -> std::convertible_to<bool>;
{ obj.DbgName } -> std::convertible_to<const char*>;
{ obj.dbgAcknowledgeIncreasedAllocSize(mem, size) } -> std::same_as<void>;
{ obj.dbgCheckMemory(mem, size) } -> std::same_as<void>;
}