From 0d0f8635218a2893fcd00385019089253474f634 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Mon, 10 May 2021 08:05:45 -0400 Subject: add upstream 11.10 --- wx+/grid.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'wx+/grid.h') diff --git a/wx+/grid.h b/wx+/grid.h index 4de76b66..8ab03932 100644 --- a/wx+/grid.h +++ b/wx+/grid.h @@ -12,6 +12,7 @@ #include #include #include +#include //#include #include @@ -366,18 +367,9 @@ private: template std::vector makeConsistent(const std::vector& attribs, const std::vector& defaults) { - using ColTypeReal = decltype(ColAttrReal().type); - std::vector output; - - std::set usedTypes; //remove duplicates - auto appendUnique = [&](const std::vector& 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 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; } -- cgit