Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » partial parametrizing of Callback<>
Re: partial parametrizing of Callback<> [message #27410 is a reply to message #27409] Fri, 16 July 2010 07:06 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
yeaaaaaa, and it works..thanks a lot.

i didnt know something like that was possible, found callback was strict enough concerning type checks.. well perfect. has this support for such semmi parametrized Callback arrived recently or already long time ago.

but what does not work is with 3 params..
void MyCallback::Action(int i, float f)
{
	RLOG("" << i << " " << f);
}

void MyCallback::Action2(int i, float f, int k)
{
	RLOG("" << i << " " << f);
}

void MyCallback::Test()
{
	//works
	Callback1<int> cb;
	cb = callback1(this, &CLASSNAME::Action, 12.0f);
	cb(123);	

	//DONT works
	Callback2<int, float> cb2;
	cb2 = callback2(this, &CLASSNAME::Action2, 1234);
	cb2(234, 10.f);

	//DONT works
	Callback1<int> cb3;
	cb3 = callback1(this, &CLASSNAME::Action2, 1234, 13.0f);
	cb3(234);
}


[Updated on: Fri, 16 July 2010 07:20]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Strange crash connected to Timer
Next Topic: PROPOSAL: delegate like separation of method and args in Callbacks
Goto Forum:
  


Current Time: Thu Mar 28 21:44:21 CET 2024

Total time taken to generate the page: 0.01475 seconds