All right, all right! Interim decision regarding qualified Object methods
Steven Schveighoffer
schveiguy at yahoo.com
Fri Jul 13 04:42:31 PDT 2012
On Fri, 13 Jul 2012 00:18:22 -0400, Mehrdad <wfunction at hotmail.com> wrote:
> On Friday, 13 July 2012 at 03:57:21 UTC, Steven Schveighoffer wrote:
>> On Thu, 12 Jul 2012 23:51:22 -0400, Mehrdad <wfunction at hotmail.com>
>> wrote:
>>
>>> On Friday, 13 July 2012 at 02:19:49 UTC, Jonathan M Davis wrote:
>>>> That raises an interesting point. With these changes, what should
>>>> opEquals' signature be for classes?
>>>
>>> How about inout?
>>
>> No. opEquals returns bool.
>>
>> -Steve
>
> I meant more like
>
> bool opEquals(inout Object other) inout;
inout is meant to transfer the constancy of a parameter to the constancy
of the return value. During function execution, inout is treated as
another flavor of const (i.e. not modifiable).
The above function is basically equivalent to:
bool opEquals(const Object other) const;
-Steve
More information about the Digitalmars-d
mailing list