digitalmars.D.learn - moveToGC
- JG (21/21) May 10 2021 The following compiles with dmd but not with ldc on run.dlang.io.
- Mike Parker (11/13) May 10 2021 Please provide the error message(s) when asking questions like
- JG (2/15) May 12 2021 Thank you.
- Alain De Vos (3/3) May 10 2021 Something else with,
The following compiles with dmd but not with ldc on run.dlang.io.
Am I doing something wrong?
import core.memory;
void main()
{
struct S
{
int x;
this(this) disable;
~this() safe pure nothrow nogc {}
}
S* p;
// rvalue
p = moveToGC(S(123));
assert(p.x == 123);
// lvalue
auto lval = S(456);
p = moveToGC(lval);
assert(p.x == 456);
assert(lval.x == 0);
}
May 10 2021
On Monday, 10 May 2021 at 10:56:35 UTC, JG wrote:The following compiles with dmd but not with ldc on run.dlang.io. Am I doing something wrong?Please provide the error message(s) when asking questions like this. In this case: ``` onlineapp.d(15): Error: undefined identifier moveToGC onlineapp.d(20): Error: undefined identifier moveToGC ``` Looks like moveToGC was added in 2.096: https://github.com/dlang/druntime/commit/bf59d2dcc4eae068a37db169977eef3eb394cee6 Adding --version to the ldc command line at run.dlang.io shows it's running ldc 1.25.1, which is current with D 2.095.1.
May 10 2021
On Monday, 10 May 2021 at 11:11:06 UTC, Mike Parker wrote:On Monday, 10 May 2021 at 10:56:35 UTC, JG wrote:Thank you.The following compiles with dmd but not with ldc on run.dlang.io. Am I doing something wrong?Please provide the error message(s) when asking questions like this. In this case: ``` onlineapp.d(15): Error: undefined identifier moveToGC onlineapp.d(20): Error: undefined identifier moveToGC ``` Looks like moveToGC was added in 2.096: https://github.com/dlang/druntime/commit/bf59d2dcc4eae068a37db169977eef3eb394cee6 Adding --version to the ldc command line at run.dlang.io shows it's running ldc 1.25.1, which is current with D 2.095.1.
May 12 2021
Something else with, import core.memory i've got, undefined identifier moveToGC
May 10 2021









JG <someone somewhere.com> 