<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/11/20 Jakob Ovrum <span dir="ltr"><<a href="mailto:jakobovrum@gmail.com" target="_blank">jakobovrum@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br></div><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I was not sure that the fun!int is legitimate usage.<br>
</blockquote>
<br></div>
I also ask this question. I think it may prove useful, and code in the wild might be relying on it.</blockquote><div><br></div><div><div>One of the known issue is, that the specified type parameters may not match exactly to the function parameters position.</div>
<div><br></div><div>You can make a partially specialized lambda like follows.</div><div><br></div><div>X!((int a, b) => a + b)</div><div><br></div><div>Then, inside X(alias fun), fun!long means instantiate (int a, long b){ return a + b; }.</div>
</div><div>And of course, fun!(int, int) will be invalid.</div><div><br></div><div>So, specifying type parameter for the template lambda will make the template code unreliable.</div><div><br></div><div>I think it is not good feature in general.</div>
<div><br></div><div>Kenji Hara</div></div></div></div>