This is the 9th error encountered during compilation? What is the first? Again, supplying a minimal compilable snippet of code that produces the same issue would speed things along.
Well, not compilable. But one that produces the same error.
Are you sure that it is that declaration that is giving trouble, not the use of it?
Anything move constructable has it's copy ctor and assignment deleted, after all it's a unique pointer. Are you trying to copy something into the vector? Could you try to std::move it instead?
The program '[4704] P2.exe' has exited with code 0 (0x0).
std::vector<std::unique_ptr<Piece>> formations;
Error 1 error C2280: 'std::unique_ptr<Piece,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0 593 1 P2
It convinced me. I disabled everything and enabled/build until I found one that broke, then proceeded until it happened again, that was the only one that broke.
Are you trying to copy something into the vector? Could you try to std::move it instead?
k.push_back(std::move(a));
?
May have to consider your suggestion for shared_ptr tho. Thanks
Sort of, I rewrote that object and recompiled piece by piece, this is where is started breaking again:
1 2 3
Faction2 player(false);
std::vector<Faction2> factions;
factions.push_back(std::move(player)); // breaks it
I take it that if an object has a unique_ptr data member and you send a copy of that object somewhere it violates the Highlander rule of there can only be one?
unique_ptr has deleted copy ctor and operator= so copying an object that contains a unique_ptr will attempt to copy the unique_ptr. The code snippet you posted shouldn't be an issue since you move player.