<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think that covers all the known bugs in std.range and std.algorithm,
with the following exceptions:<br>
<br>
1. Enhancement requests, as opposed to "real" bugs.<br>
<br>
2. Pure documentation issues.<br>
<br>
3. Stuff related to static arrays.<br>
<br>
4. Bug 3067, which is really a compiler bug.<br>
<br>
How do we want to handle the static array case, long term? IMHO stuff
in std.range and std.algorithm should generally<b> not </b>support
static arrays because in addition to being a PITA to
implement, since static arrays are usually stack allocated,
using them as ranges is inherently unsafe. Even in cases where it seems safe,
the predicate may do weird things like escape the static array. In
non-generic code using [] to explicitly make the array into a range
isn't much of a problem. I think the
generic programming issue can be solved by simply having an unsafe function in
std.range. This would make it easy to make static arrays work with
generic programming but require making the conversion somewhat
explicit. It would look something like: <br>
<br>
auto toRange(R)(ref R stuff) if(isInputRange!R) { <br>
static if(isStaticArray!R) { <br>
return stuff[]; <br>
} else { <br>
return stuff; <br>
} <br>
} <br>
<br>
Of course, I'd also create an overload w/o the ref so it works with rvalues.
Comments?<br>
<br>
On 8/16/2010 10:56 PM, dsource.org wrote:
<blockquote cite="mid:20100817025658.GA22449@dsource" type="cite">
<pre wrap="">phobos commit, revision 1884
user: dsimcha
msg:
Bug 4408: Ambiguity when using std.algorithm.splitter with generic ranges
<a class="moz-txt-link-freetext" href="http://www.dsource.org/projects/phobos/changeset/1884">http://www.dsource.org/projects/phobos/changeset/1884</a>
_______________________________________________
phobos mailing list
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a>
</pre>
</blockquote>
<br>
</body>
</html>