C ++ equivalent for mallocis a distribution function operator new. You can use it like this:
MyObject* array = static_cast<MyObject*>(::operator new(sizeof(MyObject) * 1000));
Then you can create a specific object with a new location:
new (array + 0) MyObject();
Replace 0with any offset you want to initialize.
, , . , std::map<int, MyObject> std::unordered_map<int, MyObject>, MyObject .
std::unordered_map<int, MyObject> m;
m[100];