[PATCH] D27009: Make STLExtras range adapters consistent.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 16:11:06 PST 2016


chandlerc accepted this revision.
chandlerc added a comment.
This revision is now accepted and ready to land.

I was going to suggest fancy schmancy ADL stuff for `std::begin` as well, but I dunno that it is worth it. We can add an ADL based dispatcher if anyone comes up with a container that wants it.

LGTM with a nit below.



================
Comment at: include/llvm/ADT/STLExtras.h:573-574
 void DeleteContainerPointers(Container &C) {
-  for (typename Container::iterator I = C.begin(), E = C.end(); I != E; ++I)
-    delete *I;
+  for (auto I : C)
+    delete I;
   C.clear();
----------------
Here and below the `I` previously was an iterator. I'd use `V` as the variable here?


https://reviews.llvm.org/D27009





More information about the llvm-commits mailing list