Base class of data structures with linear memory usage. More...
#include <tpie/util.h>
Inherited by tpie::internal_stack_vector_base< T, child_t >.
Static Public Member Functions | |
| static constexpr memory_size_type | memory_usage (memory_size_type size) noexcept |
| Return the number of bytes required to create a data structure supporting a given number of elements. More... | |
| static constexpr memory_size_type | memory_fits (memory_size_type memory) noexcept |
| Return the maximum number of elements that can be contained in in the structure when it is allowed to fill a given number of bytes. More... | |
| static constexpr linear_memory_usage | memory_usage () noexcept |
Base class of data structures with linear memory usage.
Uses CRTP to defer the definition of memory_coefficient and memory_overhead which must be implemented in the subclass.
Defines two static methods, memory_usage and memory_fits, that determine the amount of memory used and the number of items for a given memory amount, respectively.
|
inlinestaticconstexprnoexcept |
Return the maximum number of elements that can be contained in in the structure when it is allowed to fill a given number of bytes.
| memory | The number of bytes the structure is allowed to occupy |
|
inlinestaticconstexprnoexcept |
Return the number of bytes required to create a data structure supporting a given number of elements.
| size | The number of elements to support |