I have a Turn class with a _rounds private member. _rounds is a bidimensional std vector of std unique pointers to another class called Animation:
Turn.h
std::vector<std::vector<std::unique_ptr<Animation>>> _rounds;
I dynamically allocate the Animations from various points of my code and try to add them to Turn _rounds with a Turn public method called addAnimation like this:
auto animation = std::make_unique<Animation>(this, Animation::Type::MOVE, _gameManager);
turn.addAnimation(std::move(animation)); //Use move to make addAnimation take ownership of the animation.
Then the Turn addAnimation() method tries to add the Animations to its member _rounds as follows:
Turn.cpp
...
_rounds[roundIndex].push_back(std::move(animation));
...
However I am getting an error saying that I am trying to reference a deleted function as if I was trying to use the deleted copy constructor or something.
The only point of my code that appears at the end of the long chain of template errors is at the push_back point.
Any help?
Aucun commentaire:
Enregistrer un commentaire