Bug 4671 – std.conv.emplace() doesn't work w/ struct literals, as opposed to c'tors.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-17T18:18:00Z
Last change time
2010-08-17T19:55:15Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2010-08-17T18:18:26Z
import std.conv; struct Foo { uint num; } void main() { Foo foo; auto voidArr = (cast(void*) &foo)[0..Foo.sizeof]; emplace!(Foo)(voidArr, 2U); } d:\dmd2\windows\bin\..\..\src\phobos\std\conv.d(3805): Error: cannot implicitly convert expression (_param_1) of type uint to Foo d:\dmd2\windows\bin\..\..\src\phobos\std\conv.d(10): Error: template instance std.conv.emplace!(Foo,uint) error instantiating
Comment #1 by andrei — 2010-08-17T19:55:15Z