Quote Originally Posted by whiteflags View Post
Because allocate is enough for plain old data. You want allocator::construct - C++ Reference

Here's a basic example btw:
Code:
#include <memory>
#include <iostream>
#include <string>

using namespace std;

int main() {

    allocator<string> alloc;
    string* p = alloc.allocate(sizeof *p);
    alloc.construct(p, "hello, world");

    cout << *p << endl;

    alloc.destroy(p);
    alloc.deallocate(p, 1UL);

}

So my problem was only allocating and not simultaneously constructing the memory leading to <Bad Ptr>. Ok thank you.