Skip to content

Commit a11c084

Browse files
committed
Expose a copy of std.conv with the DUB package of stdx.allocator
1 parent fcc98f8 commit a11c084

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

dub.sdl

+5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ subPackage {
3636
auto destFile = file.replace(srcDir, destDir);
3737
destFile.dirName.mkdirRecurse;
3838
file.readText.replace("std.experimental.allocator", "stdx.allocator")
39+
.replace("std.conv", "stdx.allocator.conv")
3940
.toFile(destFile);
4041
}
42+
pkgDir.buildPath("std", "conv.d")
43+
.readText
44+
.replace("std.conv", "stdx.allocator.conv")
45+
.toFile(destDir.buildPath("conv.d"));
4146
'`
4247
}
4348

test/dub_stdx_allocator.d

+13
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@ void main(string[] args)
1111
writeln("allocate: ", buf);
1212
scope(exit) Mallocator.instance.deallocate(buf);
1313
}
14+
15+
void test()
16+
{
17+
import stdx.allocator : make;
18+
import stdx.allocator.mallocator : Mallocator;
19+
alias alloc = Mallocator.instance;
20+
struct Node
21+
{
22+
int x;
23+
this(int, int){}
24+
}
25+
auto newNode = alloc.make!Node(2, 3);
26+
}

0 commit comments

Comments
 (0)