Bug 9002 – Document that `S s = S(...);` will not create temporaries
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-12T02:47:00Z
Last change time
2014-04-22T23:43:23Z
Keywords
spec
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2012-11-12T02:47:32Z
Unlike C++, you can't initialize structs in D like this: `S s(...);`.
Documentation should be clear that `S s = S(...);` will not create temporaries i.e. will not call postblit or destructor.
E.g. without such notes one can't be sure regular initialization will compile for a struct with disabled postblit.
Comment #1 by andrej.mitrovich — 2014-04-22T23:43:23Z
AFAICT Issue 10371 is a superset of this.
*** This issue has been marked as a duplicate of issue 10371 ***