m <- cpp_unordered_map(4:6, seq.int(1, by = 0.5, length.out = 3L))
m
# [6,2] [5,1.5] [4,1]
insert(m, seq.int(100, by = 0.1, length.out = 3L), 14:16)
m
# [16,100.2] [15,100.1] [14,100] [6,2] [5,1.5] [4,1]
print(m, n = 3)
# [16,100.2] [15,100.1] [14,100]
m <- cpp_unordered_map(c("world", "hello", "there"), 4:6)
m
# ["there",6] ["hello",5] ["world",4]
erase(m, "there")
m
# ["hello",5] ["world",4]
Run the code above in your browser using DataLab