nikic added a comment.

I think my only concern with this change is that it will also allow some 
implicit ArrayRef constructors. For example, this will permit creating a 
SmallVector from `std::array`, `std::vector`, or just `T` -- but only if 
`ArrayRef` is in scope. This seems somewhat dangerous.

I'm not sure if C++ provides any good way to avoid that, short of explicitly 
marking certain constructors as deleted?

I'm wondering if it might not be better to make this a fully generic overload 
that accepts any range (i.e., anything with begin() and end()). Paradoxically, 
this will likely be less permissive in practice than having explicit 
iterator_range and ArrayRef overloads, because it allows less implicit 
conversions.


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

Reply via email to