[Issue 7430] New: opCmp doesn't support unordered value comparison.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 3 08:55:40 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7430

           Summary: opCmp doesn't support unordered value comparison.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: gor at boloneum.com


--- Comment #0 from Gor Gyolchanyan <gor at boloneum.com> 2012-02-03 08:55:39 PST ---
I have a structure, that represents an element of a range. Let's say a
character. That character can be invalid.
I need all comparison operators to return false of at least one of the
operands is invalid.
with opCmp, the expression a @ b is rewritten as a.opCmp(B) @ 0, which
doesn't allow me to define such a logic.
A rewrite of opCmp to test for exact
values -1, 0 and 1 would solve the problem, because any value beyond the
expected three would cause all comparisons to fail.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list