[Issue 16508] Alignment of class members is not respected. Affects new, scoped and classInstanceAlignment.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 8 09:52:40 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=16508
--- Comment #4 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to kinke from comment #3)
>
> There's no such thing as class instance arrays, only arrays of class
> references, so that's a non-issue.
I'm curious why you chose to nitpick - it's unlikely you didn't understand what
I meant.
Class instance types exist implicitly and are commonly represented by structs.
The return type of std.typecons.scoped is an example, as you know. It is
reasonable to expect arrays (and, in general, sequentially stored objects) of
such structs to be usable. __traits(classInstanceSize) and
std.trait.classInstanceAlignment are used almost exclusively to calculate the
size/alignment for such structs. Neither produces results usable for that
purpose.
--
More information about the Digitalmars-d-bugs
mailing list