Beta problems... 'this' pointer in union?
Era Scarecrow
rtcvb32 at yahoo.com
Sat Dec 29 20:30:27 PST 2012
On Sunday, 30 December 2012 at 03:43:09 UTC, Jonathan M Davis
wrote:
> For any bugs that you find in the beta, bring them up in the
> beta list and create bug reports for them in bugzilla:
> http://d.puremagic.com/issues
Will do
> Looking at the code though, I'm shocked to see a function
> declaration in a union. I wouldn't have thought that that was
> legal. But maybe that's why the static assertions are failing.
Not my original idea; Actually it's part of a previous test case
from std/format.d lines: 684-695. The original test case is
actually to make sure that with no defaults that it doesn't try
to set a default of throwing a 'overlapping initialization' error.
[quote]
else
{
union
{
mixin(bitfields!(
bool, "flDash", 1,
bool, "flZero", 1,
bool, "flSpace", 1,
bool, "flPlus", 1,
bool, "flHash", 1,
ubyte, "", 3));
ubyte allFlags;
}
}
[/quote]
More information about the Digitalmars-d-learn
mailing list