Skip to content
Snippets Groups Projects
Commit b11f9d5f authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Allow empty array affectation to not build ItemValue

parent a9e6fe77
No related branches found
No related tags found
1 merge request!11Feature/mpi
...@@ -82,19 +82,21 @@ class ItemValue ...@@ -82,19 +82,21 @@ class ItemValue
or not std::is_const<DataType2>()), or not std::is_const<DataType2>()),
"Cannot assign ItemValue of const to ItemValue of non-const"); "Cannot assign ItemValue of const to ItemValue of non-const");
if (not m_is_built) {
perr() << "Cannot assign array of values to a non-built ItemValue\n";
std::exit(1);
}
if (m_values.size() != values.size()) { if (m_values.size() != values.size()) {
perr() << "Cannot assign an array of values of a different size\n"; perr() << "Cannot assign an array of values of a different size\n";
std::exit(1); std::exit(1);
} }
if (values.size() > 0) {
if (not m_is_built) {
perr() << "Cannot assign array of values to a non-built ItemValue\n";
std::exit(1);
}
m_values = values; m_values = values;
}
return *this; return *this;
} }
template <typename DataType2> template <typename DataType2>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment