Detecting a property setter?

Philippe Sigaud philippe.sigaud at gmail.com
Mon Jul 19 13:42:51 PDT 2010


On Mon, Jul 19, 2010 at 22:06, Simen kjaeraas <simen.kjaras at gmail.com>wrote:

> template hasSetter(alias func) if (isCallable!(func)) {
>    enum hasSetter = isProperty!(func) &&
>        is( typeof( (){ func = ReturnType!(func).init; } ) );
> }
>
>
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?


Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100719/a72c0d74/attachment.html>


More information about the Digitalmars-d-learn mailing list