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

          Issue ID: 16599
           Summary: Allow Template Constraint in Untemplated Function in
                    Templated Struct
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: gyroh...@gmail.com

Basically to allow template constraints like below, which currently causes an
error, saying a semicolon is expected not if statement.

    struct Templ(T)
    {
        void func() if(is(T == float)) // behavior now: Error: semicolon
expected...
        {
        }
    }

It's a bit cleaner than having a "static if" wrap the entire function.

--

Reply via email to