[Issue 19139] New: Need a convenient syntax for invoking nested templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 5 00:13:40 UTC 2018


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

          Issue ID: 19139
           Summary: Need a convenient syntax for invoking nested templates
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: yshuiv7 at gmail.com

Currently, given:

template A() {
    template A() {
        enum A = 1;
    }
}

This:

A!()!()

does not compile (multiple ! arguments are not allowed).

Neither does this (C style cast illegal):

(A!())!()

The only way to invoke the nested template seems to be:

alias B = A!();
B!()

This is less than ideal.

--


More information about the Digitalmars-d-bugs mailing list