Re: What are virtual functions?

2021-04-19 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 18 April 2021 at 23:04:26 UTC, ShadoLight wrote: On Wednesday, 14 April 2021 at 14:06:18 UTC, FeepingCreature wrote: On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: [..] Covariance is related ... [..] The opposite (contravariance) happens ... [..] Nice answer

Re: What are virtual functions?

2021-04-18 Thread Alain De Vos via Digitalmars-d-learn
Also three words are used in this context. Static binding, dynamic binding, late binding.

Re: What are virtual functions?

2021-04-18 Thread ShadoLight via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 14:06:18 UTC, FeepingCreature wrote: On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: [..] Covariance is related ... [..] The opposite (contravariance) happens ... [..] Nice answer but, just to be clear - D only supports covariance on return

Re: What are virtual functions?

2021-04-14 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: I'm trying to understand, what virtual functions are. I found the [specs](https://dlang.org/spec/function.html#virtual-functions), but I can't make head or tail of it. - What is a `vtbl[]`? Obviously a function pointer table

Re: What are virtual functions?

2021-04-14 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: I'm asking, because I'm currently writing new docs for `std.format`. The [current (stable) docs of `formatValue`](https://dlang.org/phobos/std_format.html#formatValue) tell, that some `toString` versions are discouraged, but not for

What are virtual functions?

2021-04-14 Thread Berni44 via Digitalmars-d-learn
I'm trying to understand, what virtual functions are. I found the [specs](https://dlang.org/spec/function.html#virtual-functions), but I can't make head or tail of it. - What is a `vtbl[]`? Obviously a function pointer table. But where to find this? The examples don't use it. Maybe something