Re: interface function member declarations needing parameter attributes ?

2021-07-18 Thread someone via Digitalmars-d-learn
On Sunday, 18 July 2021 at 11:03:24 UTC, Adam D Ruppe wrote: Fun fact there: any child implementations do NOT need to specify the attribute there; the compiler will copy it from the interface for you. I suppose these are the day-to-day minor details you can rely on to avoid typing a lot of

Re: interface function member declarations needing parameter attributes ?

2021-07-18 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 18 July 2021 at 03:27:04 UTC, someone wrote: I have an interface with function members *not* being declared @safe (at first glance it seemed irrelevant to me just to mark @safe a declaration and not an actual implementation). Yeah, that'd be promising all child implementations are

Re: interface function member declarations needing parameter attributes ?

2021-07-17 Thread someone via Digitalmars-d-learn
On Saturday, 17 July 2021 at 21:01:00 UTC, Adam Ruppe wrote: From the interface perspective: are these signatures identical or not ? No, they are very different. This helped me solve an issue that I carried since a few days ago: I have an interface with function members *not* being

Re: interface function member declarations needing parameter attributes ?

2021-07-17 Thread someone via Digitalmars-d-learn
On Saturday, 17 July 2021 at 22:48:00 UTC, Adam D Ruppe wrote: On Saturday, 17 July 2021 at 22:43:15 UTC, someone wrote: So the lesson learned is that interfaces can also mandate member function's parameter attributes then ... right ? A subclass must accept anything the parent class can, but

Re: interface function member declarations needing parameter attributes ?

2021-07-17 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 17 July 2021 at 22:43:15 UTC, someone wrote: So the lesson learned is that interfaces can also mandate member function's parameter attributes then ... right ? A subclass must accept anything the parent class can, but it can also make it stricter if you want. class Base {

Re: interface function member declarations needing parameter attributes ?

2021-07-17 Thread someone via Digitalmars-d-learn
On Saturday, 17 July 2021 at 21:01:00 UTC, Adam Ruppe wrote: No, they are very different. So the lesson learned is that interfaces can also mandate member function's parameter attributes then ... right ? But you also don't gain much from const here and that ref is probably actively

Re: interface function member declarations needing parameter attributes ?

2021-07-17 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 17 July 2021 at 20:42:06 UTC, someone wrote: From the interface perspective: are these signatures identical or not ? No, they are very different. But you also don't gain much from const here and that ref is probably actively harmful so i wouldn't use them here.