- Qt 6.9
- Qt Core
- C++ Classes
- TryEmplaceResult
- Qt 6.9.1 Reference Documentation

# 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.

- List of all members, including inherited members

## 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.