Max:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
transferAttributes attaches the attributes to the local declaration. I'd be surprised if they were copied to the outer declaration. Or did you mean attributing the return *type*?</blockquote><div><br></div><div>The declaration. The type, I guess I'd use an alias. Though, I guess the alias syntax limitations would probably forbid that.</div>
<div><br></div><div>So yes, the local declaration is attributed, that works. How do I propagate the attribute to the returned value?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also, dropping the auto return is not accepted by the compiler, even though it seems natural for me:<br>

<br>
@(__traits(getAttributes, origin)) To transferAttributes(alias origin, To)(To t)<br>
{<br>
    @(__traits(getAttributes, origin)) To temp = t;<br>
...<br>
<br>
'origin' is a template parameter and should be reachable to determine the return type.<br>
</blockquote>
<br></div>
That's a bug. </blockquote><div><br></div><div>Already filed?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Anyway, you are attributing the function declaration here, not the return type</blockquote>
<div><br></div><div>Hmm. Would @(attr) { ReturnType } functionName (...)  work?</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
, which is another problem as it looks we do not have a syntax for that and "auto" is required:<br>
<br>
auto foo()<br>
{<br>
    @attr struct S {}<br>
    return S.init;<br>
}<br><br></blockquote><div><br></div><div> </div></div>