Re: emplace doesn't forward aeguments

2021-02-01 Thread kinke via Digitalmars-d-learn
On Saturday, 30 January 2021 at 17:29:15 UTC, vitamin wrote: On Thursday, 28 January 2021 at 23:18:21 UTC, kinke wrote: On Thursday, 28 January 2021 at 21:15:49 UTC, vitamin wrote: Is there reason why std.conv.emplace doesn't forward arguments to __ctor? Yeah, a bug in the emplace() version f

Re: emplace doesn't forward aeguments

2021-01-30 Thread vitamin via Digitalmars-d-learn
On Thursday, 28 January 2021 at 23:18:21 UTC, kinke wrote: On Thursday, 28 January 2021 at 21:15:49 UTC, vitamin wrote: Is there reason why std.conv.emplace doesn't forward arguments to __ctor? Yeah, a bug in the emplace() version for classes, some missing `forward!args` in there (it works wh

Re: emplace doesn't forward aeguments

2021-01-28 Thread kinke via Digitalmars-d-learn
On Thursday, 28 January 2021 at 21:15:49 UTC, vitamin wrote: Is there reason why std.conv.emplace doesn't forward arguments to __ctor? Yeah, a bug in the emplace() version for classes, some missing `forward!args` in there (it works when emplacing a struct with identical ctor). E.g. https://g

emplace doesn't forward aeguments

2021-01-28 Thread vitamin via Digitalmars-d-learn
Is there reason why std.conv.emplace doesn't forward arguments to __ctor? this doesn't work: import std.conv : emplace; import std.functional : forward; struct Bar{ @disable this(const ref typeof(this) rhs)pure nothrow @safe @nogc; } class Foo{ Bar bar; this(Bar bar){