C++ Logo

std-proposals

Advanced search

Re: [std-proposals] The member functions of std::vector<bool>::reference and std::bitset::reference (except for ctors and dtors) should all be const

From: Oleksandr Koval <oleksandr.koval.dev_at_[hidden]>
Date: Fri, 7 Oct 2022 15:34:25 +0300
I think the intent here is to mimic value semantics since assignment
actually changes referenced value. Making those functions `const` would be
confusing.

On Fri, Oct 7, 2022 at 2:42 PM blacktea hamburger via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> std::vector<bool>::reference and std::bitset::reference are both proxies,
> so even if they themselves are const, they can still be used to change
> the bit they reference.
>
> Are there any issues?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>


-- 
Regards,
Oleksandr Koval.

Received on 2022-10-07 12:34:38