Exercise: Factory Method
Test your understanding of the factory method design pattern.
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.
Access this course and 1400+ top-rated courses and projects.