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

Add QHash::try_emplace

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None
    • 5
    • Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120

    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:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change