Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Getting the same value everytime?? Pin
Peter Weyzen16-Jul-03 7:58
Peter Weyzen16-Jul-03 7:58 
AnswerRe: Getting the same value everytime?? Pin
Ryan Binns16-Jul-03 17:33
Ryan Binns16-Jul-03 17:33 
GeneralEDID data, display driver Pin
oliver.hu16-Jul-03 5:19
oliver.hu16-Jul-03 5:19 
GeneralTemplates and functions Pin
Bernhard16-Jul-03 4:59
Bernhard16-Jul-03 4:59 
GeneralRe: Templates and functions Pin
Ryan Binns16-Jul-03 5:06
Ryan Binns16-Jul-03 5:06 
GeneralRe: Templates and functions Pin
Andrew Walker17-Jul-03 3:03
Andrew Walker17-Jul-03 3:03 
GeneralRe: Templates and functions Pin
Bernhard17-Jul-03 3:29
Bernhard17-Jul-03 3:29 
Generalmy solution (pretty neat i think) Pin
Bernhard17-Jul-03 4:14
Bernhard17-Jul-03 4:14 
well.. after writing the pseudocode (thinking again about this problem), i found out this solution by myself..
template <void f1(), void f2>
class call_fun 
{	
        call_fun () {};
public:
	call_fun (char c) 
        {	
		if('A' == c)
		{
			cout << "call_fun: A selected" << endl;
			f1();
		}
		else
		{
			cout << "call_fun: not A selected" << endl;
			f2();
		}
	};
};
void fun11()
{
	cout << "Hello from fun11" << endl;
}

void fun12()
{
	cout << "Hello from fun12" << endl;
}

void fun21()
{
	cout << "Hello from fun21" << endl;
}

void fun22()
{
	cout << "Hello from fun22" << endl;
}


int main()
{
	call_fun<&fun11, &fun12> a ('A');
	call_fun<&fun11, &fun12> b ('B'); 
	
	cout << endl;

	call_fun<&fun21, &fun22> c('A');
	call_fun<&fun21, &fun22> d('B'); 

	return 0;
}




"I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
Generalpolling for data on serial port Pin
butterbean73016-Jul-03 4:50
butterbean73016-Jul-03 4:50 
GeneralRe: polling for data on serial port Pin
John R. Shaw16-Jul-03 6:21
John R. Shaw16-Jul-03 6:21 
GeneralDisplay cad drawings Pin
BigBabyJesus16-Jul-03 4:09
BigBabyJesus16-Jul-03 4:09 
GeneralRe: Display cad drawings Pin
Ryan Binns16-Jul-03 4:21
Ryan Binns16-Jul-03 4:21 
GeneralRussian string to/from file Pin
Bartosz Bien16-Jul-03 3:41
Bartosz Bien16-Jul-03 3:41 
GeneralRe: Russian string to/from file Pin
Ryan Binns16-Jul-03 4:11
Ryan Binns16-Jul-03 4:11 
GeneralGet Number of Logical Processors Pin
Nathan Blomquist16-Jul-03 3:41
Nathan Blomquist16-Jul-03 3:41 
GeneralRe: Get Number of Logical Processors Pin
valikac16-Jul-03 4:46
valikac16-Jul-03 4:46 
GeneralRe: Get Number of Logical Processors Pin
Nathan Blomquist16-Jul-03 7:41
Nathan Blomquist16-Jul-03 7:41 
GeneralRe: Get Number of Logical Processors Pin
basementman16-Jul-03 4:55
basementman16-Jul-03 4:55 
GeneralRe: Get Number of Logical Processors Pin
Nathan Blomquist16-Jul-03 7:41
Nathan Blomquist16-Jul-03 7:41 
GeneralRe: Get Number of Logical Processors Pin
Nathan Blomquist17-Jul-03 6:48
Nathan Blomquist17-Jul-03 6:48 
GeneralDeclaration Question Pin
Brian van der Beek16-Jul-03 3:23
Brian van der Beek16-Jul-03 3:23 
GeneralRe: Declaration Question Pin
Ryan Binns16-Jul-03 4:07
Ryan Binns16-Jul-03 4:07 
GeneralRe: Declaration Question Pin
Brian van der Beek16-Jul-03 4:54
Brian van der Beek16-Jul-03 4:54 
GeneralRe: Declaration Question Pin
Ryan Binns16-Jul-03 4:59
Ryan Binns16-Jul-03 4:59 
GeneralCWebBrowser2 scrollbar question. Pin
Maximilien16-Jul-03 3:16
Maximilien16-Jul-03 3:16 

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.