Comment #0 by kamm-removethis — 2011-08-30T12:20:10Z
Test case:
import std.typecons;
class C { int i; byte b; }
void main()
{
auto sa = [scoped!C, scoped!C];
assert(cast(size_t)&sa[0].i % int.alignof == 0);
assert(cast(size_t)&sa[1].i % int.alignof == 0); // fails
}
The problem is that the payload is declared as
private ubyte[__traits(classInstanceSize, T)] Scoped_store = void;
in std.typecons.scoped, as discussed at https://github.com/D-Programming-Language/phobos/pull/148#issuecomment-1590157 .
Comment #1 by verylonglogin.reg — 2012-05-04T12:39:57Z