August 13, 2004 stray override attribute | ||||
---|---|---|---|---|
| ||||
Quote from "dmd/html/d/attribute.html"
> The override attribute applies to virtual functions.
> It means that the function must override a function
> with the same name and parameters in a base class.
<< << sniplet 1 >> >>
class Parent{
int check;
}
class Child : Parent{
override int check;
}
<< << sniplet 2 >> >>
struct MyStruct{
override int check;
}
<< << sniplet 3 >> >>
struct MyStruct{
override int check(){
return 0;
}
}
<< << sniplet 4 >> >>
override int check;
<< << sniplet 5 >> >>
override int check(){
return 0;
}
dmd 0.98 compiles the sources without any errors.
Thomas
|
Copyright © 1999-2021 by the D Language Foundation