<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD></HEAD>
<BODY style="font-family:'DejaVu Sans Mono'; font-size:12px"><div>On Mon, 19 Jul 2010 22:42:51 +0200, Philippe Sigaud &lt;philippe.sigaud@gmail.com&gt; wrote:<br><br><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex"><div class="gmail_quote">On Mon, Jul 19, 2010 at 22:06, Simen kjaeraas <span dir="ltr">&lt;<a href="mailto:simen.kjaras@gmail.com">simen.kjaras@gmail.com</a>&gt;</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;">
template hasSetter(alias func) if (isCallable!(func)) {<br><div class="im">
    enum hasSetter = isProperty!(func) &amp;&amp;<br></div>
        is( typeof( (){ func = ReturnType!(func).init; } ) );<br>
}<br><br></blockquote><div><br>In that case, for the second func, the one you call ReturnType on, how does the compiler knows it must take the ref uint one (the getter) and not the void func() one?<br><br><br>Philippe<br>
<br><br></div></div>
</blockquote><br>Simen is using the fact that the compiler already has to figure out if there is an overload that matches the requirements. So it ends up</div><div>taking the only one that works. Since it seems to ignore the ref return type property, the property that takes an uint argument must have a</div><div>higher precedence (gets checked if it works first).</div><div>I wonder if its because Walter probably implemented function overloading before properties and ref return types. Hopefully its a language</div><div>feature and not just a implementation side effect.</div><div><br></div><div>-Rory<br><br></div></BODY></HTML>