Work around clang-13 ambiguous operator==

In C++ 20 mode, clang-13 gets confused about how to handle operator==.
Rewrite the test to encourage it to pick the correct version.

```
common/include/gr.h:129:12: error: use of overloaded operator '==' is ambiguous (with operand types 'dcx::grs_main_bitmap *' and 'exact_type<dcx::grs_bitmap>')
        if (this == &r)
            ~~~~ ^  ~~
common/include/pack.h:31:17: note: candidate function (with reversed parameter order)
    constexpr bool operator==(const T *rhs) const { return p == rhs; }
                   ^
common/include/gr.h:129:12: note: built-in candidate operator==(struct dcx::grs_bitmap *, struct dcx::grs_bitmap *)
        if (this == &r)
```
This commit is contained in:
Kp 2022-07-02 18:10:45 +00:00
parent 33d938ac06
commit 1bcc5c40d0

View file

@ -126,7 +126,7 @@ public:
}
grs_main_bitmap &operator=(grs_main_bitmap &&r)
{
if (this == &r)
if (grs_bitmap *const that = &r; this == that)
return *this;
reset();
grs_bitmap::operator=(std::move(static_cast<grs_bitmap &>(r)));