digitalmars.D.bugs - [Issue 22521] New: [CTFE] std.experimental.allocator.make and
- d-bugmail puremagic.com (30/30) Nov 18 2021 https://issues.dlang.org/show_bug.cgi?id=22521
https://issues.dlang.org/show_bug.cgi?id=22521 Issue ID: 22521 Summary: [CTFE] std.experimental.allocator.make and dispose are not CTFEable. Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: ttanjo gmail.com Custom allocators are useful for performance (e.g., std.regex internally uses its custom allocator)and std.experimental.allocator provides a generic interface for them: `make` family and `dispose` family. However, current interface of std.experimental.allocator prevents functions that use custom allocator from CTFEability. It would be nice if `make` family and `dispose` family can provide an interface that enables CTFEability while keeping its flexibility. Here is a current interface of `make`. ```dlang auto make(T, Allocator, A...)(auto ref Allocator alloc, auto ref A args); ``` A problem is that it takes a custom allocator as a runtime parameter. If `make` take a custom allocator as a template alias parameter, we will solve this issue. PoC: https://run.dlang.io/is/WYSaLd --
Nov 18 2021