Properties

Nick Sabalausky a at a.a
Fri Jan 9 07:55:01 PST 2009


"Miles" <_______ at _______.____> wrote in message 
news:gk7fau$f38$1 at digitalmars.com...
> Nick Sabalausky wrote:
>> Well, like I said, *If* we were to get overload-on-return-value. Not that
>> I'm itching for it or anything. I've just seen the idea discussed before 
>> and
>> if it hypothetically were to happen, then the above could work as a 
>> getter
>> equivilent.
>
> Ok. But I think such feature would create a mess. For example:
>
> int    func1() { ... }
> char[] func1() { ... }
>
> void   func2(int x) { ... }
> void   func2(char[] x) { ... }
>
> func2(func1()); // what is the expected behavior?
>
> When you are inferring types, you need somewhere to anchor the compiler
> decision, either on the sender or on the receiver side.

Like I said, I'm neither advocating nor condemning overload-on-return-value. 





More information about the Digitalmars-d mailing list