[Issue 6377] std.conv.to should check range when changing signedness

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 25 10:59:56 PDT 2011


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


Andrei Alexandrescu <andrei at metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at metalanguage.com


--- Comment #7 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-07-25 10:59:52 PDT ---
(In reply to comment #6)
> When talking about safe in D, it means memory safe. That's what @safe is for.
> As such, if you mean something _other_ than memory safe, you need to be more
> specific. Otherwise, talking about safe becomes kind of meaningless, because it
> could mean just about anything.

Agreed. That being said, generally std.conv.to is meant to bring additional
protection compared to a cast and to memory safety. Probably rejecting
conversion from negative int to uint is a good decision. If one doesn't care,
one can always use a cast instead.

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