summaryrefslogtreecommitdiff
path: root/include/o3tl/sorted_vector.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-03 14:04:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-04 12:46:33 +0200
commit04c5f27e8f904f01b1dbfba2b95ed57a9e439f91 (patch)
treee08182c40b46701a6ae59291e9d6f365fb4a0818 /include/o3tl/sorted_vector.hxx
parent70b125c68eed7d99063f7599ea71b2831d2aed30 (diff)
loplugin:useuniqueptr in SetGetExpFields
and a couple more utility methods to o3tl::sorted_vector to make this easier Change-Id: Iebbbb8899b67fffa1ac98ae46b7fa70a7e35f866 Reviewed-on: https://gerrit.libreoffice.org/61344 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/o3tl/sorted_vector.hxx')
-rw-r--r--include/o3tl/sorted_vector.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx
index 7c95a1ace24e..6e245353fe70 100644
--- a/include/o3tl/sorted_vector.hxx
+++ b/include/o3tl/sorted_vector.hxx
@@ -243,6 +243,26 @@ public:
tmp.release();
return ret;
}
+ /**
+ * implement upper_bound for sorted_vectors containing std::unique_ptr
+ */
+ typename super_sorted_vector::const_iterator upper_bound( typename Value::element_type const * x ) const
+ {
+ Value tmp(const_cast<typename Value::element_type*>(x));
+ auto ret = super_sorted_vector::upper_bound(tmp);
+ tmp.release();
+ return ret;
+ }
+ /**
+ * implement lower_bound for sorted_vectors containing std::unique_ptr
+ */
+ typename super_sorted_vector::const_iterator lower_bound( typename Value::element_type const * x ) const
+ {
+ Value tmp(const_cast<typename Value::element_type*>(x));
+ auto ret = super_sorted_vector::lower_bound(tmp);
+ tmp.release();
+ return ret;
+ }
};