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

QMap does not support C++11 initializer list

    XMLWordPrintable

Details

    • I01f3ecfbca805f4c053a75232188bd2a77fdb1f2

    Description

      With -std=c++0x enabled, the following code compiles OK:

      	std::map<int, std::string> m {{1, "1"}, {2, "2"}};
      

      while this doesn't:

      	QMap<int, QString> m {{1, "1"}, {2, "2"}};
      

      Initializer list support is in QList and QVector. QMap shouldn't be left out.

      Attachments

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

        Activity

          People

            beemaster Roman Pasechnik
            stephenju Stephen Chu
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes