Re: Virtual methods on stack objects

2022-05-11 Thread Marvin Hannott via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 20:23:07 UTC, Ali Çehreli wrote: On 5/11/22 13:06, Marvin Hannott wrote: > I appreciate the answer, don't much like the "solutions". Me neither. :) > It's not so much about copying Great! > scoped class objects should have value semantics. std.typecons.scoped do

Re: Virtual methods on stack objects

2022-05-11 Thread Marvin Hannott via Digitalmars-d-learn
On Wednesday, 11 May 2022 at 14:44:59 UTC, Ali Çehreli wrote: On 5/11/22 06:57, Marvin Hannott wrote: > I understand that D's classes solve some particular problems. However, > they also cause problems because they cannot be copied when scoped. So > how do I get virtual methods on a copyable sta

Virtual methods on stack objects

2022-05-11 Thread Marvin Hannott via Digitalmars-d-learn
Hi everybody! I understand that D's classes solve some particular problems. However, they also cause problems because they cannot be copied when scoped. So how do I get virtual methods on a copyable stack object?