<div dir="ltr">On Thu, May 2, 2013 at 1:02 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank" class="cremed">aaron@aaronballman.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Then wouldn't it make sense for our APIs (at least the ones STL-ish)<br>
to use size_type in case someone wants to vary it?<br></blockquote><div><br></div><div style>It makes sense for an *algorithm* to use size_type of a data structure it operates on in the event the data structure overrides it.</div>
<div style><br></div><div style>It makes sense for a data structure to use 'size_t' because its simpler.</div><div style><br></div><div style>It makes sense for a data structure to typedef 'size_t' to 'size_type' to tell algorithms that it has elected to use that definition.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, May 1, 2013 at 6:49 PM, Chris Lattner <<a href="mailto:clattner@apple.com" class="cremed">clattner@apple.com</a>> wrote:<br>
><br>
> On May 1, 2013, at 3:48 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com" class="cremed">aaron@aaronballman.com</a>> wrote:<br>
><br>
>> Certainly, but then why leave the size_type typedef in?  Is it<br>
>> beneficial in some way?<br>
><br>
> It follows the STL.  Some generic STL algorithms presumably use it.<br>
><br>
> -Chris<br>
><br>
>><br>
>> ~Aaron<br>
>><br>
>> On Wed, May 1, 2013 at 6:36 PM, Chris Lattner <<a href="mailto:clattner@apple.com" class="cremed">clattner@apple.com</a>> wrote:<br>
>>><br>
>>> On May 1, 2013, at 12:46 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com" class="cremed">aaron@aaronballman.com</a>> wrote:<br>
>>><br>
>>>> The StringRef datatype has mixed usage of size_t and size_type in its<br>
>>>> interface.  This patch changes usages of size_t into size_type for<br>
>>>> consistency.<br>
>>><br>
>>> Can we standardize the other way?  Use size_t for everything except the typedef of size_type?<br>
>>><br>
>>> -Chris<br>
><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>