challenge: implement the max function
Andrei Alexandrescu (See Website For Email)
SeeWebsiteForEmail at erdani.org
Tue Jan 23 09:37:11 PST 2007
Andrey Khropov wrote:
> Andrei Alexandrescu (See Website for Email) wrote:
>
>> * First off, specifying storageof(T) T as the type of a function
>> argument means that the compiler will deduce the storage class of the
>> actual argument: if the argument is an lvalue, inout will be deduced.
>
> Ok, but now D doesn't allow to return lvalues from functions, so this won't
> satisfy (c) for any type except classes that define opMulAssign.
Future D will allow returning inout values. As you see, the maxreturn
type might specify a storage. Sorry I forgot to mention that.
Andrei
More information about the Digitalmars-d
mailing list