m <- cpp_multimap(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), 5:7)
m
# [4,1] [5,1.5] [5,100] [6,2] [6,100.1] [7,100.2]
print(m, from = 6)
# [6,2] [6,100.1] [7,100.2]
m <- cpp_multimap(c("world", "hello", "there", "world"), 3:6)
m
# ["hello",4] ["there",5] ["world",3] ["world",6]
erase(m, "world")
m
# ["hello",4] ["there",5]
Run the code above in your browser using DataLab