No 'is not implemented' message with final?

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Sep 10 14:03:44 PDT 2013


> Bug or feature?

You will get a linker error when you try to use the function.

This is a feature, because you can implement this function later or
even in another module (and set mangling to match).

Example of the former:

-----
interface A {
public:
    final void bar();  // declaration

    /** ... */

    final void bar() { }  // implementation
}
-----

For the latter:

-----
interface A {
public:
    final void bar();
}

class B : A {
}

pragma(mangle, A.bar.mangleof)
void A_bar_impl(A _this) { }
-----

The mangle pragma feature is new in git-head.


More information about the Digitalmars-d-learn mailing list