[Issue 4773] [PATCH] Rebindable should be castable to bool

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 31 08:09:23 PDT 2010


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


Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|]Rebindable should be       |[PATCH] Rebindable should
                   |castable to bool            |be castable to bool


--- Comment #1 from Simen Kjaeraas <simen.kjaras at gmail.com> 2010-08-31 08:09:08 PDT ---
Yeah, that's what you get when you press the wrong buttons. :p

Anyways, Rebindable should be castable to bool, to allow for the idiom
Rebindable!T foo; if (foo) {}.

Addition to typecons.d, line 747:

            T opCast(T : bool)()
            {
                return original !is null;
            }

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