Actually I better report this, it might lead to unexpected behavior otherwise. See, this will compile:<br><br>import std.stdio;<br><br>auto template_func(alias func, T...)(T args)<br>{<br> return func.mangleof;<br>}<br>
<br>void test() {}<br><br>unittest<br>{ <br> writeln(template_func!(test, int)(1));<br>}<br><br>void main() { }<br><br><br>And this won't:<br><br>import std.stdio;<br><br>auto template_func(alias func, T...)(T args)<br>
{<br> return func.mangleof;<br>}<br><br>void test(int x) {}<br><br>unittest<br>{ <br> writeln(template_func!(test, int)(1));<br>}<br><br>void main() { }<br><br>(I've added a parameter to test()). The problem is the first code actually called func, and succeeded silently since it takes no parameters. I don't think this is an expected behavior?<br>
<br><div class="gmail_quote">On Sat, Aug 7, 2010 at 3:10 AM, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com">andrej.mitrovich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, Aug 6, 2010 at 8:40 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisprog@gmail.com" target="_blank">jmdavisprog@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On Friday, August 06, 2010 08:08:03 Andrej Mitrovic wrote:<br>
> I've already tried that. But .mangleof on an aliased symbol just returns<br>
> "alias" as a string.<br>
<br>
</div>That sounds like a bug report in the making.<br>
<font color="#888888"><br>
- Jonathan M Davis<br>
</font></blockquote></div><br></div></div>No I was wrong, it won't allow me to use .mangleof on an alias of a function inside a template because that automatically calls the function (and that means I have to pass valid arguments to it). The mangledName!() template works just fine though. But I don't need mangled names, I was only using it as a workaround.<br>
</blockquote></div><br>