[Issue 10816] New: Support for is(T1 != T2) syntax

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 13 07:03:39 PDT 2013


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

           Summary: Support for is(T1 != T2) syntax
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-08-13 07:03:37 PDT ---
Created an attachment (id=1242)
Hundreds of usage cases found in dmd/Phobos

In Phobos I have counted about 240 cases (even if some of them are possibly
false positives, see the attach) of usages of the pattern:

!is(T1 == T2)

So I suggest to add to D a handy syntax like this (that in past sometimes I
even have used by mistake):

is(T1 != T2)

It's similar to the handy "!is" and "!in" syntaxes.

- - - - - - - - - - - - - - - - - -

Extra: in some cases you can even think about a comparison, but this is left to
other enhancement requests:

class Klass1 {}
class Klass2 : Klass1 {}
enum bool b1 = is(Klass1 < Klass2);

alias T1 = Tuple!(int, "x");
alias T2 = Tuple!(int);
enum bool b2 = is(T1 < T2);

--------------------------

-- 
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