Monday, 26 June 2017

c++ - How do we use a abstract class as a function return type?

What's the C++ way of returning a derived type as a abstract type in a function with this caveat?




Say the function creates a derived type and wants to return that object as the abstract base type. How do you do that in C++ without resorting to messy C like pointers?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...