cppannotations/yo/memory/examples/stringstoreexample.cc
Frank B. Brokken 1a10d49645 WIP
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@288 f6dd340e-d3f9-0310-b409-bdd246841980
2009-11-05 15:54:20 +00:00

27 lines
643 B
C++

#include "stringstore.h"
#include <iostream>
using namespace std;;
void display(StringStore const &store)
{
for (size_t idx = 0; idx != store.size(); ++idx)
cout << store.at(idx) << '\n';
}
StringStore *process(char *argv[], int argc)
{
StringStore store(argv, argc);
display(store);
return new StringStore(argv, argc);
}
int main(int argc, char *argv[])
{
StringStore *sp = process(argv, argc);
delete sp;
char buffer[sizeof(StringStore)];
sp = new (buffer) StringStore(argv, argc);
sp->~StringStore();
}