mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +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);
|
auto destFile = file.replace(srcDir, destDir);
|
||||||
destFile.dirName.mkdirRecurse;
|
destFile.dirName.mkdirRecurse;
|
||||||
file.readText.replace("std.experimental.allocator", "stdx.allocator")
|
file.readText.replace("std.experimental.allocator", "stdx.allocator")
|
||||||
|
.replace("std.conv", "stdx.allocator.conv")
|
||||||
.toFile(destFile);
|
.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);
|
writeln("allocate: ", buf);
|
||||||
scope(exit) Mallocator.instance.deallocate(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