Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- import std.experimental.allocator;
- import std.stdio : write, writeln, writef, writefln;
- class Foo
- {
- public int id = 42;
- public double f = 4.2;
- public this()
- {
- }
- public this(int id)
- {
- this.id = id;
- }
- }
- Foo foo = theAllocator.make!Foo();
- writeln(foo.id);
- foo = theAllocator.make!Foo(5);
- writeln(foo.id);
- }
Add Comment
Please, Sign In to add comment