The reason that it won't compile is that
_r.managers
is of type std::unique_ptr<Manager[]>
, but you want to initialize a raw pointer with this.
just change it to:
Restaurant::Restaurant(const Restaurant &_r)
{
for (int i = 0; i < MAX_MANAGERS; i++)
{
managers.get()[i] = _r.managers.get()[i];
}
}
or first take a smart pointer's data (which is an array)
Manager *_managers = _r.managers.get();
and then you can use it as was before:
for (int i = 0; i < MAX_MANAGERS; i++) {
managers.get()[i] = _managers[i];
}