#How to pass AutoHashMap into functions

1 messages · Page 1 of 1 (latest)

worthy leaf
#

Hello, it seems like AutoHashMap.init() returns HashMap and i can't figure out how to make a function signature with the correct type

#
var hash_map: std.AutoHashMap(K, V) = .init(allocator);

fn func(hash_map: *WhatTypeIsSupposedToBeHere) i8 {...}
undone raptor
#

Retyping std.AutoHashMap(K, V) in the function signature is also fine, it might read better than saving the type to a new name.

#
var hash_map: std.AutoHashMap(K, V) = .init(allocator);

fn func(hash_map: *std.AutoHashMap(K, V)) i8 {...}```