pfr
pfr copied to clipboard
std::tuple like methods for user defined types without any macro or boilerplate code
https://godbolt.org/z/16Go1bYv3 In MSVC v19.24 it works
https://godbolt.org/z/jzbc938e6 The problem only showable in C++20. It's everything OK in C++17
MSVC implements mandatory copy elision in v16.29. I have expected that copy elision also enables reflecting aggregates that are neither copyable nor movable. Clang and GCC both successfully reflect such...
The tightest upper bound one can specify on the number of fields in a struct is `sizeof(type) * CHAR_BIT`. So this was previously used when performing a binary search for...
Hi all, thanks for great work. The problem I have with tie_from_structure is that it calls copy assignments instead of move assignments. I think I understand why it happens: you...
https://cppcoach.godbolt.org/z/Mocb7znYf Only only does it not allow to stream into std::ostream / std::stringstream but also makes it "not play nice with {fmt}". see https://github.com/fmtlib/fmt/issues/3245 in the meantime, how do I...
This code fails to compile with both clang and gcc trunk (but compiles with the latest MSVC): ```cpp #include #include #include struct optional_linked_list { int value; std::optional next; }; int...
Reproduce: ``` struct Foo { int x[2]; }; ``` gcc: 13.2.0 compile command: ` g++ -std=c++20 a.cpp -Ipath/to/boost` Expect: `expects(boost::pfr::tuple_size_v == 1);` Actual: `boost::pfr::tuple_size_v == 2` Workaround(might be problematic, but...
It's a common type that is an aggregate but with a C array as only member. Until something like #20 is implemented, it should be explicitly marked as non-reflectable.