qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::internal::best_size< _Size, fill8, fill16 > Struct Template Reference

Determines the optimal integer type for size storage based on max capacity. More...

#include <string.h>

Public Types

using type = std::size_t

Detailed Description

template<std::size_t _Size, bool fill8 = (_Size <= std::numeric_limits<uint8_t>::max()), bool fill16 = (_Size <= std::numeric_limits<uint16_t>::max())>
struct qb::internal::best_size< _Size, fill8, fill16 >

Determines the optimal integer type for size storage based on max capacity.

Selects the smallest possible unsigned integer type that can hold the size value, which helps minimize memory usage.

Template Parameters
_SizeMaximum size of the string + 1 (for null terminator)
fill8True if size fits in uint8_t
fill16True if size fits in uint16_t