I'm speculating a lot here... But...
I assume that you need to be able to do different things with these two lists. It sounds like you're writing some kind of pooling allocator.
The "free list", I would expect, just needs to allow you to push and pop from its front; it's a fifo stack which you can use to store objects that are not currently in use but that can be used when an allocation is required and the "free list" is not currently empty.
The "active list" is a list of all currently allocated objects. The allocator may need to be able to report on these, or do things to them, or whatever. The "active list" requires that you can remove an object from anywhere when the object becomes deallocated. I'm guessing that it then gets pushed onto the free list for reuse.
Now the data structures that can be used for each "list" may be different. It all depends on the exact requirements. I'd say you should be able to use a std::list<A *>
for your "free list" if I'm correct in the required usage semantics. If you do not care about being able to walk the "active list" in the order of allocation then you can use a std::set<A *>
for your "active list". To avoid needing to do a lookup in the set to remove the object from the "active list" you could store an iterator to the object's location in the set in the object (this iterator will not become invalidated unless the object itself is removed from the set - or so sayeth this answer and I haven't checked it but I'm sure someone will correct me if I'm wrong). If you DO need to be able to walk the "active list" in order of allocation then you could use a std::map<size_t, A *>
and store an incrementing allocation index as the map key; again the 'object holds the iterator for fast erase' trick should work.