- delete contents_;
- int ints[3] = {count, block_length, stride};
- contents_ = new Datatype_contents(MPI_COMBINER_VECTOR, 3, ints, 0, nullptr, 1, &old_type);
+ const std::array<int, 3> ints = {{count, block_length, stride}};
+ set_contents(MPI_COMBINER_VECTOR, 3, ints.data(), 0, nullptr, 1, &old_type);
+}
+
+int Type_Vector::clone(MPI_Datatype* type)
+{
+ *type = new Type_Vector(this->size(), this->lb(), this->ub(), this->flags(), this->block_count_, this->block_length_, this->block_stride_, this->old_type_);
+ (*type)->copy_attrs(this);
+ return MPI_SUCCESS;