Discussion Thread: DIP 1032--Function pointers and Delegate Parameters...--Community Review Round 1
Mathias LANG
geod24 at gmail.com
Thu Jul 30 08:30:01 UTC 2020
On Thursday, 30 July 2020 at 06:08:07 UTC, Walter Bright wrote:
> On 7/29/2020 8:23 PM, Mathias LANG wrote:
>> On Thursday, 30 July 2020 at 03:16:02 UTC, Walter Bright wrote:
>>> On 7/29/2020 4:26 AM, Dennis wrote:
>>>> How would you solve this if you were the library author?
>>>
>>> The usual way is with templates.
>>
>> It doesn't work for `Object.toString` which is the textbook
>> use case for this.
>
> That's really a problem with Object.toString.
Object.toString is just an example.
The problem is that sometimes, you can't template. Like when
using classes.
So the inherent problem is, how do we compose attributes and
non-template-able code ?
Note that if you are using templates, DIP1032 has little benefit
either, because you can just template the delegate so the
attributes are infered.
More information about the Digitalmars-d
mailing list