<div dir="ltr">A container similar to folly's small_vector would be great to have (<a href="https://github.com/facebook/folly/blob/master/folly/docs/small_vector.md">https://github.com/facebook/folly/blob/master/folly/docs/small_vector.md</a>)</div><div class="gmail_extra"><br><div class="gmail_quote">On 9 June 2015 at 18:11, Jonathan M Davis via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, 9 June 2015 at 21:53:55 UTC, Andrei Alexandrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regarding projects that we discussed you are considering, I suggest we focus on putting std.container in good shape and opt for a redesign only if there are great benefits. Also, I think we should stay with libc-based I/O.<br>
</blockquote>
<br></span>
Honestly, I think that std.container's API is a very good start. The main problems lie with ranges. We need to make sure that all of the range-based functions are consistent (e.g. accepting Take!R, TakeOne!R, TakeExactly!R, etc. where R is the range type for that container - we do that to some extent, but we're not consistent about it), and we need to add more functions that don't use ranges - in particular, remove functions which remove keys or values without having to use a range to do it. Honestly, while it's flexible, it's not exactly the finest hour for ranges when you have to do something like<br>
<br>
container.remove(container[].find(value).takeOne());<br>
<br>
just to remove a value for the container. Most folks just want to do something like<br>
<br>
container.removeFirst(value);<br>
<br>
And containers are really the main place, I think, where iterators actually do better than ranges. So, while I definitely want the containers to continue to support ranges, I think that we should do a better job of having alternative functions which don't involve ranges if they don't need to for many of the basic cases. Then the simple cases won't have to use ranges just to do stuff like remove elements, and generic code and more complicated cases can use ranges as appropriate.<br>
<br>
But in general, while I do think that some polishing is needed for the std.container API, I also think that it's a very solid start.<br>
<br>
- Jonathan M Davis<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">   -=Miles Stoudenmire=-<br>   <a href="mailto:miles.stoudenmire@gmail.com" target="_blank">miles.stoudenmire@gmail.com</a><br>   <a href="mailto:emiles@pitp.ca" target="_blank">emiles@pitp.ca</a> <br>   <a href="http://itensor.org/miles/" target="_blank">http://itensor.org/miles/</a><br></div></div>
</div>