Exercise: Factory Method
Test your understanding of the factory method design pattern.
We'll cover the following
First problem statement
Refactor the simple factory method implementation of the example to std::shared_ptr
as discussed in the previous lesson.
Coding challenge
Note: We’ve already written the example for you using the
unique_ptr
. You need to refactor the code using theshared_ptr
pointer.
Get hands-on with 1400+ tech skills courses.