<div class="gmail_quote">On Mon, Apr 5, 2010 at 12:52, Philippe Sigaud <span dir="ltr"><<a href="mailto:philippe.sigaud@gmail.com">philippe.sigaud@gmail.com</a>></span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote"><div>That's useful to compare two functions:<br><br>template sameArgs(alias fun1, alias fun2) {<br> static if (compare!(ParameterTypeTuple!fun1, ParameterTypeTuple!fun2))<br></div></div></blockquote>
<div><br>Ugh, forget this example, in this case we know the original tuples, so == is simpler and cleaner.<br><br>Another interesting thing to test is if one typetuple can be converted into another.<br>Maybe like this:<br>
<br>bool compatibleTypeTuples(TT...) {<br> TT[0..$/2] tt1;<br> TT[$/2..$] tt2;<br> static if (__traits(compiles, tt1 = tt2))<br> return true;<br> else<br> return false;<br>}<br> </div></div>