Get which derived class an object is if it's stored in an array of its base class

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 15 07:04:17 PDT 2017


On Saturday, 15 July 2017 at 13:45:40 UTC, Morimur55 wrote:
> Well I want to cast to the derived type so I can use a method 
> that's defined in the base class, but is overridden in several 
> of the derived types... and calling it without a cast seems to 
> give me the base type functionality, but I'd like the derived 
> type functionality when it's defined.

That means you're doing something wrong. What does your base 
class method look like? Is it a template?


More information about the Digitalmars-d-learn mailing list