Adding pure to a function type

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Oct 26 15:47:03 UTC 2017


On 10/26/2017 11:10 AM, Adam D. Ruppe wrote:
> On Thursday, 26 October 2017 at 15:04:52 UTC, Andrei Alexandrescu wrote:
>> So I went with the hammer that will fix anything - a string mixin. 
>> Ideas for a nicer solution?
> 
> The stdlib has: SetFunctionAttributes in std.traits
> 
> http://dpldocs.info/experimental-docs/std.traits.SetFunctionAttributes.1.html 
> 
> 
> 
> Its implementation is string mixin, but at least on the user side it 
> looks less hideous.

s/less hideous/even more awesome/

No need to be testy :o).

I noticed there's no way to say "just leave linkage as is". I tried 
SetFunctionAttributes!(typeof(&impl), null, FunctionAttribute.pure_) and 
SetFunctionAttributes!(typeof(&impl), "", FunctionAttribute.pure_) but 
neither worked. Should I file a bug?


Andrei


More information about the Digitalmars-d mailing list