https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101945

--- Comment #1 from Emmanuel Le Trong <emmanuel.le-tr...@cnrs-orleans.fr> ---
Sorry for the weird indentation, here it is fixed:

    #include <concepts>

    template <class T> struct wrapper
    {
        T value;
    };

    template <class T, class U>
    requires std::equality_comparable_with <T, U>
    constexpr bool operator == (wrapper <T> const& a, wrapper <U> const& b)
    {
        return a.value == b.value;
    }
    template <class T, class U>
    requires std::equality_comparable_with <T, U>
    constexpr bool operator == (wrapper <T> const& a, U const& b)
    {
        return a.value == b;
    }
    template <class T, class U>
    requires std::equality_comparable_with <T, U>
    constexpr bool operator == (T const& a, wrapper <U> const& b)
    {
        return a == b.value;
    }

    constexpr auto a = wrapper <int> { 2 };
    constexpr auto b = a;

    static_assert (a == b);

    int main () {}

Reply via email to