il codice seguente crea un buffer circolare composto da 5 elementi e ne inserisce 10, quindi solo gli ultimi 5 elementi rimangono nell'anello. Il mio dubbio atroce è: i buffer vengono sovrascritti nella locazione di memoria precedente (unsigned char*) oppure in una nuova locazione?

codice:
#include <windows.h>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <boost/circular_buffer.hpp>
using namespace std;
using namespace boost;

char * getDateTime(void);
const short numbuff = 5;
const short buflen  = 30;

typedef struct
{
	unsigned char * pData;
	unsigned short bufferLength;
	unsigned short bytesRecorded;
	bool flag;
} Buffer;

int main()
{
	circular_buffer<Buffer*> cb(numbuff);
	circular_buffer<Buffer*>::const_iterator it;

	printf("Push elements:\n");
	// fill buffer
	for(int i = 0; i<10; i++)
	{
		// set up buffer
		Buffer *buff       = new Buffer;
		ZeroMemory(buff, sizeof(Buffer));

		buff->bufferLength  = buflen;
		buff->bytesRecorded = buflen;
		buff->flag          = true;
		buff->pData         = new unsigned char[buflen];
		buff->pData         = reinterpret_cast<unsigned char *>(getDateTime());
		
		printf("%s\n", buff->pData);

		// push buffer
		cb.push_back(buff);

		Sleep(1000);
	}

	printf("\nShow elements:\n");

	// show elements
	for(int i = 0; i<static_cast<int>(cb.size()); i++)
	{
		printf("%s\n", cb[i]->pData);
	}

	system("pause");
	return EXIT_SUCCESS;
}

// getDateTime (Fri, 10 Oct 2008 14:41:59 GMT)
char * getDateTime(void)
{
    time_t rawtime;
    struct tm timeinfo;
    time(&rawtime);
    gmtime_s(&timeinfo, &rawtime);
    char * buffer = new char[30];
    strftime(buffer, 30, "%a, %d %b %Y %X GMT", &timeinfo);
    return buffer;
}
grazie