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

QDate construction from std chrono types is inefficient

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes