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

As a user of QStringTokenizer, I would like toContainer() to work on containers whose value_type is not exactly the same as the tokenizers

    XMLWordPrintable

Details

    • 2
    • Team B Foundation Sprint 53
    • f3c340c276 (qt/qtbase/dev) f3c340c276 (qt/tqtc-qtbase/dev)

    Description

      In technical terms: toContainer() is over-constrained. Instead of is_same, it should only require is_convertible.

      Example that should, but doesn't, work:

      QLatin1String input = ~~~;
      auto list = qTokenize(input, u'\n', Qt::SkipEmptyParts).toContainer<QStringList>();
      // ERROR: QStringList::value_type (QString) is not the same as QStringTokenizer<QLatin1String, QChar>::value_type (QLatin1String)).
      

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes