Function dynmsg::get_vector_size

Function Documentation

size_t dynmsg::get_vector_size(const uint8_t *vector, size_t element_size)

Get the number of elements in/size of a vector given a pointer to it and its element size.

This uses some knowledge/assumption about the std::vector implementation. See the get_vector_size implementation for more info on how it works.

Note that std::vector<bool> is a special optimized std::vector<T> specialization and the “trick” used in get_vector_size() does not work.