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);
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);