[Development] QVariant comparison in Qt6

Ville Voutilainen ville.voutilainen at gmail.com
Fri Sep 18 18:38:12 CEST 2020

On Fri, 18 Sep 2020 at 18:13, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On Friday, 18 September 2020 06:48:50 PDT Lars Knoll wrote:
> > std::optional<int> QVariant::compare(const QVariant &other);
> >
> > Would that be good enough?
> Why the optional?
> We should use one of the types from <compare>[1]. Yes, it's C++20; we can make
> our internal API return an integer that is convertible to those types in the
> front-end API, under #if __has_include(<compare>).
> [1] https://en.cppreference.com/w/cpp/header/compare

Why do people keep pushing C++20 facilities when we decided that C++17
is our standard
version? How does the int say "I can't compare this"? partial_ordering
can do that, but what
will the int do?

More information about the Development mailing list