summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--freefilesync/ffs_no_eraseif.patch407
1 files changed, 407 insertions, 0 deletions
diff --git a/freefilesync/ffs_no_eraseif.patch b/freefilesync/ffs_no_eraseif.patch
new file mode 100644
index 0000000..eaaab38
--- /dev/null
+++ b/freefilesync/ffs_no_eraseif.patch
@@ -0,0 +1,407 @@
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/afs/abstract_impl.h 10.18-2/FreeFileSync/Source/afs/abstract_impl.h
+--- 10.18-1/FreeFileSync/Source/afs/abstract_impl.h 2019-11-20 16:15:55.823668066 -0500
++++ 10.18-2/FreeFileSync/Source/afs/abstract_impl.h 2019-11-20 17:57:30.555558350 -0500
+@@ -255,7 +255,7 @@
+ pathLocks_.access([&](std::map<NativePath, std::weak_ptr<std::mutex>>& pathLocks)
+ {
+ //remove obsolete entries
+- std::erase_if(pathLocks, [](const auto& v) { return !v.second.lock(); });
++ zen::eraseIf(pathLocks, [](const auto& v) { return !v.second.lock(); });
+
+ //get or create mutex
+ std::weak_ptr<std::mutex>& weakPtr = pathLocks[nativePath];
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/afs/gdrive.cpp 10.18-2/FreeFileSync/Source/afs/gdrive.cpp
+--- 10.18-1/FreeFileSync/Source/afs/gdrive.cpp 2019-11-20 16:15:55.828668123 -0500
++++ 10.18-2/FreeFileSync/Source/afs/gdrive.cpp 2019-11-20 17:57:30.556558361 -0500
+@@ -1777,7 +1777,7 @@
+ if (it != itemDetails_.end())
+ {
+ GoogleItemDetails detailsNew = it->second;
+- std::erase_if(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdOld; });
++ eraseIf(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdOld; });
+ notifyItemUpdate(stateDelta, itemId, detailsNew);
+ }
+ else //conflict!!!
+@@ -1792,7 +1792,7 @@
+ GoogleItemDetails detailsNew = it->second;
+ detailsNew.itemName = utfTo<std::string>(newName);
+
+- std::erase_if(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdFrom || id == parentIdTo; }); //
++ eraseIf(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdFrom || id == parentIdTo; }); //
+ detailsNew.parentIds.push_back(parentIdTo); //not a duplicate
+
+ notifyItemUpdate(stateDelta, itemId, detailsNew);
+@@ -1902,7 +1902,7 @@
+ return; //=> avoid misleading changeLog_ entries after Google Drive sync!!!
+
+ //update change logs (and clean up obsolete entries)
+- std::erase_if(changeLog_, [&](std::weak_ptr<ItemIdDelta>& weakPtr)
++ eraseIf(changeLog_, [&](std::weak_ptr<ItemIdDelta>& weakPtr)
+ {
+ if (std::shared_ptr<ItemIdDelta> iid = weakPtr.lock())
+ {
+@@ -1923,8 +1923,8 @@
+
+ std::vector<std::string> parentIdsNew = details->parentIds;
+ std::vector<std::string> parentIdsRemoved = it->second.parentIds;
+- std::erase_if(parentIdsNew, [&](const std::string& id) { return std::find(it->second.parentIds.begin(), it->second.parentIds.end(), id) != it->second.parentIds.end(); });
+- std::erase_if(parentIdsRemoved, [&](const std::string& id) { return std::find(details->parentIds.begin(), details->parentIds.end(), id) != details->parentIds.end(); });
++ eraseIf(parentIdsNew, [&](const std::string& id) { return std::find(it->second.parentIds.begin(), it->second.parentIds.end(), id) != it->second.parentIds.end(); });
++ eraseIf(parentIdsRemoved, [&](const std::string& id) { return std::find(details->parentIds.begin(), details->parentIds.end(), id) != details->parentIds.end(); });
+
+ for (const std::string& parentId : parentIdsNew)
+ folderContents_[parentId].childItems.push_back(it); //new insert => no need for duplicate check
+@@ -1933,7 +1933,7 @@
+ {
+ auto itP = folderContents_.find(parentId);
+ if (itP != folderContents_.end())
+- std::erase_if(itP->second.childItems, [&](auto itChild) { return itChild == it; });
++ eraseIf(itP->second.childItems, [&](auto itChild) { return itChild == it; });
+ }
+ //if all parents are removed, Google Drive will (recursively) delete the item => don't prematurely do this now: wait for change notifications!
+
+@@ -1955,7 +1955,7 @@
+ {
+ auto itP = folderContents_.find(parentId);
+ if (itP != folderContents_.end())
+- std::erase_if(itP->second.childItems, [&](auto itChild) { return itChild == it; });
++ eraseIf(itP->second.childItems, [&](auto itChild) { return itChild == it; });
+ }
+ itemDetails_.erase(it);
+ }
+@@ -1964,7 +1964,7 @@
+ if (itP != folderContents_.end())
+ {
+ for (auto itChild : itP->second.childItems) //2. delete as parent from child items (don't wait for change notifications of children)
+- std::erase_if(itChild->second.parentIds, [&](const std::string& id) { return id == itemId; });
++ eraseIf(itChild->second.parentIds, [&](const std::string& id) { return id == itemId; });
+ folderContents_.erase(itP);
+ }
+ }
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/afs/sftp.cpp 10.18-2/FreeFileSync/Source/afs/sftp.cpp
+--- 10.18-1/FreeFileSync/Source/afs/sftp.cpp 2019-11-20 17:54:23.078438037 -0500
++++ 10.18-2/FreeFileSync/Source/afs/sftp.cpp 2019-11-20 17:57:30.557558372 -0500
+@@ -946,7 +946,7 @@
+ std::this_thread::yield();
+ return; //don't hold lock for too long: delete only one session at a time, then yield...
+ }
+- std::erase_if(sessions.sshSessionsWithThreadAffinity, [](const auto& v) { return !v.second.lock(); }); //clean up dangling weak pointer
++ eraseIf(sessions.sshSessionsWithThreadAffinity, [](const auto& v) { return !v.second.lock(); }); //clean up dangling weak pointer
+ done = true;
+ });
+ }
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/base/algorithm.cpp 10.18-2/FreeFileSync/Source/base/algorithm.cpp
+--- 10.18-1/FreeFileSync/Source/base/algorithm.cpp 2019-11-20 16:15:55.832668168 -0500
++++ 10.18-2/FreeFileSync/Source/base/algorithm.cpp 2019-11-20 17:57:30.558558384 -0500
+@@ -1372,8 +1372,8 @@
+ {
+ std::vector<const FileSystemObject*> itemSelectionLeft (rowsToCopyOnLeft .begin(), rowsToCopyOnLeft .end());
+ std::vector<const FileSystemObject*> itemSelectionRight(rowsToCopyOnRight.begin(), rowsToCopyOnRight.end());
+- std::erase_if(itemSelectionLeft, [](const FileSystemObject* fsObj) { return fsObj->isEmpty< LEFT_SIDE>(); }); //needed for correct stats!
+- std::erase_if(itemSelectionRight, [](const FileSystemObject* fsObj) { return fsObj->isEmpty<RIGHT_SIDE>(); }); //
++ eraseIf(itemSelectionLeft, [](const FileSystemObject* fsObj) { return fsObj->isEmpty< LEFT_SIDE>(); }); //needed for correct stats!
++ eraseIf(itemSelectionRight, [](const FileSystemObject* fsObj) { return fsObj->isEmpty<RIGHT_SIDE>(); }); //
+
+ const int itemTotal = static_cast<int>(itemSelectionLeft.size() + itemSelectionRight.size());
+ int64_t bytesTotal = 0;
+@@ -1548,8 +1548,8 @@
+ std::vector<FileSystemObject*> deleteLeft = rowsToDeleteOnLeft;
+ std::vector<FileSystemObject*> deleteRight = rowsToDeleteOnRight;
+
+- std::erase_if(deleteLeft, [](const FileSystemObject* fsObj) { return fsObj->isEmpty< LEFT_SIDE>(); }); //needed?
+- std::erase_if(deleteRight, [](const FileSystemObject* fsObj) { return fsObj->isEmpty<RIGHT_SIDE>(); }); //yes, for correct stats:
++ eraseIf(deleteLeft, [](const FileSystemObject* fsObj) { return fsObj->isEmpty< LEFT_SIDE>(); }); //needed?
++ eraseIf(deleteRight, [](const FileSystemObject* fsObj) { return fsObj->isEmpty<RIGHT_SIDE>(); }); //yes, for correct stats:
+
+ const int itemCount = static_cast<int>(deleteLeft.size() + deleteRight.size());
+ callback.initNewPhase(itemCount, 0, ProcessPhase::none); //throw X
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/base/db_file.cpp 10.18-2/FreeFileSync/Source/base/db_file.cpp
+--- 10.18-1/FreeFileSync/Source/base/db_file.cpp 2019-11-20 16:15:55.836668213 -0500
++++ 10.18-2/FreeFileSync/Source/base/db_file.cpp 2019-11-20 17:57:30.559558395 -0500
+@@ -591,7 +591,7 @@
+ }
+
+ //delete removed items (= "in-sync") from database
+- std::erase_if(dbFiles, [&](const InSyncFolder::FileList::value_type& v)
++ eraseIf(dbFiles, [&](const InSyncFolder::FileList::value_type& v)
+ {
+ if (contains(toPreserve, v.first))
+ return false;
+@@ -628,7 +628,7 @@
+ }
+
+ //delete removed items (= "in-sync") from database
+- std::erase_if(dbSymlinks, [&](const InSyncFolder::SymlinkList::value_type& v)
++ eraseIf(dbSymlinks, [&](const InSyncFolder::SymlinkList::value_type& v)
+ {
+ if (contains(toPreserve, v.first))
+ return false;
+@@ -663,7 +663,7 @@
+ }
+
+ //delete removed items (= "in-sync") from database
+- std::erase_if(dbFolders, [&](InSyncFolder::FolderList::value_type& v)
++ eraseIf(dbFolders, [&](InSyncFolder::FolderList::value_type& v)
+ {
+ if (auto it = toPreserve.find(v.first); it != toPreserve.end())
+ {
+@@ -687,10 +687,10 @@
+ //delete all entries for removed folder (= "in-sync") from database
+ void dbSetEmptyState(InSyncFolder& dbFolder, const Zstring& parentRelPathPf)
+ {
+- std::erase_if(dbFolder.files, [&](const InSyncFolder::FileList ::value_type& v) { return filter_.passFileFilter(parentRelPathPf + v.first); });
+- std::erase_if(dbFolder.symlinks, [&](const InSyncFolder::SymlinkList::value_type& v) { return filter_.passFileFilter(parentRelPathPf + v.first); });
++ eraseIf(dbFolder.files, [&](const InSyncFolder::FileList ::value_type& v) { return filter_.passFileFilter(parentRelPathPf + v.first); });
++ eraseIf(dbFolder.symlinks, [&](const InSyncFolder::SymlinkList::value_type& v) { return filter_.passFileFilter(parentRelPathPf + v.first); });
+
+- std::erase_if(dbFolder.folders, [&](InSyncFolder::FolderList::value_type& v)
++ eraseIf(dbFolder.folders, [&](InSyncFolder::FolderList::value_type& v)
+ {
+ const Zstring& itemRelPath = parentRelPathPf + v.first;
+
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/base/dir_lock.cpp 10.18-2/FreeFileSync/Source/base/dir_lock.cpp
+--- 10.18-1/FreeFileSync/Source/base/dir_lock.cpp 2019-11-20 16:15:55.836668213 -0500
++++ 10.18-2/FreeFileSync/Source/base/dir_lock.cpp 2019-11-20 17:57:30.559558395 -0500
+@@ -502,8 +502,8 @@
+
+ void tidyUp() //remove obsolete entries
+ {
+- std::erase_if(locksByGuid_, [](const auto& v) { return !v.second.lock(); });
+- std::erase_if(guidByPath_, [&](const auto& v) { return !contains(locksByGuid_, v.second); });
++ eraseIf(locksByGuid_, [](const auto& v) { return !v.second.lock(); });
++ eraseIf(guidByPath_, [&](const auto& v) { return locksByGuid_.find(v.second) == locksByGuid_.end(); });
+ }
+
+ std::map<Zstring, UniqueId> guidByPath_; //lockFilePath |-> GUID; n:1; locks can be referenced by a lockFilePath or alternatively a GUID
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/RealTimeSync/config.cpp 10.18-2/FreeFileSync/Source/RealTimeSync/config.cpp
+--- 10.18-1/FreeFileSync/Source/RealTimeSync/config.cpp 2019-11-20 16:15:55.820668033 -0500
++++ 10.18-2/FreeFileSync/Source/RealTimeSync/config.cpp 2019-11-20 17:57:30.559558395 -0500
+@@ -155,7 +155,7 @@
+ checkXmlMappingErrors(in, filePath); //throw FileError
+ //---------------------------------------------------------------------------------------
+
+- std::erase_if(uniqueFolders, [](const Zstring& str) { return trimCpy(str).empty(); });
++ eraseIf(uniqueFolders, [](const Zstring& str) { return trimCpy(str).empty(); });
+ cfg.directories.assign(uniqueFolders.begin(), uniqueFolders.end());
+ cfg.commandline = Zstr('"') + fff::getFreeFileSyncLauncherPath() + Zstr("\" \"") + filePath + Zstr('"');
+ }
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/RealTimeSync/monitor.cpp 10.18-2/FreeFileSync/Source/RealTimeSync/monitor.cpp
+--- 10.18-1/FreeFileSync/Source/RealTimeSync/monitor.cpp 2019-11-20 16:15:55.822668055 -0500
++++ 10.18-2/FreeFileSync/Source/RealTimeSync/monitor.cpp 2019-11-20 17:57:30.560558406 -0500
+@@ -163,7 +163,7 @@
+ {
+ std::vector<DirWatcher::Entry> changedItems = watcher->getChanges([&] { requestUiUpdate(false /*readyForSync*/); /*throw X*/ },
+ cbInterval); //throw FileError
+- std::erase_if(changedItems, [](const DirWatcher::Entry& e)
++ eraseIf(changedItems, [](const DirWatcher::Entry& e)
+ {
+ return
+ endsWith(e.itemPath, Zstr(".ffs_tmp")) || //sync.8ea2.ffs_tmp
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/RealTimeSync/tray_menu.cpp 10.18-2/FreeFileSync/Source/RealTimeSync/tray_menu.cpp
+--- 10.18-1/FreeFileSync/Source/RealTimeSync/tray_menu.cpp 2019-11-20 16:15:55.822668055 -0500
++++ 10.18-2/FreeFileSync/Source/RealTimeSync/tray_menu.cpp 2019-11-20 17:57:30.560558406 -0500
+@@ -247,7 +247,7 @@
+ rts::AbortReason rts::runFolderMonitor(const XmlRealConfig& config, const wxString& jobname)
+ {
+ std::vector<Zstring> dirNamesNonFmt = config.directories;
+- std::erase_if(dirNamesNonFmt, [](const Zstring& str) { return trimCpy(str).empty(); }); //remove empty entries WITHOUT formatting paths yet!
++ eraseIf(dirNamesNonFmt, [](const Zstring& str) { return trimCpy(str).empty(); }); //remove empty entries WITHOUT formatting paths yet!
+
+ if (dirNamesNonFmt.empty())
+ {
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/cfg_grid.cpp 10.18-2/FreeFileSync/Source/ui/cfg_grid.cpp
+--- 10.18-1/FreeFileSync/Source/ui/cfg_grid.cpp 2019-11-20 16:15:55.847668337 -0500
++++ 10.18-2/FreeFileSync/Source/ui/cfg_grid.cpp 2019-11-20 17:57:30.561558418 -0500
+@@ -113,7 +113,7 @@
+ {
+ const std::set<Zstring, LessNativePath> pathsSorted(filePaths.begin(), filePaths.end());
+
+- std::erase_if(cfgListView_, [&](auto it) { return pathsSorted.find(it->first) != pathsSorted.end(); });
++ eraseIf(cfgListView_, [&](auto it) { return pathsSorted.find(it->first) != pathsSorted.end(); });
+
+ for (const Zstring& filePath : filePaths)
+ cfgList_.erase(filePath);
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/command_box.cpp 10.18-2/FreeFileSync/Source/ui/command_box.cpp
+--- 10.18-1/FreeFileSync/Source/ui/command_box.cpp 2019-11-20 17:54:14.861345102 -0500
++++ 10.18-2/FreeFileSync/Source/ui/command_box.cpp 2019-11-20 17:57:30.561558418 -0500
+@@ -75,7 +75,7 @@
+ equalNoCase(newCommand, cmd))
+ return;
+
+- std::erase_if(history_, [&](const Zstring& item) { return equalNoCase(newCommand, item); });
++ eraseIf(history_, [&](const Zstring& item) { return equalNoCase(newCommand, item); });
+
+ history_.insert(history_.begin(), newCommand);
+
+@@ -194,7 +194,7 @@
+ //this->SetSelection(wxNOT_FOUND);
+
+ //delete selected row
+- std::erase_if(history_, [&](const Zstring& item) { return item == selValue; });
++ eraseIf(history_, [&](const Zstring& item) { return item == selValue; });
+
+ SetString(pos, wxString()); //in contrast to Delete(), this one does not kill the drop-down list and gives a nice visual feedback!
+ //Delete(pos);
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/file_view.cpp 10.18-2/FreeFileSync/Source/ui/file_view.cpp
+--- 10.18-1/FreeFileSync/Source/ui/file_view.cpp 2019-11-20 16:15:55.849668360 -0500
++++ 10.18-2/FreeFileSync/Source/ui/file_view.cpp 2019-11-20 17:57:30.562558429 -0500
+@@ -253,7 +253,7 @@
+ rowPositionsFirstChild_.clear();
+
+ //remove rows that have been deleted meanwhile
+- std::erase_if(sortedRef_, [&](const RefIndex& refIdx) { return !FileSystemObject::retrieve(refIdx.objId); });
++ eraseIf(sortedRef_, [&](const RefIndex& refIdx) { return !FileSystemObject::retrieve(refIdx.objId); });
+ }
+
+
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/folder_history_box.h 10.18-2/FreeFileSync/Source/ui/folder_history_box.h
+--- 10.18-1/FreeFileSync/Source/ui/folder_history_box.h 2019-11-20 16:15:55.849668360 -0500
++++ 10.18-2/FreeFileSync/Source/ui/folder_history_box.h 2019-11-20 17:57:30.562558429 -0500
+@@ -41,7 +41,7 @@
+ const Zstring nameTmp = zen::trimCpy(folderPathPhrase);
+
+ //insert new folder or put it to the front if already existing
+- std::erase_if(folderPathPhrases_, [&](const Zstring& item) { return equalNoCase(item, nameTmp); });
++ zen::eraseIf(folderPathPhrases_, [&](const Zstring& item) { return equalNoCase(item, nameTmp); });
+
+ folderPathPhrases_.insert(folderPathPhrases_.begin(), nameTmp);
+
+@@ -49,7 +49,7 @@
+ folderPathPhrases_.resize(maxSize_);
+ }
+
+- void delItem(const Zstring& folderPathPhrase) { std::erase_if(folderPathPhrases_, [&](const Zstring& item) { return equalNoCase(item, folderPathPhrase); }); }
++ void delItem(const Zstring& folderPathPhrase) { zen::eraseIf(folderPathPhrases_, [&](const Zstring& item) { return equalNoCase(item, folderPathPhrase); }); }
+
+ private:
+ size_t maxSize_ = 0;
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/log_panel.cpp 10.18-2/FreeFileSync/Source/ui/log_panel.cpp
+--- 10.18-1/FreeFileSync/Source/ui/log_panel.cpp 2019-11-20 16:15:55.852668394 -0500
++++ 10.18-2/FreeFileSync/Source/ui/log_panel.cpp 2019-11-20 17:57:30.562558429 -0500
+@@ -545,7 +545,7 @@
+ if (auto prov = m_gridMessages->getDataProvider())
+ {
+ std::vector<Grid::ColAttributes> colAttr = m_gridMessages->getColumnConfig();
+- std::erase_if(colAttr, [](const Grid::ColAttributes& ca) { return !ca.visible; });
++ eraseIf(colAttr, [](const Grid::ColAttributes& ca) { return !ca.visible; });
+ if (!colAttr.empty())
+ for (size_t row : m_gridMessages->getSelectedRows())
+ {
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/main_dlg.cpp 10.18-2/FreeFileSync/Source/ui/main_dlg.cpp
+--- 10.18-1/FreeFileSync/Source/ui/main_dlg.cpp 2019-11-20 17:54:16.135359512 -0500
++++ 10.18-2/FreeFileSync/Source/ui/main_dlg.cpp 2019-11-20 17:57:30.564558452 -0500
+@@ -1240,7 +1240,7 @@
+ if (auto prov = grid->getDataProvider())
+ {
+ std::vector<Grid::ColAttributes> colAttr = grid->getColumnConfig();
+- std::erase_if(colAttr, [](const Grid::ColAttributes& ca) { return !ca.visible; });
++ eraseIf(colAttr, [](const Grid::ColAttributes& ca) { return !ca.visible; });
+ if (!colAttr.empty())
+ for (size_t row : grid->getSelectedRows())
+ {
+@@ -5372,9 +5372,9 @@
+ auto colAttrCenter = m_gridMainC->getColumnConfig();
+ auto colAttrRight = m_gridMainR->getColumnConfig();
+
+- std::erase_if(colAttrLeft, [](const Grid::ColAttributes& ca) { return !ca.visible; });
+- std::erase_if(colAttrCenter, [](const Grid::ColAttributes& ca) { return !ca.visible || static_cast<ColumnTypeCenter>(ca.type) == ColumnTypeCenter::CHECKBOX; });
+- std::erase_if(colAttrRight, [](const Grid::ColAttributes& ca) { return !ca.visible; });
++ eraseIf(colAttrLeft, [](const Grid::ColAttributes& ca) { return !ca.visible; });
++ eraseIf(colAttrCenter, [](const Grid::ColAttributes& ca) { return !ca.visible || static_cast<ColumnTypeCenter>(ca.type) == ColumnTypeCenter::CHECKBOX; });
++ eraseIf(colAttrRight, [](const Grid::ColAttributes& ca) { return !ca.visible; });
+
+ if (provLeft && provCenter && provRight)
+ {
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/search_grid.cpp 10.18-2/FreeFileSync/Source/ui/search_grid.cpp
+--- 10.18-1/FreeFileSync/Source/ui/search_grid.cpp 2019-11-20 16:15:55.855668428 -0500
++++ 10.18-2/FreeFileSync/Source/ui/search_grid.cpp 2019-11-20 17:57:30.564558452 -0500
+@@ -69,7 +69,7 @@
+ if (auto prov = grid.getDataProvider())
+ {
+ std::vector<Grid::ColAttributes> colAttr = grid.getColumnConfig();
+- std::erase_if(colAttr, [](const Grid::ColAttributes& ca) { return !ca.visible; });
++ eraseIf(colAttr, [](const Grid::ColAttributes& ca) { return !ca.visible; });
+ if (!colAttr.empty())
+ {
+ const MatchFound<respectCase> matchFound(searchString);
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/ui/tree_grid.cpp 10.18-2/FreeFileSync/Source/ui/tree_grid.cpp
+--- 10.18-1/FreeFileSync/Source/ui/tree_grid.cpp 2019-11-20 16:15:55.858668462 -0500
++++ 10.18-2/FreeFileSync/Source/ui/tree_grid.cpp 2019-11-20 17:57:30.565558463 -0500
+@@ -601,7 +601,7 @@
+ folderCmp_ = newData;
+
+ //remove truly empty folder pairs as early as this: we want to distinguish single/multiple folder pair cases by looking at "folderCmp"
+- std::erase_if(folderCmp_, [](const std::shared_ptr<BaseFolderPair>& baseObj)
++ eraseIf(folderCmp_, [](const std::shared_ptr<BaseFolderPair>& baseObj)
+ {
+ return AFS::isNullPath(baseObj->getAbstractPath< LEFT_SIDE>()) &&
+ AFS::isNullPath(baseObj->getAbstractPath<RIGHT_SIDE>());
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/wx+/async_task.h 10.18-2/wx+/async_task.h
+--- 10.18-1/wx+/async_task.h 2019-11-20 16:15:55.860668484 -0500
++++ 10.18-2/wx+/async_task.h 2019-11-20 17:57:30.565558463 -0500
+@@ -85,7 +85,7 @@
+
+ std::vector<std::unique_ptr<Task>> readyTasks; //Reentrancy; access to AsyncTasks::add is not protected! => evaluate outside eraseIf
+
+- std::erase_if(tasks_, [&](std::unique_ptr<Task>& task)
++ eraseIf(tasks_, [&](std::unique_ptr<Task>& task)
+ {
+ if (task->resultReady())
+ {
+diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/zen/stl_tools.h 10.18-2/zen/stl_tools.h
+--- 10.18-1/zen/stl_tools.h 2019-11-20 16:15:55.875668653 -0500
++++ 10.18-2/zen/stl_tools.h 2019-11-20 17:58:20.801126674 -0500
+@@ -20,6 +20,16 @@
+ //enhancements for <algorithm>
+ namespace zen
+ {
++//erase selected elements from any container:
++template <class T, class Alloc, class Predicate>
++void eraseIf(std::vector<T, Alloc>& v, Predicate p);
++
++template <class T, class LessType, class Alloc, class Predicate>
++void eraseIf(std::set<T, LessType, Alloc>& s, Predicate p);
++
++template <class KeyType, class ValueType, class LessType, class Alloc, class Predicate>
++void eraseIf(std::map<KeyType, ValueType, LessType, Alloc>& m, Predicate p);
++
+ //append STL containers
+ template <class T, class Alloc, class C>
+ void append(std::vector<T, Alloc>& v, const C& c);
+@@ -115,6 +125,36 @@
+
+
+ //######################## implementation ########################
++
++template <class T, class Alloc, class Predicate> inline
++void eraseIf(std::vector<T, Alloc>& v, Predicate p)
++{
++ v.erase(std::remove_if(v.begin(), v.end(), p), v.end());
++}
++
++
++namespace impl
++{
++template <class S, class Predicate> inline
++void setOrMapEraseIf(S& s, Predicate p)
++{
++ for (auto it = s.begin(); it != s.end();)
++ if (p(*it))
++ s.erase(it++);
++ else
++ ++it;
++}
++}
++
++
++template <class T, class LessType, class Alloc, class Predicate> inline
++void eraseIf(std::set<T, LessType, Alloc>& s, Predicate p) { impl::setOrMapEraseIf(s, p); } //don't make this any more generic! e.g. must not compile for std::vector!!!
++
++
++template <class KeyType, class ValueType, class LessType, class Alloc, class Predicate> inline
++void eraseIf(std::map<KeyType, ValueType, LessType, Alloc>& m, Predicate p) { impl::setOrMapEraseIf(m, p); }
++
++
+ template <class T, class Alloc, class C> inline
+ void append(std::vector<T, Alloc>& v, const C& c) { v.insert(v.end(), c.begin(), c.end()); }
+
bgstack15