Simply changing the container type is a bad idea. E.g. removing an entry from a vector and set requires very different code. Also some container provide specialized functions.