extern(C++): override nonvirtual member function
sfp
sfp at hush.ai
Fri Apr 25 16:59:10 UTC 2025
On Friday, 25 April 2025 at 05:24:55 UTC, evilrat wrote:
> both f() would be marked `final` in D which will tell it is
> 'nonvirtual override', and then you will have more headache.
I don't care if I have a headache or not, I need to wrap the C++
code and I can't change it. Needs must.
I tried this already. E.g.:
```
extern(C++) class A {
final void f() {}
void g() {} // need at least one virtual function...
}
extern(C++) class B: A {
final void f() {}
}
void main() {}
```
and dmd complains about it:
```
Error: function `main.B.f` cannot override `final` function
`main.A.f`
```
More information about the Digitalmars-d-learn
mailing list