message: Array: don't rely on copy constructor when resizing with default value
diff: @@ -699,7 +699,7 @@ public:
  "constructible. Use Array<T>::reserve() and emplace_back()"
  "instead.");
  const StackArray<IndexType, DIM> dims {static_cast<IndexType>(args)...};
  - resize(dims, true, T());
  + resize(dims, true);
  }
  /// \overload
  @@ -713,18 +713,18 @@ public:
  "constructible. Use Array<T>::reserve() and emplace_back()"
  "instead.");
  const StackArray<IndexType, DIM> dims {static_cast<IndexType>(args)...};
  - resize(dims, false, T());
  + resize(dims, false);
  }
  template <int Dims = DIM, typename Enable = std::enable_if_t<Dims == 1>>
  void resize(IndexType size, const T& value)
  {
  - resize({size}, true, value);
  + resize({size}, true, &value);
  }
  void resize(const StackArray<IndexType, DIM>& size, const T& value)
  {
  - resize(size, true, value);
  + resize(size, true, &value);
  }
  /*!
  @@ -804,11 +804,12 @@ protected:
  * \param [in] dims the number of elements to allocate in each dimension
  * \param [in] construct_with_values if true, sets new elements in the array
  * to a specified value
  - * \param [in] value the value to fill new elements in the array with
  + * \param [in] value pointer to the value to fill new elements in the array
  + * with. If null, will default-construct elements in place.
  */
  void resize(const StackArray<IndexType, DIM>& dims,
  bool construct_with_values,
  - const T& value);
  + const T* value = nullptr);
  /*!
  * \brief Make space for a subsequent insertion into the array.
  @@ -1274,7 +1275,7 @@ inline void Array<T, DIM, SPACE>::emplace_back(Args&&... args)
  template <typename T, int DIM, MemorySpace SPACE>
  inline void Array<T, DIM, SPACE>::resize(const StackArray<IndexType, DIM>& dims,
  bool construct_with_values,
  - const T& value)
  + const T* value)
  {
  assert(detail::allNonNegative(dims.m_data));
  const auto new_num_elements = detail::packProduct(dims.m_data);
  @@ -1291,12 +1292,23 @@ inline void Array<T, DIM, SPACE>::resize(const StackArray<IndexType, DIM>& dims,
  if(prev_num_elements < new_num_elements && construct_with_values)
  {
  - // Default-initialize the new elements
  + if(value)
  + {
  + // Copy-construct new elements with value
  OpHelper::fill(m_data,
  prev_num_elements,
  new_num_elements - prev_num_elements,
  m_allocator_id,
  - value);
  + *value);
  + }
  + else
  + {
  + // Default-initialize the new elements
  + OpHelper::init(m_data,
  + prev_num_elements,
  + new_num_elements - prev_num_elements,
  + m_allocator_id);
  + }
  }
  else if(prev_num_elements > new_num_elements)
  {
  