Bug 16599 – Allow Template Constraint in Untemplated Function in Templated Struct

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-10-06T13:49:38Z
Last change time
2024-12-13T18:50:26Z
Assigned to
No Owner
Creator
Jack
Moved to GitHub: dmd#17778 →

Comments

Comment #0 by gyroheli — 2016-10-06T13:49:38Z
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.
Comment #1 by uplink.coder — 2016-10-06T14:02:56Z
do a DIP please.
Comment #2 by razvan.nitu1305 — 2022-11-10T14:45:13Z
The error is now: test.d(3): Error: cannot use function constraints for non-template functions. Use `static if` instead
Comment #3 by robert.schadek — 2024-12-13T18:50:26Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17778 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB