Thread overview |
---|
August 10, 2015 website update | ||||
---|---|---|---|---|
| ||||
It looks like this page: http://dlang.org/hash-map.html Should have the override keyword added the the member functions in Foo: class Foo { int a, b; size_t toHash() { return a + b; } bool opEquals(Object o) { Foo foo = cast(Foo) o; return foo && a == foo.a && b == foo.b; } } |
August 10, 2015 Re: website update | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tony | On Monday, 10 August 2015 at 10:34:56 UTC, Tony wrote:
> It looks like this page:
>
> http://dlang.org/hash-map.html
>
> Should have the override keyword added the the member functions in Foo:
>
> class Foo
> {
> int a, b;
>
> size_t toHash() { return a + b; }
>
> bool opEquals(Object o)
> {
> Foo foo = cast(Foo) o;
> return foo && a == foo.a && b == foo.b;
> }
> }
Also that return line is confusing. Some parenthesis could be put there.
|
August 10, 2015 Re: website update | ||||
---|---|---|---|---|
| ||||
Posted in reply to tcak | On Monday, 10 August 2015 at 11:20:32 UTC, tcak wrote:
> On Monday, 10 August 2015 at 10:34:56 UTC, Tony wrote:
>> It looks like this page:
>>
>> http://dlang.org/hash-map.html
>>
>> Should have the override keyword added the the member functions in Foo:
>>
>> class Foo
>> {
>> int a, b;
>>
>> size_t toHash() { return a + b; }
>>
>> bool opEquals(Object o)
>> {
>> Foo foo = cast(Foo) o;
>> return foo && a == foo.a && b == foo.b;
>> }
>> }
>
> Also that return line is confusing. Some parenthesis could be put there.
Click the "Improve this page" button in the upper right corner.
|
Copyright © 1999-2021 by the D Language Foundation