Compiling for non-c++20 environments

Get help for specific problems
Posts: 306
Joined: 7 Jan 2018

bgstack15

I have begun my packaging efforts for CentOS and Fedora. It appears that for CentOS 7 and 8 and Fedora 29 do not have c++2a even when CentOS is using devtoolset-8. I think I will have to revert the use of std::erase_if to the previously-included zen::eraseIf.

Would you please consider leaving that function in the source code? I don't mind having to write a patch to use the old function as needed, but I think it would be nice if you could leave your local implementation of the function there. Obviously, if I'm patching I can add it back from your previous version, but it's a small thing, right?
<command-line>: note: this is the location of the previous definition
base/algorithm.cpp: In function 'void fff::copyToAlternateFolder(std::span<const fff::FileSystemObject* const>, std::span<const fff::FileSystemObject* const>, const Zstring&, bool, bool, fff::WarningDialogs&, fff::ProcessCallback&)':
base/algorithm.cpp:1375:10: error: 'erase_if' is not a member of 'std'
     std::erase_if(itemSelectionLeft,  [](const FileSystemObject* fsObj) { return fsObj->isEmpty< LEFT_SIDE>(); }); //needed for correct stats!
          ^~~~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:117: /tmp/FreeFileSync_Make/ffs/src/base/algorithm.cpp.o] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.WipODg (%build)