diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-09-24 17:37:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-25 09:28:31 +0200 |
commit | b13421011d9377676e1adc282634991d5064a866 (patch) | |
tree | e1e73c7c200fa119dd5860d65b6fa1a4cbb814ac /include/o3tl | |
parent | 4d960908094292c9bac925976ac489c46a6127e9 (diff) |
better data structures for some static const vars
use compact, cache-friendly structures for some static const stuff
and add a std::initialiser_list constructor to o3tl::sorted_vector
Change-Id: I6a6049bf19a7f48dae1843a81cd2257944ada9d5
Reviewed-on: https://gerrit.libreoffice.org/79470
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/o3tl')
-rw-r--r-- | include/o3tl/sorted_vector.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx index 35882ab9afca..527f34e568c7 100644 --- a/include/o3tl/sorted_vector.hxx +++ b/include/o3tl/sorted_vector.hxx @@ -45,6 +45,18 @@ public: typedef typename std::vector<Value>::difference_type difference_type; typedef typename std::vector<Value>::size_type size_type; + sorted_vector( std::initializer_list<Value> init ) + : m_vector(init) + { + Resort(); + } + sorted_vector() = default; + sorted_vector(sorted_vector const&) = default; + sorted_vector(sorted_vector&&) = default; + + sorted_vector& operator=(sorted_vector const&) = default; + sorted_vector& operator=(sorted_vector&&) = default; + // MODIFIERS std::pair<const_iterator,bool> insert( Value&& x ) |