Solution: Type Erasure
Get a detailed overview of the solution to the type erasure exercise.
We'll cover the following...
We'll cover the following...
Solution
Explanation
-
Lines 6–32: We defined the
Objectclass, which has a templated constructor that takes in a constant reference to an object of typeT. This constructor creates astd::shared_ptrto aModelobject, which is a member of theObjectclass and is defined on line 21. TheModelstruct has a templated constructor that takes in a constant reference ...