1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00: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::dontPrint();
try {
push(s);
bRagged = group_.attrExists(HDF5_GRID_GUARD "vector_size");
push(s); // This is what might throw
try {
bRagged = group_.attrExists(HDF5_GRID_GUARD "vector_size");
} catch(...) {}
pop();
} catch(...) {}
::H5::Exception::setAutoPrint(h5at, f5at_p);

View File

@ -469,7 +469,7 @@ namespace Grid {
bool isFlat(const std::vector<std::vector<T>> &v)
{
// 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]))
{