xxxxxxxxxx
import std.stdio, std.typecons;
struct Vector3f {
float x, y, z;
this(this);
}
struct Ray {
Vector3f* origin;
Vector3f* dir;
this(Vector3f* origin, Vector3f* dir) {
this.origin = origin;
this.dir = dir;
}
}
void main(string[] args)
{
import std.experimental.allocator : make, dispose;
import std.experimental.allocator.mallocator : Mallocator;
alias alloc = Mallocator.instance;
auto v1 = alloc.make!Vector3f;
auto v2 = alloc.make!Vector3f;
Ray(v1, v2);
alloc.dispose(v1);
alloc.dispose(v2);
}