www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18546] New: Improvement: Implicit Class Template Instantiation

https://issues.dlang.org/show_bug.cgi?id=18546

          Issue ID: 18546
           Summary: Improvement: Implicit Class Template Instantiation
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

Why does this not work? Should  this work?

class Foo(T) {
    this(T t) { }
}

auto foo = new Foo(5);

C++ can do it...

--
Mar 01 2018