C++ Logo

std-proposals

Advanced search

Re: [std-proposals] I have a span but I need a container

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 17 Jun 2025 06:49:50 -0700
On Tuesday, 17 June 2025 06:23:20 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> The only thing that could get in the way is mutable members. Which is
> why I think we should have:
>
> std::has_mutable_members_v<T>

And const_cast.

Compilers assume that an object passed by const-ref will be modified by the
function it was passed to, even though 99.9% of such functions will not. I've
been asking for a while for a "really_const".

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-06-17 13:49:56