pfr icon indicating copy to clipboard operation
pfr copied to clipboard

std::tuple like methods for user defined types without any macro or boilerplate code

Results 68 pfr issues
Sort by recently updated
recently updated
newest added

There's another library called `repr` which claims to handle C arrays properly: https://godbolt.org/z/vbz639n4d. Can this solution be used to handle C arrays properly in boost pfr? Here's a link to...

help wanted

Hey, I have some pybinded structs, that have a lot of repeating boilerplate: ```cpp struct MyStruct { int x; char c; }; py::class_< MyStruct >(module, "MyStruct") .def_readonly("x", &MyStruct::x) .def_readonly("c", &MyStruct::c);...

help wanted

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;...

compiler-or-standard-limitation

…mode and that is able to return prvalues Looks like `static_cast(*ptr)` to prvalue now fails on clang in C++26. Changed it to function pointer call Fixes: https://github.com/boostorg/pfr/issues/208 Probably fixes: https://github.com/boostorg/pfr/issues/173,...

## Setup * compiler: clang-19 * c++ standard: 26 * libc++: libc++, abi v2, patched (without constexpr dtor for unique_ptr) * pfr ``` #define BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE 1 #include #include #include static_assert(BOOST_PFR_USE_CPP17);...

Apparently, the same tricks used here can also be used for reflection on enums, as evidenced by other libraries, for example https://github.com/Neargye/magic_enum Adding enum support should therefore be straightforward.

Tested with clang-21 HEAD which supports destructuring into a pack and pack indexing

The following code is not compiled: ```c++ # include # include # include ... struct B { std::optional a; } f; boost::pfr::for_each_field(f, [&](const auto& field, auto index) { using type...

duplicate
compiler-or-standard-limitation