<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Such a statement is technically correct but amazingly pedantic in a
world where there is legacy code in other languages, crufty old D
code from before there was a 64-bit compiler to test it on, and the
need to optimize storage sometimes, but not too many billion element
arrays. If anyone has <b>ever in their entire life</b> worked with
an array with over 2 billion elements (which would demonstrate that
the unsafeness isn't purely theoretical), please speak up. <br>
<br>
On 2/17/2011 6:31 PM, Andrei Alexandrescu wrote:
<blockquote cite="mid:4D5DAFB5.10200@erdani.com" type="cite">On
2/17/11 5:10 PM, David Simcha wrote:
<br>
<blockquote type="cite">Have you actually tried porting any
application code to 64? Phobos and
<br>
other similarly generic libraries don't count because code
that's that
<br>
generic legitimately can't assume that no arrays are going to be
<br>
billions of elements long.
<br>
</blockquote>
<br>
Code that uses the unrecommended practice of mixing int and uint
with size_t everywhere will be indeed difficult to port to 64
bits. But that's a problem with the code, and giving that
unrecommended practice legitimacy by making it look good is aiming
at the wrong target.
<br>
<br>
Use size_t for sizes and it's golden. You can't go wrong. On the
rare occasions when you want to store arrays of indexes, do the
cast by hand, don't ask the standard library to give it a nice
face by making the assumption for you.
<br>
<br>
<br>
Andrei
<br>
_______________________________________________
<br>
phobos mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>