Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118221

QDate construction from std chrono types is inefficient

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0 FF
    • dev
    • Core: Date/Time
    • None
    • 3
    • c4f7dba81 (dev), aa8dfc558 (dev)
    • Foundations Sprint 94

      The conversion constructors are are all essentially implemented by constructing a QDate that represents the Unix Epoch, and then calling addDays() on it.

      The problem is that addDays() is an out-of-line function and therefore the whole conversion isn't constexpr.

      Both types involved are Literal Types. It's not acceptable that the conversion between them is not constexpr.

      Acceptance criteria:

      • all conversions from QDate to std::chrono types, and vice versa, are constexpr
      • proven by tests

        For Gerrit Dashboard: QTBUG-118221
        # Subject Branch Project Status CR V

            ivan.solovev Ivan Solovev
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes