C++ Logo

std-discussion

Advanced search

Re: Is the intent of [class.cdtor] p2 to disallow aliasing, and is the wording strong enough to be useful?

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 05 Aug 2023 21:31:15 -0700
On Friday, 4 August 2023 16:01:47 PDT Jan Schultke via Std-Discussion wrote:
> Am I interpreting the intent correctly? If so, how can the wording be
> improved to fully disallow aliasing, as intended, so that we can just
> add `noalias` here, as is already done?

I've always believed the intent had nothing to do with aliasing, but to
control calling of virtual functions during construction, because the object
is not fully constructed yet, and allowing omitting unnecessary updates to the
vtable pointers.

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

Received on 2023-08-06 04:31:17