Commit 02dedf89 authored by Volker Krause's avatar Volker Krause
Browse files

Replace std::binary_function usage with a lambda

std::binary_function is removed in C++17, and the lambda is perfectly
fine here.
parent 42e50bdb
Pipeline #58548 passed with stage
in 10 minutes and 31 seconds
...@@ -23,13 +23,6 @@ ...@@ -23,13 +23,6 @@
using namespace ContactEditor; using namespace ContactEditor;
struct LocaleAwareLessThan : std::binary_function<QString, QString, bool> {
bool operator()(const QString &s1, const QString &s2) const
{
return QString::localeAwareCompare(s1, s2) < 0;
}
};
AddressLocationWidget::AddressLocationWidget(QWidget *parent) AddressLocationWidget::AddressLocationWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
, mCurrentMode(CreateAddress) , mCurrentMode(CreateAddress)
...@@ -200,7 +193,9 @@ void AddressLocationWidget::fillCountryCombo() ...@@ -200,7 +193,9 @@ void AddressLocationWidget::fillCountryCombo()
countries.append(localeStr); countries.append(localeStr);
} }
std::sort(countries.begin(), countries.end(), LocaleAwareLessThan()); std::sort(countries.begin(), countries.end(), [](const auto &s1, const auto &s2) {
return QString::localeAwareCompare(s1, s2) < 0;
});
mCountryCombo->addItems(countries); mCountryCombo->addItems(countries);
mCountryCombo->setAutoCompletion(true); mCountryCombo->setAutoCompletion(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment