Click here to Skip to main content
15,909,466 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: compile error about auto_ptr Pin
George_George24-Feb-08 16:58
George_George24-Feb-08 16:58 
GeneralRe: compile error about auto_ptr Pin
peterchen23-Feb-08 6:47
peterchen23-Feb-08 6:47 
GeneralRe: compile error about auto_ptr Pin
George_George24-Feb-08 16:12
George_George24-Feb-08 16:12 
GeneralRe: compile error about auto_ptr Pin
peterchen24-Feb-08 20:25
peterchen24-Feb-08 20:25 
GeneralRe: compile error about auto_ptr Pin
George_George24-Feb-08 21:05
George_George24-Feb-08 21:05 
GeneralRe: compile error about auto_ptr Pin
Mark Salsbery24-Feb-08 9:14
Mark Salsbery24-Feb-08 9:14 
GeneralRe: compile error about auto_ptr Pin
George_George24-Feb-08 16:13
George_George24-Feb-08 16:13 
Generalchange const property through overloading Pin
George_George22-Feb-08 23:18
George_George22-Feb-08 23:18 
Hello everyone,


I have tried compiler allows to change const property of an overloaded method. Here is my proof of concept code.

My question,

1. is it good code or good practice?
2. It yse in (1), are there any practical usage of this type of "overloading"?

class Base {
public:
	const int foo() {return 200;};
};

class Derived : public Base {
public:
		int foo() {return 100;};
};

int main()
{
	Base b;
	Derived d;
	int rtn = b.foo();
	rtn = d.foo();

	return 0;
}



thanks in advance,
George
GeneralRe: change const property through overloading Pin
Shog923-Feb-08 4:45
sitebuilderShog923-Feb-08 4:45 
GeneralRe: change const property through overloading Pin
George_George24-Feb-08 16:21
George_George24-Feb-08 16:21 
GeneralRe: change const property through overloading Pin
Shog924-Feb-08 16:33
sitebuilderShog924-Feb-08 16:33 
GeneralRe: change const property through overloading Pin
George_George24-Feb-08 16:52
George_George24-Feb-08 16:52 
GeneralRogarding doubt C,C++,MFC Pin
rowdy_vc++22-Feb-08 22:42
rowdy_vc++22-Feb-08 22:42 
GeneralRe: Rogarding doubt C,C++,MFC Pin
Rajkumar R22-Feb-08 22:45
Rajkumar R22-Feb-08 22:45 
GeneralRe: Rogarding doubt C,C++,MFC Pin
rowdy_vc++22-Feb-08 22:51
rowdy_vc++22-Feb-08 22:51 
GeneralRe: Rogarding doubt C,C++,MFC PinPopular
Cranky22-Feb-08 23:03
Cranky22-Feb-08 23:03 
GeneralRe: Rogarding doubt C,C++,MFC Pin
rowdy_vc++22-Feb-08 23:05
rowdy_vc++22-Feb-08 23:05 
GeneralRe: Rogarding doubt C,C++,MFC Pin
CPallini22-Feb-08 23:14
mveCPallini22-Feb-08 23:14 
QuestionRe: Rogarding doubt C,C++,MFC Pin
Rajkumar R22-Feb-08 23:32
Rajkumar R22-Feb-08 23:32 
GeneralRe: Rogarding doubt C,C++,MFC Pin
Rajesh R Subramanian23-Feb-08 3:31
professionalRajesh R Subramanian23-Feb-08 3:31 
GeneralRe: Rogarding doubt C,C++,MFC Pin
Christian Graus23-Feb-08 12:43
protectorChristian Graus23-Feb-08 12:43 
GeneralRe: Rogarding doubt C,C++,MFC Pin
Cranky22-Feb-08 22:58
Cranky22-Feb-08 22:58 
GeneralRe: Rogarding doubt C,C++,MFC Pin
rowdy_vc++22-Feb-08 23:34
rowdy_vc++22-Feb-08 23:34 
GeneralRe: Rogarding doubt C,C++,MFC Pin
Cranky22-Feb-08 23:40
Cranky22-Feb-08 23:40 
GeneralRe: Rogarding doubt C,C++,MFC Pin
rowdy_vc++22-Feb-08 23:42
rowdy_vc++22-Feb-08 23:42 

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.