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