KTL
ktl::null_allocator Class Reference

An allocator which does nothing. Useful for debugging composite allocators, like ensuring a specific path in a composite allocator is not used. More...

#include <null_allocator.h>

Public Member Functions

 null_allocator () noexcept=default
 
 null_allocator (const null_allocator &) noexcept=default
 
 null_allocator (null_allocator &&) noexcept=default
 
null_allocatoroperator= (const null_allocator &) noexcept=default
 
null_allocatoroperator= (null_allocator &&) noexcept=default
 
bool operator== (const null_allocator &rhs) const noexcept
 
bool operator!= (const null_allocator &rhs) const noexcept
 
void * allocate (size_t n) noexcept
 
void deallocate (void *p, size_t n) noexcept
 
bool owns (void *p) const noexcept
 

Detailed Description

An allocator which does nothing. Useful for debugging composite allocators, like ensuring a specific path in a composite allocator is not used.

Constructor & Destructor Documentation

◆ null_allocator() [1/3]

ktl::null_allocator::null_allocator ( )
defaultnoexcept

◆ null_allocator() [2/3]

ktl::null_allocator::null_allocator ( const null_allocator )
defaultnoexcept

◆ null_allocator() [3/3]

ktl::null_allocator::null_allocator ( null_allocator &&  )
defaultnoexcept

Member Function Documentation

◆ allocate()

void* ktl::null_allocator::allocate ( size_t  n)
inlinenoexcept

◆ deallocate()

void ktl::null_allocator::deallocate ( void *  p,
size_t  n 
)
inlinenoexcept

◆ operator!=()

bool ktl::null_allocator::operator!= ( const null_allocator rhs) const
inlinenoexcept

◆ operator=() [1/2]

null_allocator& ktl::null_allocator::operator= ( const null_allocator )
defaultnoexcept

◆ operator=() [2/2]

null_allocator& ktl::null_allocator::operator= ( null_allocator &&  )
defaultnoexcept

◆ operator==()

bool ktl::null_allocator::operator== ( const null_allocator rhs) const
inlinenoexcept

◆ owns()

bool ktl::null_allocator::owns ( void *  p) const
inlinenoexcept

The documentation for this class was generated from the following file: