digitalmars.D.bugs - [Issue 14593] New: operator overloading can't be used with
- via Digitalmars-d-bugs (23/23) May 16 2015 https://issues.dlang.org/show_bug.cgi?id=14593
https://issues.dlang.org/show_bug.cgi?id=14593 Issue ID: 14593 Summary: operator overloading can't be used with expression templates Product: D Version: unspecified Hardware: Other OS: All Status: NEW Severity: enhancement Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: code dawg.eu A motivating example is using expression templates to specify db queries. db.get!Person.where!(p => p.age > 21 && p.name == "Peter") This has the following problems: - opCmp doesn't allow to capture the op - it's not possible to overload && - opEquals must return a bool (but here it needs to return p) A solution would be to use the generic opBinary for < <= > >= == iff opCmp/opEquals don't exist and also extending it to && ||. --
May 16 2015