Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e945cc6299
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (41 sloc) 0.861 kb
var _nextId = 0;
nextId() {
var id = _nextId;
_nextId += 1;
return id;
}
record Test (
id : Int
);
overload RegularRecord?(static Test) = false;
overload Test() {
var id = nextId();
println("construct Test ", id);
return Test(id);
}
overload Test(src:Test) {
println("copy Test ", src.id);
return Test(src.id);
}
overload moveUnsafe(src:Test) {
println("move Test ", src.id);
return Test(src.id);
}
overload resetUnsafe(x:Test) {
var id = nextId();
println("reset Test ", id);
x.id = id;
}
overload destroy(x:Test) {
println("destroy Test ", x.id);
}
overload assign(dest:Test, src:Test) {
dest.id = src.id;
}
main() {
var a = Vector[Test](Test(), Test());
reserve(a, 100);
push(a, array(Test(), Test(), Test(), Test(), Test()));
var x = Test();
push(a, move(x));
}
Jump to Line
Something went wrong with that request. Please try again.