diff options
author | B. Stack <bgstack15@gmail.com> | 2021-05-10 08:05:45 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2021-05-10 08:05:45 -0400 |
commit | 0d0f8635218a2893fcd00385019089253474f634 (patch) | |
tree | 9261c60b81eb28e068f0f2f44fd8e60214462b2a /wx+/grid.h | |
parent | Merge branch '11.9' into 'master' (diff) | |
download | FreeFileSync-0d0f8635218a2893fcd00385019089253474f634.tar.gz FreeFileSync-0d0f8635218a2893fcd00385019089253474f634.tar.bz2 FreeFileSync-0d0f8635218a2893fcd00385019089253474f634.zip |
add upstream 11.10
Diffstat (limited to 'wx+/grid.h')
-rw-r--r-- | wx+/grid.h | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -12,6 +12,7 @@ #include <optional> #include <set> #include <vector> +#include <zen/stl_tools.h> //#include <zen/basic_math.h> #include <wx/scrolwin.h> @@ -366,18 +367,9 @@ private: template <class ColAttrReal> std::vector<ColAttrReal> makeConsistent(const std::vector<ColAttrReal>& attribs, const std::vector<ColAttrReal>& defaults) { - using ColTypeReal = decltype(ColAttrReal().type); - std::vector<ColAttrReal> output; - - std::set<ColTypeReal> usedTypes; //remove duplicates - auto appendUnique = [&](const std::vector<ColAttrReal>& attr) - { - std::copy_if(attr.begin(), attr.end(), std::back_inserter(output), - [&](const ColAttrReal& a) { return usedTypes.insert(a.type).second; }); - }; - appendUnique(attribs); - appendUnique(defaults); //make sure each type is existing! - + std::vector<ColAttrReal> output = attribs; + append(output, defaults); //make sure each type is existing! + removeDuplicatesStable(output, [](const ColAttrReal& lhs, const ColAttrReal& rhs) { return lhs.type < rhs.type; }); return output; } |