On Sun, 20 Sep 2020 at 09:06, Thiago Macieira <[email protected]> wrote: > > You can't write a conversion from a type you don't own to an int, or > > vice versa. Don't fall into that trap, it's impossible > > to dig yourself out of it. > > Sorry, I don't understand the issue. > > I'm thinking of an internal function that is used to implement operator<=> > (and if pre-C++20 support is desired, operator== and operator<).
My bad, I thought we're talking about an API-exposed function. But if that's not the case, then it's even less necessary to bother with conditionally using <compare>'s types, and std::optional seems fine. The functionality built on top of it can convert the optional into a weak_ordering, as an optional feature, rather than having the underlying private utility function have multiple definitions or overloads or whatever. _______________________________________________ Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
