[Issue 11080] assert(`string`) should be forbidden

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 21 10:43:51 PDT 2013


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #10 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-09-21 10:43:48 PDT ---
To completely accurate, strings do not implicitly convert to bool. Rather, in
conditions, the compiler inserts cast(bool). So, in conditions, anything which
can be explicitly cast to bool appears to be implicitly cast (when in fact it's
explicitly cast), but outside of conditions, there is not such conversion. e.g.

bool b = "foo";

will fail to compile.

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