TMapBase::FindOrAdd

Find the value associated with a specified key, or if none exists, adds a value using the default constructor.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/Map.h

Include

#include "Containers/Map.h"

Syntax

ValueType & FindOrAdd
(
    const KeyType & Key,
    const ValueType & Value
)

Remarks

Find the value associated with a specified key, or if none exists, adds a value using the default constructor.

Returns

A reference to the value associated with the specified key.

Parameters

Parameter

Description

Key

The key to search for.

Value

The value to associate with the key.