http://d.puremagic.com/issues/show_bug.cgi?id=9112
--- Comment #13 from [email protected] 2012-12-07 10:55:13 PST --- (In reply to comment #11) > (In reply to comment #0) > > So I'd like to propose new syntax to reduce such concept confusion. > > > > int n = int(10); // same as cast(int)10; > > So we're introducing C++-style casts into D? This means you can no longer > search for 'cast' and expect to find all the unsafe casts in your code. I'm > very much against this, and if I remember right Walter was also against this. > AFAIK, it's not exactly the same thing, as int(10) would be only a constructor, so would not downcast. Writing: //---- void foo(long k) { int n = int(k); } //---- Would fail to compile the same way as: //---- void foo(long k) { int n = k; } //---- would. You'd need to use: //---- void foo(long k) { int n = int(cast(int)k); } //---- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
