mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
修复C++20标准编译不通过
This commit is contained in:
parent
9f97c99862
commit
476178cb3c
|
@ -11,6 +11,7 @@
|
||||||
#include <QtAlgorithms>
|
#include <QtAlgorithms>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include "favoritespanewidget.hh"
|
#include "favoritespanewidget.hh"
|
||||||
#include "gddebug.hh"
|
#include "gddebug.hh"
|
||||||
|
@ -908,7 +909,11 @@ void FavoritesModel::removeItemsForIndexes( const QModelIndexList & idxList )
|
||||||
{
|
{
|
||||||
QModelIndexList idxSublist = itemsToDelete[ i ];
|
QModelIndexList idxSublist = itemsToDelete[ i ];
|
||||||
// std::greater does not work as operator < not implemented
|
// std::greater does not work as operator < not implemented
|
||||||
|
#if __cplusplus >= 201703L
|
||||||
|
std::sort( idxSublist.begin(), idxSublist.end(), std::not_fn( std::less< QModelIndex >() ) );
|
||||||
|
#else
|
||||||
std::sort( idxSublist.begin(), idxSublist.end(), std::not2( std::less< QModelIndex >() ) );
|
std::sort( idxSublist.begin(), idxSublist.end(), std::not2( std::less< QModelIndex >() ) );
|
||||||
|
#endif
|
||||||
|
|
||||||
it = idxSublist.begin();
|
it = idxSublist.begin();
|
||||||
for( ; it != idxSublist.end(); ++it )
|
for( ; it != idxSublist.end(); ++it )
|
||||||
|
|
Loading…
Reference in a new issue