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

chopchop sautooauuaeuahusahouh at gmail.com
Wed Dec 15 07:30:04 UTC 2021


On Tuesday, 14 December 2021 at 17:27:13 UTC, Stanislav Blinov 
wrote:
> Simple. Don't take a `ref`. Just take a `Console`. Classes in D 
> are reference types, you're not making a copy as you would in 
> C++ if you were to write `updateFoodToken(Console c)`.

Ah, ok, Reference types! That's great. Definitely my C++ bias 
working against me, good you read my mind :)




More information about the Digitalmars-d-learn mailing list