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

Add QHash::try_emplace

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes