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 » callback1 vs callback2
callback1 vs callback2 [message #15281] Tue, 15 April 2008 14:28 Go to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Why can I do this:
void CBTestFunc2(String foo, String bar){
    Cout() << foo << " " << bar << "\n;"
}

Callback1<String> cb1 = callback1(&CBTestFunc2, "parameter 2"));
cb1("parameter 1");


But not:
void CBTestFunc3(String one, String two, String three){
    Cout() << Format("%s %s %s", one, two, three);
}

Callback1<String> cb2 = callback2(&CBTestFunc3, "two", "three");
cb2("one");


?

The error is: Could not deduce template argument for Upp::Callback2<P1,P2>
Re: callback1 vs callback2 [message #15291 is a reply to message #15281] Tue, 15 April 2008 21:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, only because that parcticular kind of callback is not defined (yet).

Mirek
Re: callback1 vs callback2 [message #15297 is a reply to message #15291] Tue, 15 April 2008 22:17 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Oh, ok. Is it an easy fix to add that capability?
Re: callback1 vs callback2 [message #15310 is a reply to message #15297] Wed, 16 April 2008 09:27 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I believe there is a related recent thread somewhere in the forum.

Maybe we should gather a list of missing variants first?

Mirek
Previous Topic: Setting a Gate argument.
Next Topic: Is there an easy way to leverage callback into multi-cast delegate?
Goto Forum:
  


Current Time: Fri Mar 29 12:10:49 CET 2024

Total time taken to generate the page: 0.01064 seconds