Resolving conflicting functions

Derek Parnell derek at nomail.afraid.org
Mon Dec 3 19:04:40 PST 2007


On Tue, 04 Dec 2007 11:23:18 +0900, Bill Baxter wrote:

> I think in D2 you should be able to use typeof(return) to remove the 
> need for the extra helper template, Ret.
> Totally untried though.
> 
> // ------------------------
> typeof(return) opDiv(T)(T pFactor)
> // ------------------------
> {
>   static if(is(T == Currency))
>     return  mData / pFactor.mData;
>   else
>     return  this.mData / pFactor;
> }
> 
> --bb

Nope. "typeof(return) must be inside a function"

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
4/12/2007 2:03:49 PM


More information about the Digitalmars-d-learn mailing list