Expose a copy of std.conv with the DUB package of stdx.allocator

This commit is contained in:
Sebastian Wilzbach 2018-06-26 06:17:36 +02:00
parent fcc98f8170
commit a11c084b2e
2 changed files with 18 additions and 0 deletions

View file

@ -36,8 +36,13 @@ subPackage {
auto destFile = file.replace(srcDir, destDir);
destFile.dirName.mkdirRecurse;
file.readText.replace("std.experimental.allocator", "stdx.allocator")
.replace("std.conv", "stdx.allocator.conv")
.toFile(destFile);
}
pkgDir.buildPath("std", "conv.d")
.readText
.replace("std.conv", "stdx.allocator.conv")
.toFile(destDir.buildPath("conv.d"));
'`
}

View file

@ -11,3 +11,16 @@ void main(string[] args)
writeln("allocate: ", buf);
scope(exit) Mallocator.instance.deallocate(buf);
}
void test()
{
import stdx.allocator : make;
import stdx.allocator.mallocator : Mallocator;
alias alloc = Mallocator.instance;
struct Node
{
int x;
this(int, int){}
}
auto newNode = alloc.make!Node(2, 3);
}