June 16, 2013 [Issue 10371] New: Document no copy construction occurs on struct initialization/`init` assignment | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=10371 Summary: Document no copy construction occurs on struct initialization/`init` assignment Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: spec Severity: normal Priority: P2 Component: websites AssignedTo: nobody@puremagic.com ReportedBy: verylonglogin.reg@gmail.com --- Comment #0 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-06-16 12:39:12 MSD --- Documentation must guarantee no copy construction occurs on struct initialization and `init` assignment or usage of any struct with disabled default construction is not guaranteed to compile: --- struct S { @disable this(this); } void main() { // Copy constructed from temporary? S s = S(); // Copy constructed from `S.init`? S s2 = S.init; // Assigned from `S.init`? s2 = S.init; } --- E.g. in C++ one can use `S s(...)` syntax for this purpose. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation