<div dir="ltr"><div>I feel like we really need parametric attributes...</div><div><br></div><div>I constantly have situations like this:</div><div>  void f(CallbackFun cb) { cb(); }<br></div><div>Where the attribute-ness of a function depends on the attribute-ness of the callback.</div><div><br></div><div>I want my function to be @nogc, but I don't want to require the user supply a @nogc callback to use my API.</div><div><br></div><div>If we're going to have all these attributes, then we really need something like this:</div><div>  void f(CallbackFun cb)

<a class="gmail_plusreply" id="plusReplyChip-4">@nogc(is(</a>cb : <a class="gmail_plusreply" id="plusReplyChip-5">@nogc))</a></div><div><br></div><div>This applies to the classic suite of attributes.</div><div><br></div><div>The trouble with this, obviously, is; how do you mangle this function? It's not a template... so...?</div><div><br></div><div>That problem feels loosely related to `inout`, which is an innovative hack... I wonder if some generalisation of that concept could be satisfying here, while also satisfying the actual input case (allowing to delete `inout` from the language)...?</div><div><br></div><div>It's a whole category of problem that needs some expression... where the attribute-ness of a declaration is dependent on the attribute-ness of some facet of the declaration; and where the declaration is not a template.<br></div></div>