The following code fails to compile on gcc 5.3 with compiler error complaining that the copy constructor of the unique_ptr is somehow invoked. Can someone explain why this happens?
#include <iostream>
#include <memory>
#include <queue>
using Foo = std::deque<std::unique_ptr<int>>;
void foo() {
std::vector<Foo> a;
a.emplace_back(); // this fails to compile
}
Aucun commentaire:
Enregistrer un commentaire