Summary:
small_vector is now object-exception safe for all container
functions, except for input-iterators.
That's a bold claim; probably incorrect. At the very least, it passes
the same test suite as std::vector and fbvector.
Aside: Clearly, no one uses erase(q1, q2) in the wild.
Facebook: Nothing special.
Test Plan:
fbconfig -r folly && fbmake runtests
fbconfig -r experimental/njormrod/stltest && fbmake runtests
Reviewed By: andrei.alexandrescu@fb.com
FB internal diff:
D1319787
}
iterator erase(const_iterator q1, const_iterator q2) {
+ if (q1 == q2) return unconst(q1);
std::move(unconst(q2), end(), unconst(q1));
- for (auto it = q1; it != end(); ++it) {
+ for (auto it = (end() - std::distance(q1, q2)); it != end(); ++it) {
it->~value_type();
}
this->setSize(size() - (q2 - q1));