Skip to content

Commit

Permalink
Qt6: QList<T>operator== requires const T::operator== (#116)
Browse files Browse the repository at this point in the history
- missing consta caused a g++ compile error
- adding the const is safe, as it does not modify the LHS
  • Loading branch information
jbowler authored and mrbean-bremen committed Nov 2, 2023
1 parent 2c7848c commit 89815e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion generator/parser/codemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ QString TypeInfo::toString() const
return tmp;
}

bool TypeInfo::operator==(const TypeInfo &other)
bool TypeInfo::operator==(const TypeInfo &other) const
{
if (arrayElements().count() != other.arrayElements().count())
return false;
Expand Down
6 changes: 3 additions & 3 deletions generator/parser/codemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ struct TypeInfo
void setArguments(const QList<TypeInfo> &arguments);
void addArgument(const TypeInfo &arg) { m_arguments.append(arg); }

bool operator==(const TypeInfo &other);
bool operator!=(const TypeInfo &other) { return !(*this==other); }
bool operator==(const TypeInfo &other) const;
bool operator!=(const TypeInfo &other) const { return !(*this==other); }

// ### arrays and templates??

Expand All @@ -171,7 +171,7 @@ struct TypeInfo
uint m_reference: 1;
uint m_functionPointer: 1;
uint m_indirections: 6;
inline bool equals(TypeInfo_flags other) {
inline bool equals(TypeInfo_flags other) const {
return m_constant == other.m_constant
&& m_volatile == other.m_volatile
&& m_reference == other.m_reference
Expand Down

0 comments on commit 89815e2

Please sign in to comment.