We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The code is producing memory leaks!!! none of the cast spells is ever deallocated in main. Do not do that! if you need a polymorphic return use std::shared_ptr and make_shared or unique_ptr and make_unique.
Magic Spells
You are viewing a single comment's thread. Return to all comments →
Note: This is a very bad code example!
The code is producing memory leaks!!! none of the cast spells is ever deallocated in main. Do not do that! if you need a polymorphic return use std::shared_ptr and make_shared or unique_ptr and make_unique.