Skip to content

Commit b8c6f5d

Browse files
committed
Make the generator compile with C++17
- remove unneeded inheritance from binary_function - replace auto_ptr with unique_ptr (do not use make_unique, which is not in C++11)
1 parent 10f9576 commit b8c6f5d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

generator/parser/rpp/pp-internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@ inline bool comment_p (InputIterator _first, InputIterator _last) /*const*/
9898
return (*_first == '/' || *_first == '*');
9999
}
100100

101-
struct _Compare_string: public std::binary_function<bool, pp_fast_string const *, pp_fast_string const *>
101+
struct _Compare_string
102102
{
103103
inline bool operator () (pp_fast_string const *__lhs, pp_fast_string const *__rhs) const
104104
{ return *__lhs < *__rhs; }
105105
};
106106

107-
struct _Equal_to_string: public std::binary_function<bool, pp_fast_string const *, pp_fast_string const *>
107+
struct _Equal_to_string
108108
{
109109
inline bool operator () (pp_fast_string const *__lhs, pp_fast_string const *__rhs) const
110110
{ return *__lhs == *__rhs; }
111111
};
112112

113-
struct _Hash_string: public std::unary_function<std::size_t, pp_fast_string const *>
113+
struct _Hash_string
114114
{
115115
inline std::size_t operator () (pp_fast_string const *__s) const
116116
{

generator/typesystem.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ bool Handler::startElement(const QString &, const QString &n,
446446
return importFileElement(atts);
447447
}
448448

449-
std::auto_ptr<StackElement> element(new StackElement(current));
449+
std::unique_ptr<StackElement> element(new StackElement(current));
450450

451451
if (!tagNames.contains(tagName)) {
452452
m_error = QString("Unknown tag name: '%1'").arg(tagName);
@@ -1486,6 +1486,7 @@ TypeDatabase::TypeDatabase() : m_suppressWarnings(true)
14861486
bool TypeDatabase::parseFile(const QString &filename, bool generate)
14871487
{
14881488
QFile file(filename);
1489+
14891490
Q_ASSERT(file.exists());
14901491
QXmlInputSource source(&file);
14911492

0 commit comments

Comments
 (0)