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

Add QHash::try_emplace

    XMLWordPrintable

Details

    • 5
    • d9ad2251d (dev)
    • Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120, Foundation Sprint 121

    Description

      Our best functionality currently to insert-if-not-already-exists and then know about it is something along the lines of

      oldsize = hash.size();
      auto &obj = hash[key];
      if (oldsize != hash.size())
        obj = ...;
      

      This is because none of our current functionality returns any indication whether there was a new insertion or not. With tryEmplace/try_emplace we can get this.

      Attachments

        Issue Links

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

          Activity

            People

              manordheim Mårten Nordheim
              manordheim Mårten Nordheim
              Vladimir Minenko Vladimir Minenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes