On Saturday, 18 July 2026 14:48:34 Pacific Daylight Time Giuseppe D'Angelo via 
Development wrote:
> For QMap I introduced QESDPV2 precisely because I wanted deep constness.
> Neither QESDP nor the standard library smart pointers propagate, and
> those are landmines. We should likely also introduce a private
> propagate_const if someone really needs a raw pointer for whatever reason.

It's interesting that the d_func() from Q_DECLARE_PRIVATE does propagate 
constness, because the d_func() const returns a const Private *.

Though it's still possible to accidentally violate it in a new indirection, if 
the Private contains another pointer. The pointer is const, but the pointee 
isn't.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCG - Platform & Sys. Eng.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to