boostorg / boostorg/pfr

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

Open
#186 2 comments 0 reactions 0 assignees View on GitHub
compiler-or-standard-limitation
Dominant language
C++
Stars
1.5k
Forks
176
Avg merge
5d 21h
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.