Allocator make with no extra args works on classes even when default construction is not available.
import other;
import std.experimental.allocator;
import std.experimental.allocator.mallocator;
void main(){
// auto t1 = new test(); // Error
auto t = Mallocator.instance.make!test(); // Works
}
...
module other;
class test{
private this(){
}
}
Worse even is it will still work even if class test does not have a default constructor at all.
module other;
class test{
private this(int i){
// No default constructor...
}
}
Comment #1 by b2.temp — 2016-06-14T12:23:18Z
(In reply to joeyemmons from comment #0)
>
> Worse even is it will still work even if class test does not have a default
> constructor at all.
>
> module other;
> class test{
> private this(int i){
> // No default constructor...
> }
> }
please make another report for this one. This is another issue.
Comment #2 by joeyemmons — 2016-06-14T13:04:46Z
(In reply to b2.temp from comment #1)
> please make another report for this one. This is another issue.
Issue 16172
Comment #3 by robert.schadek — 2024-12-01T16:27:09Z