I have a need for unique reusable ids. The user can choose his own ids or he can ask for a free one. The API is basically
class IdManager { public: int Allocat
But I don't think you have to guarantee the id must starts from 1. You can just make sure the available id must be larger than all allocated ids.
Like if the 3 is registered first, then the next available id can just be 4. I don't think it is necessary to use 1.