[PATCH] D155143: [DX] Fix PSV resource serialization
Chris Bieneman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 17:37:43 PDT 2023
beanz added inline comments.
================
Comment at: llvm/include/llvm/Object/DXContainer.h:95-96
bool operator==(const iterator I) { return I.Current == Current; }
bool operator!=(const iterator I) { return !(*this == I); }
};
----------------
bob80905 wrote:
> Just curious whether this should be revisited, or why these operators aren't defined in terms of the opposite of the other.
This is some funny syntax, but the `!=` operator is implemented in terms of the `==` operator, which only does the pointer compare on the `Current` pointer.
The other way the `!=` operator could be written would be something like:
```
bool operator!=(const iterator I) { return !operator==(I); }
```
That should be equivalent to the code currently in there because it is just calling `==` on two `iterator` objects.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155143/new/
https://reviews.llvm.org/D155143
More information about the llvm-commits
mailing list