I have the following
class Panel {
public:
std::array<std::array<std::unique_ptr<fb::Block>, Panel::Y>, Panel::X> blocks;
};
And i have a member function like this:
void Panel::processMove() {
if (move == nullptr) {
return;
}
MoveType type = move->type;
switch (type) {
case MoveType::BLOCK_SWITCH: {
std::unique_ptr<fb::Block> src = blocks[cursor.x][cursor.y];
std::unique_ptr<fb::Block> dst = blocks[cursor.x + 1][cursor.y];
if ((src == nullptr) && (dst == nullptr)) {
break;
}
...
}
}
I don't know how to get a temporary reference to the pointed item because this code fails to compile with the following error:
call to implicitly-deleted copy constructor of 'std::unique_ptr<fb::Block>'
How am i supposed to get a temporary reference to the pointed item ?