Skip to content

[clang-tidy] New check: Remove redundant comparison operators #146519

@SunBlack

Description

@SunBlack

Since C++20 rewriting rules exists, so that it is e.g. not anymore necessary to define operator!= when operator== already exists.

I hope that the compilers will optimize accordingly, so that the rewrite rule is always as fast as the manual rule (as an example: If there used to be a!=b and a==b and you remove the former rule, that the compiler does not make !(a==b) out of it, i.e. 2 assembler instructions instead of one).

SonarLint already have a check for this, so that you could spot what could also be adjusted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions