Passing a derived class where base class is defined as ref parameter

Adam D Ruppe destructionator at gmail.com
Tue Dec 14 20:58:21 UTC 2021


On Tuesday, 14 December 2021 at 17:20:18 UTC, chopchop wrote:
> I am using the "ref" here (I put tinyurl to avoid 
> over-referencing the post instead of the github page itself):
> https://tinyurl.com/bdddkmub

yeah D classes are automatically ref unlike c++ so you don't need 
the second level of it most often.

Using plain `Object` is what you want most the time, maybe `in 
Object` sometimes. But `ref Object` or `Object*` both very rare 
in D.


> Adam, I am actually using your code :)

nice. You might want to look at my terminal.d 
(arsd-official:terminal on dub) too which has pretty 
comprehensive functionality for tons of things. Prolly more than 
you need looking at your interface tho but it includes the output 
functions then mouse and real time key inputs, get line input, 
even scrollable areas and more.


More information about the Digitalmars-d-learn mailing list