QtCS2024 Error handling

From Qt Wiki
Revision as of 14:22, 5 September 2024 by Volker Hilsheimer (talk | contribs) (Add deck)
Jump to navigation Jump to search

Session Summary

Session Owners

Volker Hilsheimer Note taker: Thiago

Notes

Intro: we already have too many attempts at this, going back at least as far back as 2017.

Proposal to use Sy Brand's std::expected implementation in Qt

Volker's proposal:

  • use the C++17-compatible full implementation by Sy Brand at https://github.com/tartanllama/expected
    • Licence: CC0 (QtC legal needs to confirm it's ok to use even for commercial, but Thiago thinks it is [but he isn't a lawyer])
    • Includes things that even most of Standard Library implementations don't yet
  • import into Qt
  • use it internally

Should we use it in public API?

  • If we do, then we can't switch to std::expected (C++23) before at least Qt 7.0
  • It becomes part of our ABI
  • Shouldn't be named q23::expected because it conveys the wrong message
  • Do we need to use it in public API?
    • No, we don't need it
    • But it's very useful for that; the type is designed for use in interface boundaries
  • Suggestion:
    • Use it internally first so we gain experience with its issues and how to use it
    • Then, later, make it public to use it

Alternatives: