The following code compiles, but only initializes the first object. Is there any way to initialize the entire array? That's pretty much the entire point of this thread.
#include <new>#include <iostream>using namespace std;class A{public: A(const int src_x) { x = src_x; } ~A() { } int x;};int main(void){ void* buf = ::operator new(sizeof(A) * 50); A* a = new(buf) A(50); a->~A(); ::operator delete(buf); return 0;}