C
Carl R. Davies
I was reading this link http://www.icce.rug.nl/documents/cplusplus/cplusplus14.html#l198
heading "14.10 Virtual Constructors"
I am struggling to understand the issue the author is trying to solve.
This paragraph is confusing me:
"As we have seen (section 14.2) C++ supports virtual destructors. Like
many other object oriented languages (e.g., Java), however, the notion
of a virtual constructor is not supported. The absence of a virtual
constructor turns into a problem when only a base class reference or
pointer is available, and a copy of a derived class object is
required."
What's wrong with down casting the base class pointer and using
assignment?
I have a feeling the answer is simple and I'm just being dense
heading "14.10 Virtual Constructors"
I am struggling to understand the issue the author is trying to solve.
This paragraph is confusing me:
"As we have seen (section 14.2) C++ supports virtual destructors. Like
many other object oriented languages (e.g., Java), however, the notion
of a virtual constructor is not supported. The absence of a virtual
constructor turns into a problem when only a base class reference or
pointer is available, and a copy of a derived class object is
required."
What's wrong with down casting the base class pointer and using
assignment?
I have a feeling the answer is simple and I'm just being dense