Undefined symbol for, apparently, valid code?

unleashy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 6 08:11:23 PDT 2017


On Thursday, 6 July 2017 at 06:48:57 UTC, rikki cattermole wrote:
> Templates+classes = require function body.
>
> Why? Templated methods are not virtual, they are final and 
> cannot be inherited (so its a little strange that the override 
> is valid).

Ah well. I would've expected a compiler error, not an obscure 
linker error, but as Arafel said:

>Finally, have also in mind that if the function had been 
>declared abstract (as it arguably should), a compile-time error 
>would have been generated [2].

Maybe it was an error on my part for not declaring the function 
as abstract? My view was that the abstract attribute on a class 
marks all its members as virtual unless they have a body, which 
is how it works in, say, Java.

Still, kinda odd that the linker is the one to call me out, and 
not the compiler. Pretty unexpected.



More information about the Digitalmars-d-learn mailing list