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

Generate operator!= for user-facing classes #560

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

tmadlener
Copy link
Collaborator

@tmadlener tmadlener commented Feb 19, 2024

BEGINRELEASENOTES

  • Generate operator!= for all user facing handle classes to make constructs like !(lhs == rhs) obsolete.

ENDRELEASENOTES

  • Check for occurences in our tests (one occurrence only, switched in this PR)
  • Check if interface types need these as well (already have them)
  • tests

@jmcarcell
Copy link
Member

jmcarcell commented Feb 20, 2024

I can't push to your branch:

tests/read_test.h
84:    if (!(hits[1] == hitRefs[0] && hits[0] == hitRefs[1])) {
153:  if (!(d0 == mcps[2])) {
156:  if (!(d1 == mcps[3])) {
159:  if (!(d2 == mcps[4])) {
162:  if (!(d3 == mcps[5])) {
174:  if (!(d0 == mcps[6])) {
177:  if (!(d1 == mcps[7])) {
180:  if (!(d2 == mcps[8])) {
183:  if (!(d3 == mcps[9])) {
225:        if (!(mcpRefs[i] == mcps[2 * i + 1])) {
230:        if (!(mcpRefs[i] == moreMCs[index])) {
328:        if (!(nmsp.ref().getObjectID() == cpy.ref().getObjectID())) {
337:        if (!(it->getObjectID() == cpy_it->getObjectID())) {

If you use the amazing ast-grep changing this can be as easy as:

$ ast-grep -p '!($A == $B)' -r '$A != $B' tests/read_test.h -U

@tmadlener tmadlener merged commit 4e74a02 into AIDASoft:master Feb 21, 2024
16 of 18 checks passed
@tmadlener tmadlener deleted the neq-operator branch February 21, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants