if (elem != nullptr && elem->copy_fn.type_copy_fn != MPI_NULL_COPY_FN) {
*ret = elem->copy_fn.type_copy_fn(datatype, (*it).first, nullptr, (*it).second, &value_out, &flag);
if (*ret != MPI_SUCCESS) {
if (elem != nullptr && elem->copy_fn.type_copy_fn != MPI_NULL_COPY_FN) {
*ret = elem->copy_fn.type_copy_fn(datatype, (*it).first, nullptr, (*it).second, &value_out, &flag);
if (*ret != MPI_SUCCESS) {