C++ Logo

std-discussion

Advanced search

Re: Possible defect in definition of standard-layout

From: Brian Bi <bbi5291_at_[hidden]>
Date: Wed, 10 May 2023 15:31:03 -0400
On Wed, May 10, 2023 at 3:29 PM Thiago Macieira via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> On Wednesday, 10 May 2023 03:43:57 PDT Edward Catmur via Std-Discussion
> wrote:
> > TBH, it looks like this has been broken since C++11 (when we first
> allowed
> > standard layout class types to have bases).
> > https://timsong-cpp.github.io/cppwp/n3337/class#7
>
> Didn't C++11 have a limitation that only one class in the hierarchy could
> have
> non-static data members and still be standard layout?
>

I also misread Lénárd's example the first time I saw it.

`C` doesn't derive from `B`; `C` only derives from `A`. And `A` has no data
members.


> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DCAI Cloud Engineering
>
>
>
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
>


-- 
*Brian Bi*

Received on 2023-05-10 19:31:18