diff --git a/src/libs/3rdparty/botan/botan.cpp b/src/libs/3rdparty/botan/botan.cpp index 87736d5fe3b..0d912062b32 100644 --- a/src/libs/3rdparty/botan/botan.cpp +++ b/src/libs/3rdparty/botan/botan.cpp @@ -465,7 +465,7 @@ inline V search_map(const std::map& mapping, * Function adaptor for delete operation */ template -class del_fun : public std::unary_function +class del_fun { public: void operator()(T* ptr) { delete ptr; } diff --git a/src/libs/3rdparty/cplusplus/Name.h b/src/libs/3rdparty/cplusplus/Name.h index 200ccac75d4..460f0bca11b 100644 --- a/src/libs/3rdparty/cplusplus/Name.h +++ b/src/libs/3rdparty/cplusplus/Name.h @@ -59,7 +59,7 @@ public: bool match(const Name *other, Matcher *matcher = 0) const; public: - struct Compare: std::binary_function { + struct Compare { bool operator()(const Name *name, const Name *other) const; }; diff --git a/src/libs/3rdparty/cplusplus/Names.h b/src/libs/3rdparty/cplusplus/Names.h index 41f3e761b41..b8d090da2fe 100644 --- a/src/libs/3rdparty/cplusplus/Names.h +++ b/src/libs/3rdparty/cplusplus/Names.h @@ -101,7 +101,7 @@ public: bool isSpecialization() const { return _isSpecialization; } // Comparator needed to distinguish between two different TemplateNameId(e.g.:used in std::map) - struct Compare: std::binary_function { + struct Compare { bool operator()(const TemplateNameId *name, const TemplateNameId *other) const; }; diff --git a/src/libs/glsl/glslengine.h b/src/libs/glsl/glslengine.h index 6b126111f66..7cf6e2d1644 100644 --- a/src/libs/glsl/glslengine.h +++ b/src/libs/glsl/glslengine.h @@ -71,7 +71,7 @@ template class TypeTable { public: - struct Compare: std::binary_function { + struct Compare { bool operator()(const Type &value, const Type &other) const { return value.isLessThan(&other); } diff --git a/src/libs/qtcreatorcdbext/containers.cpp b/src/libs/qtcreatorcdbext/containers.cpp index 1248fca175c..128f450cafa 100644 --- a/src/libs/qtcreatorcdbext/containers.cpp +++ b/src/libs/qtcreatorcdbext/containers.cpp @@ -245,7 +245,7 @@ AbstractSymbolGroupNodePtrVector linkedListChildList(SymbolGroupValue headNode, } // Helper function for linkedListChildList that returns a member by name -class MemberByName : public std::unary_function +class MemberByName { public: explicit MemberByName(const char *name) : m_name(name) {} diff --git a/src/libs/qtcreatorcdbext/stringutils.h b/src/libs/qtcreatorcdbext/stringutils.h index 89316d7e9ad..e8297d44a44 100644 --- a/src/libs/qtcreatorcdbext/stringutils.h +++ b/src/libs/qtcreatorcdbext/stringutils.h @@ -52,7 +52,7 @@ void split(const std::string &s, char sep, Iterator it) // A boolean predicate that can be used for grepping sequences // of strings for a 'needle' substring. -class SubStringPredicate : public std::unary_function +class SubStringPredicate { public: explicit SubStringPredicate(const char *needle) : m_needle(needle) {} diff --git a/src/libs/qtcreatorcdbext/symbolgroup.cpp b/src/libs/qtcreatorcdbext/symbolgroup.cpp index 5ea3e8930e1..52cf5d1645f 100644 --- a/src/libs/qtcreatorcdbext/symbolgroup.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroup.cpp @@ -251,7 +251,7 @@ std::string SymbolGroup::debug(const std::string &iname, typedef std::pair InamePathEntry; -struct InamePathEntryLessThan : public std::binary_function { +struct InamePathEntryLessThan bool operator()(const InamePathEntry &i1, const InamePathEntry& i2) const { if (i1.first < i2.first) diff --git a/src/libs/utils/smallstringview.h b/src/libs/utils/smallstringview.h index 0d8600e5dee..7881500ce68 100644 --- a/src/libs/utils/smallstringview.h +++ b/src/libs/utils/smallstringview.h @@ -39,9 +39,7 @@ using enable_if_has_char_data_pointer = typename std::enable_if_t< std::is_same< std::remove_const_t< std::remove_pointer_t< - std::result_of_t< - decltype(&String::data)(String) - > + decltype(std::declval().data()) > >, char>::value , int>; diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index d2ae4e9f43b..b017cb7e8fc 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -168,7 +168,7 @@ static QList fullIdForSymbol(CPlusPlus::Symbol *symbol) namespace { -class ProcessFile: public std::unary_function > +class ProcessFile { const WorkingCopy workingCopy; const CPlusPlus::Snapshot snapshot; @@ -177,6 +177,10 @@ class ProcessFile: public std::unary_function > QFutureInterface *future; public: + // needed by QtConcurrent + using argument_type = const Utils::FileName &; + using result_type = QList; + ProcessFile(const WorkingCopy &workingCopy, const CPlusPlus::Snapshot snapshot, CPlusPlus::Document::Ptr symbolDocument, @@ -230,7 +234,7 @@ public: } }; -class UpdateUI: public std::binary_function &, QList, void> +class UpdateUI { QFutureInterface *future; @@ -596,7 +600,7 @@ static void searchFinished(SearchResult *search, QFutureWatcher > +class FindMacroUsesInFile { const WorkingCopy workingCopy; const CPlusPlus::Snapshot snapshot; @@ -604,6 +608,10 @@ class FindMacroUsesInFile: public std::unary_function *future; public: + // needed by QtConcurrent + using argument_type = const Utils::FileName &; + using result_type = QList; + FindMacroUsesInFile(const WorkingCopy &workingCopy, const CPlusPlus::Snapshot snapshot, const CPlusPlus::Macro ¯o, diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index 7806d9c385e..af2750de0ce 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -683,7 +683,7 @@ static QString matchingLine(unsigned position, const QString &source) return source.mid(start, end - start); } -class ProcessFile: public std::unary_function > +class ProcessFile { ContextPtr context; typedef FindReferences::Usage Usage; @@ -692,6 +692,10 @@ class ProcessFile: public std::unary_function *future; public: + // needed by QtConcurrent + using argument_type = const QString &; + using result_type = QList; + ProcessFile(const ContextPtr &context, QString name, const ObjectValue *scope, @@ -721,7 +725,7 @@ public: } }; -class SearchFileForType: public std::unary_function > +class SearchFileForType { ContextPtr context; typedef FindReferences::Usage Usage; @@ -730,6 +734,10 @@ class SearchFileForType: public std::unary_function *future; public: + // needed by QtConcurrent + using argument_type = const QString &; + using result_type = QList; + SearchFileForType(const ContextPtr &context, QString name, const ObjectValue *scope, @@ -759,12 +767,17 @@ public: } }; -class UpdateUI: public std::binary_function &, QList, void> +class UpdateUI { typedef FindReferences::Usage Usage; QFutureInterface *future; public: + // needed by QtConcurrent + using first_argument_type = QList &; + using second_argument_type = const QList &; + using result_type = void; + UpdateUI(QFutureInterface *future): future(future) {} void operator()(QList &, const QList &usages) diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 718ea5e6e94..65bb8d5717b 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -59,7 +59,7 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) QList mibs = QTextCodec::availableMibs(); Utils::sort(mibs); QList::iterator firstNonNegative = - std::find_if(mibs.begin(), mibs.end(), std::bind2nd(std::greater_equal(), 0)); + std::find_if(mibs.begin(), mibs.end(), [](int n) { return n >=0; }); if (firstNonNegative != mibs.end()) std::rotate(mibs.begin(), firstNonNegative, mibs.end()); foreach (int mib, mibs) { diff --git a/src/plugins/texteditor/generichighlighter/rule.cpp b/src/plugins/texteditor/generichighlighter/rule.cpp index 29be2fe6a39..701c6ac4598 100644 --- a/src/plugins/texteditor/generichighlighter/rule.cpp +++ b/src/plugins/texteditor/generichighlighter/rule.cpp @@ -144,7 +144,9 @@ bool Rule::charPredicateMatchSucceed(const QString &text, ProgressData *progress, bool (QChar::* predicate)() const) const { - return predicateMatchSucceed(text, length, progress, std::mem_fun_ref(predicate)); + return predicateMatchSucceed(text, length, progress, [predicate](const QChar &c) { + return (c.*predicate)(); + }); } bool Rule::charPredicateMatchSucceed(const QString &text, @@ -152,7 +154,9 @@ bool Rule::charPredicateMatchSucceed(const QString &text, ProgressData *progress, bool (*predicate)(const QChar &)) const { - return predicateMatchSucceed(text, length, progress, std::ptr_fun(predicate)); + return predicateMatchSucceed(text, length, progress, [predicate](const QChar &c) { + return predicate(c); + }); } bool Rule::matchSucceed(const QString &text, const int length, ProgressData *progress)