Re: safety of move

2012-11-28 Thread Dmitry Olshansky
11/28/2012 7:19 AM, Ellery Newcomer пишет: I find myself using [abusing?] move lately: import std.algorithm; import std.stdio; struct A { const(int) i; int j; int k; } void main() { A* a = new A(); // pretend this is malloc or something // *a = A(1) A a2 = A(1);

safety of move

2012-11-27 Thread Ellery Newcomer
I find myself using [abusing?] move lately: import std.algorithm; import std.stdio; struct A { const(int) i; int j; int k; } void main() { A* a = new A(); // pretend this is malloc or something // *a = A(1) A a2 = A(1); move(a2, *a); A[] arr = new A[](2);