QHash::TryEmplaceResult Struct

struct QHash::TryEmplaceResult

The TryEmplaceResult class is used to represent the result of a tryEmplace() operation. More...

This struct was introduced in Qt 6.9.

Public Variables

bool inserted
QHash<Key, T>::iterator iterator

Detailed Description

The TryEmplaceResult class is used in QHash to represent the result of a tryEmplace() operation. It holds an iterator to the newly created item, or to the pre-existing item that prevented the insertion, and a boolean, inserted, denoting whether the insertion took place.

See also QHash and QHash::tryEmplace().

Member Variable Documentation

bool TryEmplaceResult::inserted

This value is false if there was already an entry with the same key.

QHash<Key, T>::iterator TryEmplaceResult::iterator

Holds the iterator to the newly inserted element, or the element that prevented the insertion.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.