pfr
pfr copied to clipboard
A small difference between `boost::pfr::get` and `std::get`
As we know, std::get overloads for a std::tuple can't return values, it always returns a reference(https://en.cppreference.com/w/cpp/utility/tuple/get).
This library shows itself as "tuple-like interface" and i suppose that boost::pfr::get must be fit to std::get in every detail.
But i find that boost::pfr::get in some cases can return a value, and make a copy: https://godbolt.org/z/1GWaqsah4
Can we fix it? Or is it better not to touch it, to prevent a breaking change?
Looks like a bug. Could you please fix it and transform the godbolt snippet into a test?
Looks like a bug. Could you please fix it and transform the godbolt snippet into a test?
Ok. I will fix it in the nearest future.
yet more in msvc: https://godbolt.org/z/rjEcdqssK it also spoils const references.