Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A small difference between boost::pfr::get and std::get #102

Open
denzor200 opened this issue Aug 27, 2022 · 3 comments
Open

A small difference between boost::pfr::get and std::get #102

denzor200 opened this issue Aug 27, 2022 · 3 comments

Comments

@denzor200
Copy link
Contributor

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?

@apolukhin
Copy link
Member

Looks like a bug. Could you please fix it and transform the godbolt snippet into a test?

@denzor200
Copy link
Contributor Author

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.

@denzor200
Copy link
Contributor Author

yet more in msvc: https://godbolt.org/z/rjEcdqssK
it also spoils const references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants