On Friday, 29 January 2016 at 15:13:45 UTC, Mike Parker wrote:
The first implementation is fine because you're overriding the
implementation in the base class (Object). However, the second
one fails because it's a template. Templates are non-virtual
and cannot override anything. Even if you cou
On Friday, 29 January 2016 at 15:00:59 UTC, pineapple wrote:
With this bit of code, the first method seems to work fine -
things go as expected. But I get a compile error with the
second method, and I'm not sure how else to write this.
override bool opEquals(Object value) const{
re
It also occurred to me to do something like this, but it isn't
accepted either.
override bool opEquals(T)(T value){
return this.equals(value);
}
With this bit of code, the first method seems to work fine -
things go as expected. But I get a compile error with the second
method, and I'm not sure how else to write this.
override bool opEquals(Object value) const{
return this.equals(cast(typeof(this)) value);
}
override