[Issue 8118] Impossible to initialize a member struct without default constructor or assigment
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 15 06:17:50 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8118
Marco Leise <Marco.Leise at gmx.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Marco.Leise at gmx.de
--- Comment #5 from Marco Leise <Marco.Leise at gmx.de> 2013-02-15 06:17:42 PST ---
(In reply to comment #4)
> The fact that it's **impossible** to call the constructor directly without an
> assignment getting in the way (as far as I see) is a bug.
I agree with you. I have a struct that is not supposed to be copied. Now I
cannot use it as a field in any other struct/class.
In some cases a work-around may be to allow assignments, but check that the
receiver is S.init.
Also I tried "= void" first. So it may be the most intuitive to use for the bug
fix.
I haven't checked, but it could allow code like this if not currently possible:
S s = void;
if (xyz) {
s = S(3);
} else {
s = S(7);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list