<!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.&nbsp; Enhancement requests, as opposed to "real" bugs.<br>
<br>
2.&nbsp; Pure documentation issues.<br>
<br>
3.&nbsp; Stuff related to static arrays.<br>
<br>
4.&nbsp; Bug 3067, which is really a compiler bug.<br>
<br>
How do we want to handle the static array case, long term?&nbsp; 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,&nbsp;since&nbsp;static&nbsp;arrays&nbsp;are&nbsp;usually&nbsp;stack&nbsp;allocated,
using&nbsp;them&nbsp;as&nbsp;ranges&nbsp;is&nbsp;inherently&nbsp;unsafe.&nbsp;&nbsp;Even&nbsp;in&nbsp;cases&nbsp;where&nbsp;it&nbsp;seems&nbsp;safe,
the&nbsp;predicate&nbsp;may&nbsp;do&nbsp;weird&nbsp;things&nbsp;like&nbsp;escape&nbsp;the&nbsp;static&nbsp;array. In
non-generic code using [] to explicitly make the array into a range
isn't much of a problem.&nbsp; I&nbsp;think&nbsp;the
generic&nbsp;programming&nbsp;issue&nbsp;can&nbsp;be&nbsp;solved&nbsp;by&nbsp;simply&nbsp;having&nbsp;an&nbsp;unsafe&nbsp;function&nbsp;in
std.range.&nbsp; This would make it easy to make static arrays work with
generic programming but require making the conversion somewhat
explicit.&nbsp; It would look something like: <br>
<br>
auto&nbsp;toRange(R)(ref&nbsp;R&nbsp;stuff)&nbsp;if(isInputRange!R)&nbsp;{ <br>
&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;if(isStaticArray!R)&nbsp;{ <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;stuff[]; <br>
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{ <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;stuff; <br>
&nbsp;&nbsp;&nbsp;&nbsp;} <br>
} <br>
<br>
Of&nbsp;course,&nbsp;I'd&nbsp;also&nbsp;create&nbsp;an&nbsp;overload&nbsp;w/o&nbsp;the&nbsp;ref&nbsp;so&nbsp;it&nbsp;works&nbsp;with&nbsp;rvalues.&nbsp;
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>