C++: update for c++20 and fix some syntax errors
Differential Revision: https://phabricator.kde.org/D13394