yurai007 added a comment. Instead adding one more constructor another option is tweaking existing SmallVector(const iterator_range<RangeTy> &R) one in following way:
- template <typename RangeTy> - explicit SmallVector(const iterator_range<RangeTy> &R) - : SmallVectorImpl<T>(N) { + template <typename Range, typename = std::enable_if_t<std::is_convertible< + ValueTypeFromRangeType<Range>, T>::value>> + SmallVector(const Range &R) : SmallVectorImpl<T>(N) { this->append(R.begin(), R.end()); } That would unlock possibility of creating SmallVector not only from ArrayRef but from every range as long as types are convertible. I didn't explore this way further, I'm not sure but I believe it should work. It's more than just "adding ArrayRef constructor" but if you are interested I can check where it leads. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130268/new/ https://reviews.llvm.org/D130268 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits