<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 3, 2014 at 2:11 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+ /// count -<br>
<br>
While at it, please drop the name from the comment.<br>
<br>
I think the patch is OK. Richard, do you know what is the reason the<br>
stl uses size_type?</blockquote><div><br></div><div>I don't know for sure, but probably for consistency and ease of specification of the interface.</div><div><br></div><div>[It's been like that since Stepanov and Lee's original implementation, where the red-black tree implementation shared by set,map,multiset,multimap did not distinguish between the unique and non-unique cases in its 'count' implementation.]</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
On 23 December 2013 06:51, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:<br>
> The count() function for STL datatypes returns unsigned, even where it's<br>
> only 1/0 result like std::set. Some of the LLVM ADT already return unsigned<br>
> count(), while others still return bool count().<br>
><br>
> In continuation to r197879, this patch modifies DenseMap, DenseSet,<br>
> ScopedHashTable, ValueMap:: count() to return unsigned instead of bool, 1<br>
> instead of true and 0 instead of false.<br>
><br>
> Yaron<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
</blockquote></div><br></div></div>