Parametric attributes

Imperatorn johan_forsberg_86 at hotmail.com
Wed Oct 2 16:14:39 UTC 2024


On Wednesday, 2 October 2024 at 00:43:44 UTC, Manu wrote:
> I feel like we really need parametric attributes...
>
> I constantly have situations like this:
>   void f(CallbackFun cb) { cb(); }
> Where the attribute-ness of a function depends on the 
> attribute-ness of the
> callback.
>
> [...]

What I like about the

"void f(CallbackFun cb) @nogc(is(cb : @nogc))"

solution is that it's "easy" to do with little work compared to 
other solutions while still being intuitive and cover most 
practical use cases.


More information about the Digitalmars-d mailing list