[PATCH] D33919: [ADT] Ensure that correct overrides for SmallVector assign are selected
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 6 11:36:44 PDT 2017
fjricci updated this revision to Diff 101596.
fjricci retitled this revision from "[ADT] Enforce class type for overridden SmallVector assign" to "[ADT] Ensure that correct overrides for SmallVector assign are selected".
fjricci removed a subscriber: efriedma.
fjricci added a comment.
Enforce that template arguments are not integral types
The only possible conflicting override takes a size_type, and enforcing that the
type is not an integral type is much more straightforward than enforcing that it is
either an iterator, const iterator, pointer, or const pointer.
https://reviews.llvm.org/D33919
Files:
include/llvm/ADT/SmallVector.h
Index: include/llvm/ADT/SmallVector.h
===================================================================
--- include/llvm/ADT/SmallVector.h
+++ include/llvm/ADT/SmallVector.h
@@ -426,7 +426,9 @@
std::uninitialized_fill(this->begin(), this->end(), Elt);
}
- template <typename in_iter> void assign(in_iter in_start, in_iter in_end) {
+ template <class in_iter, class = typename std::enable_if<
+ !std::is_integral<in_iter>::value>::type>
+ void assign(in_iter in_start, in_iter in_end) {
clear();
append(in_start, in_end);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33919.101596.patch
Type: text/x-patch
Size: 581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170606/10afdfab/attachment.bin>
More information about the llvm-commits
mailing list