Skip to content

Typed Dictionary<K, V> #1450

@Bromeon

Description

@Bromeon

In addition to today's untyped VarDictionary type, we could add Dictionary<K, V> to the library, implementing Godot typed dictionaries.

This would have characteristics similar to Rust's HashMap<K, V>, with both K and V implementing ToVariant + FromVariant. Its API would be largely consistent with the existing Array<T>, notably with three types:

// Typed dictionaries.
struct Dictionary<K, V> {...}

// Untyped dictionaries.
type VarDictionary = Dictionary<Variant, Variant>;

// Type-erased dictionaries (either typed or untyped at runtime).
struct AnyDictionary {...}

Relevant links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: coreCore componentsfeatureAdds functionality to the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions