The text to which you refer is preceded in the documentation by the
sentences: "The circular_buffer should not be used for storing pointers
to dynamically allocated objects. When a circular buffer becomes full,
further insertion will overwrite the stored pointers - resulting in a
memory leak."
The point being made here is that when the buffer is full, additional
pushes to it will overwrite the oldest item, so that if the data items
are pointers to items allocated on free store and there is no other
pointer held for the item to be overwritten enabling it to be freed, you
will have a memory leak.
shared_ptr will certainly be safe. As regards how overwriting is dealt
with, the documentation says this:
'There was a discussion what exactly "overwriting of an element" means
during the formal review. It may be either a destruction of the
original element and a consequent inplace construction of a new
element or it may be an assignment of a new element into an old one.
The circular_buffer implements assignment because it is more
effective.'
Either approach is OK with shared_ptr.
Chris