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

Use boost::core::invoke_swap with a const T& #155

Open
Ukilele opened this issue Sep 12, 2023 · 1 comment
Open

Use boost::core::invoke_swap with a const T& #155

Ukilele opened this issue Sep 12, 2023 · 1 comment

Comments

@Ukilele
Copy link

Ukilele commented Sep 12, 2023

Hi, this is rather an inquiry than an actual issue.
boost::core::invoke_swap only participates in overload resolution, when the type it gets called with is not const qualified (invoke_swap.hpp#L81). C++23 standardized std::ranges::zip_view. As part of the proposal, std::pair and std::tuple got const-qualified overloads of their swap-functions (the rationale can be found here). Should this change be somehow reflected in boost::core::invoke_swap?

@Lastique
Copy link
Member

If swapping const values is now allowed, this would probably mean we need to drop the is_const check here. But my understanding is that the support for swapping consts is more of an exception for a given type (pairs and tuples for now) rather than a rule, so I'm not sure that simply dropping is_const is the right way.

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