Hello, small_vector seems to be ignoring stored_size option, and instead always using size_t. Reading documentation, it seems to me that this should not be the case. Am I missing something or is this a bug? Thank you for your time.
(tested on 1.91 release (GCC 16.1), based on changelog and github issues, this wasn't changed for 1.92)
minimal reproducible example:
#include <boost/container/small_vector.hpp>
#include <boost/container/vector.hpp>
#include <boost/container/options.hpp>
#include <iostream>
using namespace boost::container;
int main()
{
using vo = vector_options_t<stored_size<uint16_t>>;
using svo_16 = small_vector_options_t<stored_size<uint16_t>>;
using svo_32 = small_vector_options_t<stored_size<uint32_t>>;
using svo_64 = small_vector_options_t<stored_size<uint64_t>>;
// Expected sizeof(v1) == 16;
vector<int16_t, void, vo> v1;
// Expected sizeof(v2) == 16;
small_vector<int16_t, 2, void, svo_16> v2;
// Expected sizeof(v3) == 24;
small_vector<int16_t, 2, void, svo_32> v3;
// Expected sizeof(v4) == 32;
small_vector<int16_t, 2, void, svo_64> v4;
std::cout << sizeof(decltype(v1)) << "\n"; // OK Returns 16
std::cout << sizeof(decltype(v2)) << "\n"; // ERROR(?) Returns 32, expected 16
std::cout << sizeof(decltype(v3)) << "\n"; // ERROR(?) Returns 32, expected 24
std::cout << sizeof(decltype(v4)) << "\n"; // OK Returns 32
}
Hello,
small_vectorseems to be ignoringstored_sizeoption, and instead always usingsize_t. Reading documentation, it seems to me that this should not be the case. Am I missing something or is this a bug? Thank you for your time.(tested on 1.91 release (GCC 16.1), based on changelog and github issues, this wasn't changed for 1.92)
minimal reproducible example: