<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Dec 2, 2020, at 3:52 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">I’m pretty skeptical of #2 as an approach, because inline and out of line design points are pretty different when sizeof(T) is 4 or 8, and when sizeof(thevector) matters, e.g. in 2D cases.</div></blockquote><div class=""><br class="">To me, this is more like std::string, which is (2) - and more, to me, about the contract of the type - std::string doesn't guarantee iterator validity over swap/move, where std::vector does. If std::vector didn't have this guarantee, it'd be possible to have small vector optimizations in std::vector the same way std::string does - without the user-facing customization, mind you.<br class=""></div></div></div></blockquote><div><br class=""></div><div>Yeah I definitely prefer to use standard types if we can, I think there is compelling upthread rationale for why using them in general causes complexity.  Maybe as future C++ standards improve we can drop them.  I hope someday that ArrayRef and StringRef can drop away in time for example.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">So I think (2) has some legs - but the problem for me is that if we name the type llvm::Vector, which already gets a bit close to std::vector (unqualified "Vector" seems like fairly subtle code to me - but I'm leaning towards being OK with that aspect if other peopel are) and it has different iterator invalidation/move semantics than std::vector, I think that could be problematic.</div></div></div></blockquote><div><br class=""></div>Not sure if I want to defend this, but we have lots of precedent for this, including llvm::sort etc.</div><div><br class=""></div><div>llvm::Vector has some other nice but not compatible things, e.g. pop_back_val()</div><div><br class=""></div><div class="">-Chris</div></body></html>