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

constexpr QLatin1String

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.13.0
    • None
    • All

    Description

      Currently QLatin1String can not be constructed as constexpr string due to usage of strlen() in the constructor. Changing the constructor like in the workaround below overcomes that limitation:

      struct ConstLatin1String : public QLatin1String
      {
       constexpr ConstLatin1String(const char* const s) : QLatin1String(s, static_cast<int>(std::char_traits<char>::length(s))) {}
      };

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            silicomancer Bernhard Lindner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes