C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Alteration of elements in a set (non-const iterator)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 22 May 2023 11:55:21 -0700
On Monday, 22 May 2023 11:18:45 PDT Edward Catmur wrote:
> I've been meaning to ask for a [[really_const]] attribute for a while.
>
> It shouldn't be necessary (per the standard, implementations might want to
> add it anyway).

That's for the first case I pasted, where the sub-object isn't a const object,
but we called a const member function. It is allowed to const_cast and modify
the object, because the object isn't const.

I want an attribute to say "no, really, I promise not to const_cast".

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-05-22 18:55:25