Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6: QList<T>operator== requires const T::operator== #116

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Qt6: QList<T>operator== requires const T::operator== #116

merged 1 commit into from
Oct 3, 2023

Commits on Oct 3, 2023

  1. Qt6: QList<T>operator== requires const T::operator==

    This causes a g++ compile error in codemodel.cpp (the error message is
    extremely confusing).  It "works" in Qt5 but adding the "const" in the
    relevant places does not break the compile.  Therefore:
    
    bool TypeInfo::operator==(const TypeInfo&)
    
    does not modify the LHS; this means that adding the const is safe (there
    would be a compile error if somoething in the implementation did modify
    part of the LHS).
    
    It makes sense to me that Qt6 would do something to prevent an ==
    operator with a mutable LHS.  So far as I can see QList would have to
    make a complete copy of the LHS under some circumstances resulting in a
    potentially significant performance hit (depending on the complexity of
    the type involved).
    
    This is a harmless but possibly beneficial change to both 'master' and
    'qt6' branches.
    
    Signed-off-by: John Bowler <jbowler@acm.org>
    jbowler committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    5970281 View commit details
    Browse the repository at this point in the history