В этом примере Проблемная строка - объявление репо члена корзины
#include
#include
#include
#include
struct Product {
std::unique_ptr description;
};
struct Basket {
// this line is OK, just moves it
std::vector ps;
// Doesn't compile with this line uncommented ! Can't move map ?
// std::unordered_map repo;
};
int main(int argc, const char *argv[]) {
std::vector baskets;
Basket b1;
baskets.push_back(std::move(b1));
return 0;
}
< /code>
Когда Repo < /code> Объявление участника неуместно, тогда я получаю страшный лист ошибок.
проверяется на GCC 4.7.2 и Clang 3.3 и получил одинаковую ошибку: < /p>
error: call to implicitly-deleted copy constructor of 'Product'
... lot of similar stuff ...
Подробнее здесь: https://stackoverflow.com/questions/202 ... map-inside