[PATCH] D33919: [ADT] Make iterable SmallVector template overrides more specific

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 11:04:08 PDT 2017


dblaikie added a comment.

I think this is just about right - but the current SFINAE is only an exact match, so it wouldn't work for something that's, say, a RandomAccessIterator.

I believe you want to use std::is_convertible_to, rather than std::is_same (& maybe add coverage/a test case for a non-forward (for example, a random access - such as pointers to the begin/end of an array) for this).

I'm guessing using is_same should've broken some existing code in LLVM - I'm surprised it didn't break the unit test? So maybe I'm misunderstantding something about how this is working.

(I really appreciate your patience as we go around on this - sorry it's taken a few iterations)


https://reviews.llvm.org/D33919





More information about the llvm-commits mailing list