Commit fdfa17fe authored by Quentin Khan's avatar Quentin Khan

Fix memory allocation with normal allocator

The sub-vector tuple was not updated correctly.
parent a4468312
#ifndef VARIADIC_CONTAINER
#define VARIADIC_CONTAINER
#include <cassert>
#include <initializer_list>
#include <limits>
#include <memory>
......@@ -600,8 +601,8 @@ private:
*/
template<size_type I, size_type J, size_type... Is>
void set_data_tuple(char*& data_ptr, pointer_tuple& data_tuple, const size_type& data_capacity) {
data_ptr += sizeof(typename std::tuple_element<I, pointer_tuple>::type) * data_capacity;
assert(I != 0 || ((char*)std::get<0>(data_tuple)) == data_ptr);
data_ptr += sizeof(typename std::tuple_element<I, value_type>::type) * data_capacity;
std::get<J>(data_tuple) = reinterpret_cast<
typename std::tuple_element<J, pointer_tuple>::type>(data_ptr);
set_data_tuple<J, Is...>(data_ptr, data_tuple, data_capacity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment