Re: Failure due to memcpy being called at compile time

2022-06-21 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 21 June 2022 at 04:30:25 UTC, JG wrote: On Tuesday, 21 June 2022 at 01:39:43 UTC, Paul Backus wrote: Update: a new release of [the `sumtype` package on code.dlang.org][1] is available that includes the fix for this bug. `std.sumtype` will be fixed in the next Phobos release, 2.10

Re: Failure due to memcpy being called at compile time

2022-06-20 Thread JG via Digitalmars-d-learn
On Tuesday, 21 June 2022 at 01:39:43 UTC, Paul Backus wrote: On Tuesday, 14 June 2022 at 05:35:46 UTC, JG wrote: On Monday, 13 June 2022 at 21:45:39 UTC, Paul Backus wrote: The call to `move` is coming from `SumType.opAssign`: https://github.com/dlang/phobos/blob/v2.100.0/std/sumtype.d#L681 I

Re: Failure due to memcpy being called at compile time

2022-06-20 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 14 June 2022 at 05:35:46 UTC, JG wrote: On Monday, 13 June 2022 at 21:45:39 UTC, Paul Backus wrote: The call to `move` is coming from `SumType.opAssign`: https://github.com/dlang/phobos/blob/v2.100.0/std/sumtype.d#L681 I've filed a bugzilla issue for this here: https://issues.dlan

Re: Failure due to memcpy being called at compile time

2022-06-13 Thread JG via Digitalmars-d-learn
On Monday, 13 June 2022 at 21:45:39 UTC, Paul Backus wrote: On Monday, 13 June 2022 at 19:48:06 UTC, JG wrote: Hi, I reduced my code to the following. Could anyone help me to discover why the line marked with //THIS LINE causes memcpy to be called, and how can I avoid this? Reduced furthe

Re: Failure due to memcpy being called at compile time

2022-06-13 Thread Paul Backus via Digitalmars-d-learn
On Monday, 13 June 2022 at 19:48:06 UTC, JG wrote: Hi, I reduced my code to the following. Could anyone help me to discover why the line marked with //THIS LINE causes memcpy to be called, and how can I avoid this? Reduced further: ```d import std.sumtype; struct Tuple { void opA

Re: Failure due to memcpy being called at compile time

2022-06-13 Thread JG via Digitalmars-d-learn
On Monday, 13 June 2022 at 20:25:00 UTC, Steven Schveighoffer wrote: On 6/13/22 4:09 PM, JG wrote: Thanks. It seems to be something to do with the variadic template since this works: ```d import std; struct ParseError { string msg; } alias ParseErrorOr(T) = SumType!(ParseError,T); auto parse

Re: Failure due to memcpy being called at compile time

2022-06-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/13/22 4:09 PM, JG wrote: Thanks. It seems to be something to do with the variadic template since this works: ```d import std; struct ParseError { string msg; } alias ParseErrorOr(T) = SumType!(ParseError,T); auto parseErrorOr(T)(T x) { return ParseErrorOr!T(x); } auto parserOr(I,alias f

Re: Failure due to memcpy being called at compile time

2022-06-13 Thread JG via Digitalmars-d-learn
On Monday, 13 June 2022 at 19:59:16 UTC, Steven Schveighoffer wrote: On 6/13/22 3:48 PM, JG wrote: Hi, I reduced my code to the following.  Could anyone help me to discover why the line marked with //THIS LINE causes memcpy to be called, and how can I avoid this? ```d import std; struct P

Re: Failure due to memcpy being called at compile time

2022-06-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/13/22 3:48 PM, JG wrote: Hi, I reduced my code to the following.  Could anyone help me to discover why the line marked with //THIS LINE causes memcpy to be called, and how can I avoid this? ```d import std; struct ParseError { string msg; } alias ParseErrorOr(T) = SumType!(ParseError

Failure due to memcpy being called at compile time

2022-06-13 Thread JG via Digitalmars-d-learn
Hi, I reduced my code to the following. Could anyone help me to discover why the line marked with //THIS LINE causes memcpy to be called, and how can I avoid this? ```d import std; struct ParseError { string msg; } alias ParseErrorOr(T) = SumType!(ParseError,T); auto parseErrorOr(T)(T x)