Click here to Skip to main content
15,913,242 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMakes inheritance C++ slower than C? Pin
Cyon11125-Aug-08 23:18
Cyon11125-Aug-08 23:18 
AnswerRe: Makes inheritance C++ slower than C? [modified] Pin
Jijo.Raj25-Aug-08 23:32
Jijo.Raj25-Aug-08 23:32 
GeneralRe: Makes inheritance C++ slower than C? Pin
Rajesh R Subramanian26-Aug-08 0:01
professionalRajesh R Subramanian26-Aug-08 0:01 
GeneralRe: Makes inheritance C++ slower than C? Pin
Jijo.Raj26-Aug-08 0:46
Jijo.Raj26-Aug-08 0:46 
AnswerRe: Makes inheritance C++ slower than C? Pin
Matthew Faithfull25-Aug-08 23:32
Matthew Faithfull25-Aug-08 23:32 
GeneralRe: Makes inheritance C++ slower than C? Pin
Cyon11125-Aug-08 23:48
Cyon11125-Aug-08 23:48 
GeneralRe: Makes inheritance C++ slower than C? Pin
Cedric Moonen25-Aug-08 23:58
Cedric Moonen25-Aug-08 23:58 
GeneralRe: Makes inheritance C++ slower than C? Pin
Matthew Faithfull26-Aug-08 0:12
Matthew Faithfull26-Aug-08 0:12 
Exactly. Of course as Cedric says it's not al about performance. There's also all the cool things you can do with inheritance that you could of course do without it but it wouldn't be any fun.
Here's my map class for example

<br />
//--------------------------------------------------------------------------------<br />
template < class TFirst, class TSecond ><br />
class CTMap : public CTIndexedArray < CTMapPair < TFirst, TSecond > ><br />
{<br />
public:<br />
	typedef CTMapPair<TFirst, TSecond> TItem;<br />
<br />
	CTMap()<br />
	{<br />
	}<br />
<br />
	virtual ~CTMap()<br />
	{<br />
	}<br />
<br />
	bool operator != (CTMap<TFirst, TSecond>& Comperand)<br />
	{<br />
		return ! CTIndexedArray< TItem >::operator ==(Comperand);<br />
	}<br />
};<br />


Yep, that's all of it. So small I can post it here thanks to inheritance. Big Grin | :-D

"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)

AnswerRe: Makes inheritance C++ slower than C? Pin
Cedric Moonen25-Aug-08 23:43
Cedric Moonen25-Aug-08 23:43 
GeneralRe: Makes inheritance C++ slower than C? Pin
Cyon11126-Aug-08 0:01
Cyon11126-Aug-08 0:01 
AnswerRe: Makes inheritance C++ slower than C? Pin
toxcct25-Aug-08 23:52
toxcct25-Aug-08 23:52 
GeneralRe: Makes inheritance C++ slower than C? Pin
Cyon11126-Aug-08 0:25
Cyon11126-Aug-08 0:25 
GeneralRe: Makes inheritance C++ slower than C? Pin
Rajesh R Subramanian26-Aug-08 0:34
professionalRajesh R Subramanian26-Aug-08 0:34 
GeneralRe: Makes inheritance C++ slower than C? Pin
Cyon11126-Aug-08 0:46
Cyon11126-Aug-08 0:46 
GeneralRe: Makes inheritance C++ slower than C? Pin
toxcct26-Aug-08 1:03
toxcct26-Aug-08 1:03 
JokeRe: Makes inheritance C++ slower than C? Pin
Rage26-Aug-08 3:19
professionalRage26-Aug-08 3:19 
GeneralRe: Makes inheritance C++ slower than C? Pin
toxcct26-Aug-08 3:23
toxcct26-Aug-08 3:23 
GeneralRe: Makes inheritance C++ slower than C? Pin
Cyon11126-Aug-08 3:27
Cyon11126-Aug-08 3:27 
GeneralRe: Makes inheritance C++ slower than C? Pin
toxcct26-Aug-08 3:31
toxcct26-Aug-08 3:31 
GeneralRe: Makes inheritance C++ slower than C? Pin
toxcct26-Aug-08 0:43
toxcct26-Aug-08 0:43 
GeneralRe: Makes inheritance C++ slower than C? Pin
Roger Stoltz26-Aug-08 1:16
Roger Stoltz26-Aug-08 1:16 
GeneralRe: Makes inheritance C++ slower than C? Pin
toxcct26-Aug-08 1:19
toxcct26-Aug-08 1:19 
GeneralRe: Makes inheritance C++ slower than C? Pin
Roger Stoltz26-Aug-08 1:22
Roger Stoltz26-Aug-08 1:22 
QuestionRe: Makes inheritance C++ slower than C? Pin
David Crow26-Aug-08 4:55
David Crow26-Aug-08 4:55 
AnswerRe: Makes inheritance C++ slower than C? Pin
Cyon11126-Aug-08 6:09
Cyon11126-Aug-08 6: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.