1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

First row might still be ragged if multi dimensional. attrExists() doesn't throw, but easier to wrap in try ... catch than to explain in comment.

This commit is contained in:
Michael Marshall 2021-05-22 04:34:32 +01:00
parent 244b4aa07f
commit 9b73dacf50
2 changed files with 5 additions and 3 deletions

View File

@ -291,8 +291,10 @@ namespace Grid
::H5::Exception::getAutoPrint(h5at, &f5at_p); ::H5::Exception::getAutoPrint(h5at, &f5at_p);
::H5::Exception::dontPrint(); ::H5::Exception::dontPrint();
try { try {
push(s); push(s); // This is what might throw
bRagged = group_.attrExists(HDF5_GRID_GUARD "vector_size"); try {
bRagged = group_.attrExists(HDF5_GRID_GUARD "vector_size");
} catch(...) {}
pop(); pop();
} catch(...) {} } catch(...) {}
::H5::Exception::setAutoPrint(h5at, f5at_p); ::H5::Exception::setAutoPrint(h5at, f5at_p);

View File

@ -469,7 +469,7 @@ namespace Grid {
bool isFlat(const std::vector<std::vector<T>> &v) bool isFlat(const std::vector<std::vector<T>> &v)
{ {
// Make sure all of my rows are the same size // Make sure all of my rows are the same size
for (std::size_t i = 1; i < v.size(); ++i) for (std::size_t i = 0; i < v.size(); ++i)
{ {
if (v[i].size() != v[0].size() || !isFlat(v[i])) if (v[i].size() != v[0].size() || !isFlat(v[i]))
{ {