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

Add operator=(std::initializer_list<T>) for Qt containers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.4.1, 5.5.0 Alpha
    • None

      All Qt containers (including QFlags) have a constructor taking std::initializer_list, but no container so far has an assignment operator taking std::initializer_list, too.

      This might lead AFAIK to an unnecessary temorary object creation/destruction of a temporary variable & assignment in code like:

      QVector<int> array;
      array = { 0, 1 };
      

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

            thiago Thiago Macieira
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes