I\'m using libgc, a garbage collector for C and C++. To make STL containers garbage collectible one must use the gc_allocator.
Instead of writing
s
You can use C++11 templated type aliasing using using e.g. like this
using
template using gc_vector = std::vector>;
Note: I know this is an old question but since it has quite many upvotes and as it turns up in search results I thought it deserved an updated answer.