]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
hinted insert operations for flat_set
authorAlex Coyte <a.coyte@intel.com>
Thu, 1 Sep 2016 04:40:17 +0000 (14:40 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 28 Oct 2016 03:48:55 +0000 (14:48 +1100)
src/util/ue2_containers.h

index 217d08ea583ca152b7c0717085bd17a4e91afbf4..b6425f775a6faf133dd919a568784b5a1ada95b1 100644 (file)
@@ -207,6 +207,10 @@ public:
         return std::make_pair(iterator(it), false);
     }
 
+    iterator insert(UNUSED const_iterator hint, const value_type &value) {
+        return insert(value).first;
+    }
+
     std::pair<iterator, bool> insert(value_type &&value) {
         auto it = std::lower_bound(data.begin(), data.end(), value, comp);
         if (it == data.end() || comp(value, *it)) {
@@ -216,6 +220,10 @@ public:
         return std::make_pair(iterator(it), false);
     }
 
+    iterator insert(UNUSED const_iterator hint, value_type &&value) {
+        return insert(value).first;
+    }
+
     template <class InputIt>
     void insert(InputIt first, InputIt second) {
         for (; first != second; ++first) {