mirror of
https://github.com/dlang/phobos.git
synced 2025-04-26 05:00:35 +03:00
Expose a copy of std.conv with the DUB package of stdx.allocator
This commit is contained in:
parent
fcc98f8170
commit
a11c084b2e
2 changed files with 18 additions and 0 deletions
5
dub.sdl
5
dub.sdl
|
@ -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"));
|
||||
'`
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue