Skip to content

SIGABRT when directly accessing value of float from member #110

@russkel

Description

@russkel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions