xtypes icon indicating copy to clipboard operation
xtypes copied to clipboard

SIGABRT when directly accessing value of float from member

Open russkel opened this issue 2 years ago • 2 comments

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.

russkel avatar Jul 29 '22 00:07 russkel