summaryrefslogtreecommitdiff
path: root/o3tl/qa/test-sorted_vector.cxx
AgeCommit message (Collapse)Author
2015-06-11cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: Id6291335945a8f10cef3afd1a2b3bae65fdf4562
2014-05-22Fix memory leaks in test codeStephan Bergmann
Change-Id: I0dbb2546f1e776ebf95b61c16ebedbce0ead4c7f
2014-05-02coverity#1209778 & coverity#1209777 Resource leakChris Sherlock
Have testBasics_FindPtr() cleanup after itself by deleting p2 and p4. Change-Id: I88b5efd25941d135b743f759a8f27c1cdbcb43c0
2014-05-02coverity#1209779 & coverity#1209780 Resource leakChris Sherlock
Have the testBasics() function clean up after itself - delete p2 and p4 at the end of the function. Change-Id: Ib0c732e1962da94fde0e0da307f610dd36f49eda
2014-02-23Remove unneccessary commentsAlexander Wilms
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb Reviewed-on: https://gerrit.libreoffice.org/8182 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-05-08coverity#983036/37/38: Resource leakJulien Nabet
Change-Id: I8a2c079a60cc06ca82d9f516cf009359a0c083a7 Reviewed-on: https://gerrit.libreoffice.org/3819 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
2012-08-02Revert "Revert "sorted_vector: turn Find parameter into template""Michael Stahl
This reverts commit 8291d41667b1a63d35bf818aaf9d75529e1f12f0. Un-revert that, with a tweak: with the bizarre name lookup semantics in C++, the proper way to refer to a template (as opposed to a template instance) is by prefixing the name with its namespace, which does seem to work with MSVC2008 & GCC 4.7; thanks to Stephan Bergmann for the hint. Change-Id: Id9cccbe68fb3ce2dd070c4b3dbd21782c92170ca
2012-08-01Revert "sorted_vector: turn Find parameter into template"Michael Stahl
This reverts commit 3e3acee762fac71f7356ed1305a64e0278278081. It was a nice idea, but C++ is not yet ready for it; with the travesty of parametric polymorphism in C++ the find_unique inside the definition of find_unique actually refers to find_unique<Value, Compare>, so there is no way to actually refer to template<Value, Compare> find_unique inside its definition. Thanks to Luboš Luňák for explaining the problem to me. Somehow this does work in GCC 4.7 even with -std=c++98, likely by accident.
2012-08-01sorted_vector: turn Find parameter into templateMichael Stahl
Enforces same type parameters for sorted_vector and Find, and makes it easier to use. Change-Id: Ide456a48f015cb0a9dea7a0bf2bcf2ccad527fd1
2012-07-31sorted_vector: add an additional template parameter:Michael Stahl
The Find parameter allows to implement sorted_vector that uses the obvious std::less-like semantics, and also allows for a different semantics where the array is sorted like std::less but duplicate values (according to std::less) are allowed except if they're actually the same object (pointer equality). Change-Id: Id54871c336ddbc2d0a2272bcc81c56914943b449
2012-07-17Add erase(size_t) method to o3tl::sorted_vectorNoel Grandin
I can't add a regular erase(iterator) method because we only hand out const_iterator's Change-Id: Ia3bdecb0f909d0712138c7ee48da268951e2733b
2012-07-17Improvements to sorted_vectorNoel Grandin
Implement suggestionss from David Tardon, mostly around prohibiting access that could result in the vector becoming unsorted. Add front() and back() accessors. Add lower_bound() method. Add optimised insert() method. Change-Id: Icbb3597277f3e5963573b57d4f6d3cb740e896e6
2012-07-12Create a template container class for sorted vectorNoel Grandin
We use this kind of container a lot, so creating a single implementation makes sense. Change-Id: I67ead58becd7d2a287812145c11d93ab1c593c0f