[PATCH] Change StringRef size_t instances to size_type

Aaron Ballman aaron at aaronballman.com
Wed May 1 16:02:03 PDT 2013


Then wouldn't it make sense for our APIs (at least the ones STL-ish)
to use size_type in case someone wants to vary it?

~Aaron

On Wed, May 1, 2013 at 6:49 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On May 1, 2013, at 3:48 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>
>> Certainly, but then why leave the size_type typedef in?  Is it
>> beneficial in some way?
>
> It follows the STL.  Some generic STL algorithms presumably use it.
>
> -Chris
>
>>
>> ~Aaron
>>
>> On Wed, May 1, 2013 at 6:36 PM, Chris Lattner <clattner at apple.com> wrote:
>>>
>>> On May 1, 2013, at 12:46 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>>>
>>>> The StringRef datatype has mixed usage of size_t and size_type in its
>>>> interface.  This patch changes usages of size_t into size_type for
>>>> consistency.
>>>
>>> Can we standardize the other way?  Use size_t for everything except the typedef of size_type?
>>>
>>> -Chris
>



More information about the llvm-commits mailing list