Originally Posted by monarch_dodra Because your this points to a B, which is not a D. Okey, let me change the function main a little bit, Code: int main() { D* pD = new D; B& b = *pD; test(b); delete pD; return 0; } This time it works. It looks like I can design my conversion operator as a dynamic_cast operator.
int main() { D* pD = new D; B& b = *pD; test(b); delete pD; return 0; }
Forum Rules