Many people have attempted to implement the garbage collection feature in C++.
But all of the implementations are ineffective and hardly to be used.
The chief problem be write a garbage collector
(not only in C++ but also in Smalltalk, Eiffle, Java ... )
is how to determine whether an object have became a garbage and should be collected.
When a object is losing the only reference to it, U can collect it immediately.
But, if there is three object: A,B and C with the following relationship:
A refers to A
B refers to C
C refers to A
When will U collect them?
Typically U should have a gc thread to scan the whole heap and all other thread's stacks
to find such ABCs.
When the gc thread is running, all other thread should be blocked,
and if there are lots of objects in Ur system, the gc operation will take quite a long time.
This is why they don't support garbage collection in standard C++.