[PATCH] D33919: [ADT] Ensure that correct overrides for SmallVector assign are selected

Francis Ricci via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 12:59:49 PDT 2017


The primary issue I ran into there was that there are many possible
valid input types, and checking for the full set gets pretty messy
(const iterator vs iterator vs pointer, etc). One possible way that
wasn't too messy was to check whether the type was dereferenceable and
iterable (ie can you run *val and ++val), which works as well but
seems hacky to me.

This solution seemed like the cleanest one, but I can try to work
something out in terms of checking for all the possible valid
iterator/pointer types.

On Tue, Jun 6, 2017 at 3:54 PM, David Blaikie <dblaikie at gmail.com> wrote:
> I feel like this should probably be implemented the same way as the standard
> requires - if the type is not a forward iterator, rather than non-integral.
> (you could imagine/create a test case for a situation where there's a type
> that's implicitly convertible to an integral type (for use as the offset
> point in an append call) & either the value type or convertible to it - but
> not an integral type)
>
> & also this should be tested and similar solution probably applied to the
> "assign(iter, iter)" and the (iter, iter) ctor.
>
> On Tue, Jun 6, 2017 at 11:37 AM Francis Ricci via Phabricator
> <reviews at reviews.llvm.org> wrote:
>>
>> fjricci added a subscriber: efriedma.
>> fjricci added a comment.
>>
>> Accidentally removed a subscriber, re-adding
>>
>>
>> https://reviews.llvm.org/D33919
>>
>>
>>
>


More information about the llvm-commits mailing list