Pure delegate not quite pure?

Tofu Ninja via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 30 18:29:56 PDT 2015


On Wednesday, 1 July 2015 at 00:13:36 UTC, Jesse Phillips wrote:
> On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
>> On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer 
>> wrote:
>>> Have you tried placing const on the function signature? i.e.:
>>>
>>> pure int delegate() const d = () const {...
>>>
>>> That's how you'd do it (I think, didn't test) if the delegate 
>>> context pointer was a class/struct.
>>>
>>> -Steve
>>
>> Nah, says its only available for non-static member functions.
>
> hmm, it seems that this would be an appropriate enhancement. It 
> doesn't make sense on a function, but as it relates to 
> delegates I'd say it makes sense to allow const to be added.

const, immutable, shared, inout. Not sure if they all make sense 
on delegates, but those are the options for member functions, so 
they might apply to delegates as well.


More information about the Digitalmars-d-learn mailing list