<div class="gmail_quote">On 6 April 2012 17:23, Steven Schveighoffer <span dir="ltr"><<a href="mailto:schveiguy@yahoo.com">schveiguy@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">You can store a struct, just return it from an attribute function.</div>
<br>
e.g.:<br>
<br>
@attribute Author author(string name) { return Author(name);}<br>
<br>
Why should we be restricted to only structs?  Or any type for that matter?<br>
<br>
The benefit to using CTFE functions is that the compiler already knows how to deal with them at compile-time.  i.e. less work to make the compiler implement this.<br></blockquote><div><br></div><div>Yep, I see now. If this is significantly simpler, then so be it. Whatever gets it done. This certainly meets my requirements.</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">I also firmly believe that determining what is allowed as attributes should be opt-in.  Just allowing any struct/class/function/etc. would lead to bizarre declarations.<br>
</blockquote><div><br></div><div>I see your point, and I also had this thought. I'm on the fence though, not sure if it's valuable or not.</div><div>Does this approach really change that though? It could return anything it likes, and then it's no different than binding one of those directly.</div>
</div>