Well yes, it works well in c++ because the language has a strong distinction between value semantics and reference semantics, so when you remove a value from a container it must clearly be destroyed. A GC'd language with aliased references can't call destructors in this case. At best can do it when the object is collected.
Yet I think an high level language could have the same value/reference distinction. Or you could do it with linear types.
Yet I think an high level language could have the same value/reference distinction. Or you could do it with linear types.