mirror of
https://github.com/iandinwoodie/cpp-design-patterns-for-humans.git
synced 2025-12-17 04:24:40 +03:00
Be explicit with the shared pointer type.
This commit is contained in:
@@ -1825,7 +1825,7 @@ Bitcoin).
|
|||||||
// We are going to create the chain: bank->paypal->bitcoin.
|
// We are going to create the chain: bank->paypal->bitcoin.
|
||||||
|
|
||||||
// First, create the accounts.
|
// First, create the accounts.
|
||||||
std::shared_ptr<Account> bank = std::make_shared<Bank>(100);
|
std::shared_ptr<Bank> bank = std::make_shared<Bank>(100);
|
||||||
std::shared_ptr<Paypal> paypal = std::make_shared<Paypal>(200);
|
std::shared_ptr<Paypal> paypal = std::make_shared<Paypal>(200);
|
||||||
std::shared_ptr<Bitcoin> bitcoin = std::make_shared<Bitcoin>(300);
|
std::shared_ptr<Bitcoin> bitcoin = std::make_shared<Bitcoin>(300);
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ int main()
|
|||||||
// We are going to create the chain: bank->paypal->bitcoin.
|
// We are going to create the chain: bank->paypal->bitcoin.
|
||||||
|
|
||||||
// First, create the accounts.
|
// First, create the accounts.
|
||||||
std::shared_ptr<Account> bank = std::make_shared<Bank>(100);
|
std::shared_ptr<Bank> bank = std::make_shared<Bank>(100);
|
||||||
std::shared_ptr<Paypal> paypal = std::make_shared<Paypal>(200);
|
std::shared_ptr<Paypal> paypal = std::make_shared<Paypal>(200);
|
||||||
std::shared_ptr<Bitcoin> bitcoin = std::make_shared<Bitcoin>(300);
|
std::shared_ptr<Bitcoin> bitcoin = std::make_shared<Bitcoin>(300);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user