Skip to content

PFR does not work with non-copyable aggregates on MSVC 17.10 #186

@Kaiyakha

Description

@Kaiyakha

I was surprised to find out PFR fails to compile the following non-copyable aggregate Entity with MSVC 17.10:

struct Field final {
  Field() = default;
  Field(const Field&) = delete;
};

struct Entity final {
  Field x;
};

Entity e;

boost::pfr::get<0>(e);

The output says the tuple index is out of bounds. I also tried pfr::for_each_field which resulted in that scary If there is no other failed static asserts then something went wrong. My colleagues use Clang and they say the code above works just fine. The latest GCC also didn't show any issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler-or-standard-limitationThere is no known way to solve this issue, as it it either a compiler or C++ limitation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions