Fix compilation issues with C++17

Testable on Linux/macOS by changing c++14 to c++1z in qtcreator.pri.
Testable with latest MSVC2017 by setting _CL_=/std:c++17.

unary_function, binary_function, and a few other things that were
deprecated are removed in C++17.
std::string got a non-const overload for its "data" member function,
so we cannot create a function pointer on it without specifying its
type. Use std::declval instead (though it requires a default constructor
for the type).

MSVC seems to have an issue with Utils::transform for std::vector
(used in Nim plugin), but that looks like a compiler issue.

Change-Id: I94f9a93d591d55b610f86fabfc618158927d6221
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2018-05-31 11:31:59 +02:00
parent 8798990fb1
commit f8e88e8ce4
12 changed files with 42 additions and 19 deletions

View File

@@ -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<const TemplateNameId *, const TemplateNameId *, bool> {
struct Compare {
bool operator()(const TemplateNameId *name, const TemplateNameId *other) const;
};