I have a C++ object of type ObjectArray
typedef map> ObjectArray;
What is the syn
In addition to previous answers, I wanted to point out that there is also a method emplace (it's convenient when you cannot/don't want to make a copy), so you can write it like this:
ObjectArray object_array;
auto pointer = std::make_unique(...); // since C++14
object_array.emplace(239LL, std::move(pointer));
// You can also inline unique pointer:
object_array.emplace(30LL, std::make_unique(...));