diff options
| author | Mårten Nordheim <marten.nordheim@qt.io> | 2024-01-31 14:26:27 +0100 |
|---|---|---|
| committer | Mårten Nordheim <marten.nordheim@qt.io> | 2024-12-03 16:35:22 +0100 |
| commit | d9ad2251d9fff85a18ce5afc62bcb1230cd2820d (patch) | |
| tree | 50db25300a515d91b396b9eb73faf9449cd1084c /src/tools/uic/cpp/cppwriteinitialization.cpp | |
| parent | 7a473ca3224d5517c5f09cc14a4047da06112bb2 (diff) | |
Add QHash::tryEmplace/try_emplace
Like QHash::emplace, but since it returns a bool (inserted/not inserted)
we finally have a way to avoid the
size(), emplace()/insert()/op[], size() pattern.
We also provide try_emplace (also with the hint argument overloads even
though we completely ignore the hint), for general compatibility with
the rest of the standard library. And for that reason it must also use
key_value_iterator instead of our usual iterator.
[ChangeLog][QtCore][QHash] Added tryEmplace().
[ChangeLog][QtCore][QHash] Added try_emplace() for compatibility with
the standard library.
Fixes: QTBUG-130258
Change-Id: Ie14786591ad6e9805e120e11fa01f69349ed4528
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp')
0 files changed, 0 insertions, 0 deletions
