equivariant functions

Steven Schveighoffer schveiguy at yahoo.com
Tue Oct 14 21:55:12 PDT 2008


"Denis Koroskin" wrote
> On Wed, 15 Oct 2008 05:44:22 +0400, Steven Schveighoffer 
> <schveiguy at yahoo.com> wrote:
>
>> "Denis Koroskin" wrote
>>> Now that I thought about it a little more (please, see and comment my 
>>> post
>>> about typeof(this) nearby), I agree that the issues are related.
>>>
>>> However, the best solution could be a combination of both.
>>>
>>> For example, I agree that interface IClonable should be as follows:
>>>
>>> interface IClonable { typeof(this) clone() const; }
>>
>> No.  IClonable should be:
>>
>> IClonable clone() const;
>>
>> or if you prefer:
>>
>> Object clone() const;
>>
>> It can't be anything else, because IClonable cannot define how many 
>> levels
>> deep it goes.
>>
> Nope, you missed the idea. Was my post too long?

Yes, I did miss the idea.  My apologies, I was not looking at equivariance 
meaning 'forcing derived classes to implement certain functions'.

See my later post in reply to Andrei.

Sorry for the confusion.

-Steve 





More information about the Digitalmars-d mailing list