Skip to content

Conversation

@Krestol
Copy link
Owner

@Krestol Krestol commented Jun 9, 2020

No description provided.

std::unique_ptr<Car> CarFactory::BuildCar(const std::string& color)
{
return std::make_unique<Car>(new Car(color));
return std::make_unique<Car>(color);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ошибки здесь были

{
}

Driver::~Driver()
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если в unique_ptr тип, который объявлен предварительно, то требуется реализация деструктора, иначе компилятор генерирует деструктор и ему не "виден" полный тип Car
class Car;
std::unique_ptr car_;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вроде понятно, почему не работало, но не понятна логика этой ошибки.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если не прояснится после обсуженения процесса подключения файлов и компиляции - посмотрим отдельно

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошо

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants