Re: Mixin a function into a struct only if no member with that name already exists

2021-12-29 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 29 December 2021 at 10:14:13 UTC, Tobias Pankrath wrote: How do I mixin a function only if it is not already present? This is the default behavior of template mixins.

Re: Mixin a function into a struct only if no member with that name already exists

2021-12-29 Thread Tobias Pankrath via Digitalmars-d-learn
On Wednesday, 29 December 2021 at 10:21:07 UTC, Stanislav Blinov wrote: On Wednesday, 29 December 2021 at 10:14:13 UTC, Tobias Pankrath wrote: How do I mixin a function only if it is not already present? Perhaps use opDispatch? That's a great idea and I'll look into it.

Re: Mixin a function into a struct only if no member with that name already exists

2021-12-29 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 29 December 2021 at 10:14:13 UTC, Tobias Pankrath wrote: How do I mixin a function only if it is not already present? Perhaps use opDispatch?