thể trùng lặp: C++11 emplace_back on vector<struct>? là emplacement thể với PODs? Dường như nó không hoạt động trong Visual Studio 2012: struct X
{
int a;
int b;
};
void whatever()
{
xem xét như sau: std::vector<std::unique_ptr<int>> ptrsToInts;
ptrsToInts.emplace_back(new int);
Nếu phân bổ lại xảy ra trong vector, và thất bại (ném std::bad_alloc), tôi "an toàn" hay tôi sẽ bị r