https://issues.dlang.org/show_bug.cgi?id=16172
Issue ID: 16172
Summary: std.experimental.allocator.make mistakenly thinks
default construction possible on classes with a
private constructor
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
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(); // Mistakenly Works
}
...
module other;
class test{
private this(int i){
// No default constructor...
}
}
Related Issues: Issue 16171
--