xtypes
xtypes copied to clipboard
SIGABRT when directly accessing value of float from member
I am compiling using C++20 on GCC 11:
Simple Structure definition:
StructType msg("Msg");
msg.add_member("latitude", primitive_type<float>());
msg.add_member("longitude", primitive_type<float>());
This is inside a Catch2 test case:
// Works
REQUIRE(msg["latitude"].value<float>() == Approx(-11.11293));
// SIGABRT
REQUIRE(msg["latitude"] == Approx(-11.11293));
I believe this should error at compile time if it doesn't know what the return type is going to be.