Typecasting with smart pointers

In this recipe, we will learn how to typecast using std::unique_ptr and std::shared_ptr. Typecasting allows you to convert one type into another. This recipe is important as it demonstrates the proper way of handling typecasting with std::unique_ptr and std::shared_ptr when attempting to convert the smart pointer's type (for example, when upcasting or downcasting with virtual inheritance).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset