Hi,

On 22/09/2020 16:17, Thiago Macieira wrote:
And especially if there's no impact to how the user uses the API.

1)
std::optional<int> compare();

2)
enum class Ordering { Less = -1, Equal = 0, Greater = 1, Unordered = 0xff
};
  Ordering compare();

3)
Implement a Qt replacement for std::partial_ordering (could use the std
stuff if C++ 20 is available) and use that.
I'd rather stay simple and allow extending for <compare> where more details
are necessary.

For that, I think #1.


I'm reopening this old thread (which I somehow missed) because eventually #1 was implemented. But optional<int> is the wrong API for a comparison result.

I've quickly implemented 3) and pushed it here. It's only missing docs.

https://codereview.qt-project.org/c/qt/qtbase/+/322900

(includes the rationale of why optional is the wrong datatype)


Still in time to target 6.0.0?

Thanks,
--
Giuseppe D'Angelo | [email protected] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to