[algs] Add hb_swap() ala, and using, std::swap()

Use it in vector.

Use ADL idiom.
diff --git a/src/hb-algs.hh b/src/hb-algs.hh
index bbe097f..fc1aeb0 100644
--- a/src/hb-algs.hh
+++ b/src/hb-algs.hh
@@ -34,6 +34,7 @@
 #include "hb-null.hh"
 #include "hb-number.hh"
 
+#include <algorithm>
 
 /*
  * Flags
@@ -533,6 +534,16 @@
 }
 HB_FUNCOBJ (hb_clamp);
 
+struct
+{
+  template <typename T> void
+  operator () (T& a, T& b) const
+  {
+    using std::swap; // allow ADL
+    swap (a, b);
+  }
+}
+HB_FUNCOBJ (hb_swap);
 
 /*
  * Bithacks.
diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh
index 7339eeb..72b3185 100644
--- a/src/hb-repacker.hh
+++ b/src/hb-repacker.hh
@@ -274,7 +274,7 @@
 
     remap_all_obj_indices (id_map, &sorted_graph);
 
-    vertices_.swap (sorted_graph);
+    hb_swap (vertices_, sorted_graph);
     sorted_graph.fini_deep ();
   }
 
@@ -334,7 +334,7 @@
 
     remap_all_obj_indices (id_map, &sorted_graph);
 
-    vertices_.swap (sorted_graph);
+    hb_swap (vertices_, sorted_graph);
     sorted_graph.fini_deep ();
   }
 
diff --git a/src/hb-vector.hh b/src/hb-vector.hh
index 95b5295..44c174d 100644
--- a/src/hb-vector.hh
+++ b/src/hb-vector.hh
@@ -87,19 +87,11 @@
     resize (0);
   }
 
-  void swap (hb_vector_t& other)
+  friend void swap (hb_vector_t& a, hb_vector_t& b)
   {
-    int allocated_copy = allocated;
-    unsigned int length_copy = length;
-    Type *arrayZ_copy = arrayZ;
-
-    allocated = other.allocated;
-    length = other.length;
-    arrayZ = other.arrayZ;
-
-    other.allocated = allocated_copy;
-    other.length = length_copy;
-    other.arrayZ = arrayZ_copy;
+    hb_swap (a.allocated, b.allocated);
+    hb_swap (a.length, b.length);
+    hb_swap (a.arrayZ, b.arrayZ);
   }
 
   hb_vector_t& operator = (const hb_vector_t &o)