std::vector
-like API, f.e. value_type pop_back_get ( )
and some 'unsafe' stuff, likely to be frowned upon, but they save cycles, we take the learning wheels of now;std::realloc
and friends, std::allocator
s (the main reason I started this project);std::malloc
or std::realloc` is implemented, if you run out of memory, close FireFox or head of to the shop to buy some DIMM's;std::trivially_copyable
);#define small char
and a useful one for Clang/LLVM;std::uint8_t
: 23 (15);std::uint16_t
: 11 ( 7);std::uint32_t
: 5 ( 3);std::uint64_t
: 2 ( 1);sizeof ( value_type )
<= 128b : 1 (no SVO);sizeof ( value_type )
> 128b : no SVO (no SVO);Small Vector Optimization Caveat: not allowed by the standard (23.2.1/p10/b6):
"Unless otherwise specified ...
no swap()
function invalidates any references, pointers, or
iterators referring to the elements of the containers being swapped."
So I specify otherwise, std::swap ( value_type & a, value_type & b )
has not been overloaded and swap ( podder & a, podder & b )
lives in the pdr
namespace;
std::less<your_type>
and std::greater<your_type>
for your value_type
, and provide an operator == ( your_class & rhs )
if non-trivial comparison is required;std::uint32_t
or std::uint64_t
;emplace_back()
with small vectors up to 256 values of std::uint8_t
and std::uint16_t
indicates a speedup of 35-40% as compared to the MSVC std::vector
. I have not yet looked at things to optimize or bottle-necks, so looks promising.podder
is a header only library, with no dependencies other than the STL.