www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16172] New: std.experimental.allocator.make mistakenly thinks

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: nobody puremagic.com
          Reporter: joeyemmons yahoo.com

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

--
Jun 14 2016