On Wednesday, 11 May 2022 at 20:53:21 UTC, Marvin Hannott wrote:
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
On Wednesday, 11 May 2022 at 20:53:21 UTC, Marvin Hannott wrote:
On Wednesday, 11 May 2022 at 20:23:07 UTC, Ali Çehreli wrote:
[...]
Yeah, but you can't return `Cat` 😉. And the documentation for
`scoped` says:
[...]
That's kinda very limiting.
Anyway, I cooked up another idea based on you
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
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 does exactly that:
https://dlang.org/phobos/std_typecons.html#
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
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 stack object?
Problems classes solve don't usually need copying n
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?