#include <memory>
#include <string>
#include <iostream>
int main()
{
const int n = 10;
std::allocator<std::string> alloc;
auto const p = alloc.allocate(n);
auto q = p;
alloc.construct(q++);
alloc.construct(q++, 10, 'c');
alloc.construct(q++, "hi");
for (auto w = p; w != q; w++) {
std::cout << *w << " ";
}
std::cout << "\n";
while (q != p) {
alloc.destroy(--q);
}
alloc.deallocate(p, n);
return 0;
}
// from C++ primer 5th(p.482)
// allocator::construct
// g++ xx.cpp -std=c++11