www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15719] New: Can't make template with name "this"


          Issue ID: 15719
           Summary: Can't make template with name "this"
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: lasssafin gmail.com

You can't have a template inside an aggregate with the name "this".
This prevents one from creating an advanced function template.

This works:

struct S {
    this(int i)(float f) {}

This doesn't:

struct S {
    template this(int i) {
        this(float f) {}

Feb 24 2016