Detecting a property setter?
Jonathan M Davis
jmdavisprog at gmail.com
Mon Jul 19 14:25:01 PDT 2010
On Monday, July 19, 2010 13:42:51 Philippe Sigaud wrote:
> 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
I don't think that you're supposed to be able to have a getter property
returning a ref at the same time that you have a setter property with the same
name. It certainly sounds like it should be a bug in any case.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list