So this is a completely over-engineered solution but this is a more C++11 version of what you have.
Code:
#include <array>
#include <memory>
#include <algorithm>
template <typename T>
auto grow_array(
T const* const old_data,
size_t const old_size,
size_t const new_size)
-> std::unique_ptr<T[]>
{
std::unique_ptr<T[]> data{new T[new_size]};
std::uninitialized_copy(old_data, old_data + old_size, data.get());
return data;
}
auto test(void) -> void
{
std::array<int, 3> const x{0, 1, 2};
auto data = grow_array(x.data(), x.size(), size_t{26});
}
godbolt
Compiled but not run.