Click here to Skip to main content
15,905,068 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPure virtual base class question Pin
Erudite_Eric6-Jul-11 22:56
Erudite_Eric6-Jul-11 22:56 
AnswerRe: Pure virtual base class question Pin
వేంకటనారాయణ(venkatmakam)6-Jul-11 23:23
వేంకటనారాయణ(venkatmakam)6-Jul-11 23:23 
GeneralRe: Pure virtual base class question Pin
Erudite_Eric7-Jul-11 0:31
Erudite_Eric7-Jul-11 0:31 
GeneralRe: Pure virtual base class question Pin
Richard MacCutchan7-Jul-11 1:36
mveRichard MacCutchan7-Jul-11 1:36 
GeneralRe: Pure virtual base class question Pin
Erudite_Eric7-Jul-11 22:28
Erudite_Eric7-Jul-11 22:28 
GeneralRe: Pure virtual base class question Pin
Richard MacCutchan7-Jul-11 23:02
mveRichard MacCutchan7-Jul-11 23:02 
GeneralRe: Pure virtual base class question Pin
Niklas L7-Jul-11 8:54
Niklas L7-Jul-11 8:54 
AnswerRe: Pure virtual base class question Pin
CPallini7-Jul-11 2:52
mveCPallini7-Jul-11 2:52 
Eric__V wrote:
It seems that when an instance of a pure virtual base class is created, an instance of its child is in fact created.

When an instance of the derived class is created then you have also an instance of the base class (because 'derived' is 'base'): you cannot instantiate an abstract class.


Eric__V wrote:
An observation. VS finds it impossible to debug step into any functions of the _child instance.

Visual Studio debugger should be able to do that (the debugger is one of the amazing features of Visual Studio, in my opinion).


Eric__V wrote:
Further question. What if you have two descendents from _base. How does the compiler know which one to instantiate?

Choosing the appropriate derived class to instantiate (to get base class functionality) is up to you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Pure virtual base class question Pin
Erudite_Eric7-Jul-11 22:31
Erudite_Eric7-Jul-11 22:31 
QuestionRe: Pure virtual base class question Pin
Maximilien7-Jul-11 3:10
Maximilien7-Jul-11 3:10 
AnswerRe: Pure virtual base class question Pin
CPallini7-Jul-11 3:14
mveCPallini7-Jul-11 3:14 
GeneralRe: Pure virtual base class question Pin
Maximilien7-Jul-11 3:32
Maximilien7-Jul-11 3:32 
QuestionRe: Pure virtual base class question Pin
CPallini7-Jul-11 10:27
mveCPallini7-Jul-11 10:27 
AnswerRe: Pure virtual base class question Pin
Niklas L7-Jul-11 20:46
Niklas L7-Jul-11 20:46 
GeneralRe: Pure virtual base class question Pin
CPallini7-Jul-11 21:14
mveCPallini7-Jul-11 21:14 
GeneralRe: Pure virtual base class question Pin
Niklas L7-Jul-11 21:53
Niklas L7-Jul-11 21:53 
AnswerRe: Pure virtual base class question Pin
Maximilien8-Jul-11 2:55
Maximilien8-Jul-11 2:55 
AnswerRe: Pure virtual base class question Pin
Erudite_Eric7-Jul-11 22:33
Erudite_Eric7-Jul-11 22:33 
GeneralRe: Pure virtual base class question Pin
Stefan_Lang10-Jul-11 22:40
Stefan_Lang10-Jul-11 22:40 
GeneralRe: Pure virtual base class question Pin
Erudite_Eric10-Jul-11 22:43
Erudite_Eric10-Jul-11 22:43 
Questionoperator overloading problem....... Pin
gateway236-Jul-11 20:01
gateway236-Jul-11 20:01 
AnswerRe: operator overloading problem....... PinPopular
Niklas L6-Jul-11 21:11
Niklas L6-Jul-11 21:11 
GeneralRe: operator overloading problem....... Pin
Stefan_Lang7-Jul-11 23:58
Stefan_Lang7-Jul-11 23:58 
GeneralRe: operator overloading problem....... Pin
Niklas L8-Jul-11 1:06
Niklas L8-Jul-11 1:06 
AnswerRe: operator overloading problem....... Pin
JanakiramanElumalai7-Jul-11 4:09
JanakiramanElumalai7-Jul-11 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.