On Sunday, 20 March 2022 at 05:44:44 UTC, Salih Dincer wrote:
On Sunday, 20 March 2022 at 01:28:44 UTC, Era Scarecrow wrote:
Inheritance and Polymorphism is one of the hardest things to
grasp mostly because examples they give in other books of
'objects' is so far unrelated to software that it d
On Sunday, 20 March 2022 at 01:28:44 UTC, Era Scarecrow wrote:
Inheritance and Polymorphism is one of the hardest things to
grasp mostly because examples they give in other books of
'objects' is so far unrelated to software that it doesn't
really compare. `"An object is like a book which you ca
On Saturday, 19 March 2022 at 12:23:02 UTC, user1234 wrote:
I think OP is learning OOP. His error looks like that for the
least.
True. Looking at the code it shouldn't spaghetti in on itself
infinitely and is basically clean in his intent.
Inheritance and Polymorphism is one of the hardest
On Saturday, 19 March 2022 at 05:25:01 UTC, Era Scarecrow wrote:
On Saturday, 19 March 2022 at 00:16:48 UTC, user1234 wrote:
That crashes because of the creation of `Bar b` member, which
itself has a Bar b member, which itself...
Mhmm... So There's Foo with Bar b, which has Bar b which has
B
On Saturday, 19 March 2022 at 00:16:48 UTC, user1234 wrote:
```d
if (typeid(this) !is typeid(Bar))
this.b = new Bar(this.i);
```
A very clever and ingenious solution. Thanks...
SDB@79
On Saturday, 19 March 2022 at 00:16:48 UTC, user1234 wrote:
That crashes because of the creation of `Bar b` member, which
itself has a Bar b member, which itself...
Mhmm... So There's Foo with Bar b, which has Bar b which has Bar
b which... just keeps going over and over again.
It appears
On Saturday, 19 March 2022 at 00:05:54 UTC, Salih Dincer wrote:
Greetings to all...
There are nested classes as below. But beware, there's also
inheritance, extra! If you construct ```Bar b``` from main(),
it's okay. But if declare the constructor in Foo(), the program
crashes with a segmenta
Greetings to all...
There are nested classes as below. But beware, there's also
inheritance, extra! If you construct ```Bar b``` from main(),
it's okay. But if declare the constructor in Foo(), the program
crashes with a segmentation error.
Is this not legal? Like two mirrors are facing each