-
Notifications
You must be signed in to change notification settings - Fork 0
build fixes #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Yaroslav
Are you sure you want to change the base?
build fixes #4
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| #pragma once | ||
|
|
||
|
|
||
| class Car | ||
| { | ||
| public: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #pragma once | ||
| #include "Car.h" | ||
| class Car; | ||
|
|
||
| class CarFactory | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,14 +9,19 @@ Driver::Driver(const std::string& name, std::shared_ptr<CarFactory> factory) | |
| { | ||
| } | ||
|
|
||
| Driver::~Driver() | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Если в unique_ptr тип, который объявлен предварительно, то требуется реализация деструктора, иначе компилятор генерирует деструктор и ему не "виден" полный тип Car
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Вроде понятно, почему не работало, но не понятна логика этой ошибки.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. если не прояснится после обсуженения процесса подключения файлов и компиляции - посмотрим отдельно
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Хорошо |
||
| { | ||
| /*to avoid errors from incomplete type in unique_ptr*/ | ||
| } | ||
|
|
||
| void Driver::BuyCar(const std::string& color) | ||
| { | ||
| car_ = factory_->BuildCar(color); | ||
| } | ||
|
|
||
| std::unique_ptr<Car> Driver::SellCar() | ||
| { | ||
| return std::make_unique<Car>(car_.release()); | ||
| return std::unique_ptr<Car>(car_.release()); | ||
| } | ||
|
|
||
| void Driver::BuyUsedCar(Driver * d) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ошибки здесь были