I'm getting a fatal linking error in the code below, it says:
]+0x10)||undefined reference to `base<node>::pass_derived(node)'|
I wanted to define a base
class which has a pointer called poly_type
and the base
class can also "access" from within itself another class called derived
. The problem I run into is line poly_type->pass_derived(n);
where the compiler doesn't want to see the derived class where I tried to pass an object of type node
. I'm guessing this is a limitation of C++, if so let me know. Heres the broken code,
edit seems like this has been asked somewhere else, I updated the source to reflect that opinion.