I looked at some old code that used raw pointers and replaced them with unique_ptr . Now when I try to compile the code, I get this error message:
Error 1 error C2280: 'std :: unique_ptr> :: unique_ptr (const std :: unique_ptr <_Ty, std :: default_delete <_Ty → &)': attempt to reference the remote function d: \ visual studio 2013 \ VC \ enable \ xmemory0
The compiler's conclusion about the situation is enormous - to save space on this issue, see here .
As far as I can tell, this has something to do with how I use unique pointers. It starts from here (level.h, lines 65-66):
typedef std::unique_ptr<Enemy> PEnemy; std::list<PEnemy> m_enemies;
Now the next key that I get in the compiler output is line 47 in the source.cpp database:
std::list<PEnemy> enemies = Game::LEVEL->getEnemies();
Why is this causing problems? How can I fix the error?
c ++ c ++ 11
manabreak
source share