You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HDF5 can't really read an unspecified DataType and then the user casts later and HighFive doesn't implement the feature you're looking for.
I suspect short term you might have to go for something like:
Get the datatype.
if statement with one branch per type.
In each branch read an std::vector<std::vector<T>> with T = int, ..., or std::string.
Copy everything into an std::vector<std::vector<std::variant<...>>>. Now that the return type is uniform across all branches of the if statement you could return it.
Longer term, supporting std::variant seems interesting since something similar has been requested before.
alkino
changed the title
support std::varaint for read function
support std::variant for read function
Feb 15, 2024
I am writing a generic H5 viewer, therefore I need to fetch data from dataset and casting the result at the end.
I tried
std::vector<std::vector<std::variant<int,float,double,std::string>>>
but it gives me this compilation error.my code:
error:
The text was updated successfully, but these errors were encountered: