boostorg / hana

Your standard library for metaprogramming
http://boostorg.github.io/hana
Boost Software License 1.0
1.66k stars 217 forks source link

Add missing const on operator== #502

Closed ecatmur closed 1 year ago

ecatmur commented 2 years ago

identified by clang14 in C++20 mode:

test/issues/github_460.cpp:25:33: error: ISO C++20 considers use of overloaded operator '==' (with operand types 'SomeStruct' and 'SomeStruct') to be ambiguous despite there being a unique best viable function [-Werror,-Wambiguous-reversed-operator]
    static_assert(SomeStruct{5} == SomeStruct{5}, "");
                  ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
test/issues/github_460.cpp:15:20: note: ambiguity is between a regular call to this operator and a call with the argument order reversed
    constexpr bool operator==(SomeStruct const& other) {
                   ^
1 error generated.
ldionne commented 2 years ago

Hey, thanks a lot for the patch! Can you rebase onto develop and update your PR?