Typed (template) versions of Dictionary and Array in GDNative

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hnOsmium0001

Is there a typed version of Dictionary and Array in GDNative? For example I want to store some structs in a map, or just have better auto complete when it is known what the map/array will store.

:bust_in_silhouette: Reply From: JimArtificer

I haven’t seen a typed version of Dictionary as part of Godot’s code/APIs.

Developers working with C# can make use of the System.Collections.Generic types that are part of .NET Framework.

:bust_in_silhouette: Reply From: hnOsmium0001

GDNative doesn’t provide strongly typed versions for Dictionary and Array. An option is to use std::map/unordered_map/vector for those use cases, as long as you don’t need to feed the containers to Godot.