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++ Core » Possible bug/clarification only callback2 was changed for const Object*
Re: Possible bug/clarification only callback2 was changed for const Object* [message #20600 is a reply to message #20597] Wed, 25 March 2009 16:13 Go to previous messageGo to previous message
hans is currently offline  hans
Messages: 44
Registered: March 2006
Location: Germany
Member
Hi Mirek, to clarify:

We have const/non-const functions for callback2,3,4 but only
for the const callback2 the code was changed to include the const in the template class constructor, but not for const callback3/4. See:

template <class Object, class R, class O, class A, class B, class T1, class T2>
Callback callback2(const Object *object, R (O::*method)(A, B) const, T1 arg1, T2 arg2) {
	return Callback(new CallbackMethodActionArg2<const Object, R (O::*)(A, B) const, T1, T2>
// here const was inserted                           ^^^^^
	                    (object, method, arg1, arg2));
}

...

template <class Object, class R, class O, class A, class B, class C, class T1, class T2, class T3> 
Callback callback3(const Object *object, R (O::*method)(A, B, C) const, T1 arg1, T2 arg2, T3 arg3) {
	return Callback(new CallbackMethodActionArg3<Object, R (O::*)(A, B, C) const, T1, T2, T3>
// no const was inserted                             ^
	                    (object, method, arg1, arg2, arg3));
}


....

template <class Object, class R, class O, class A, class B, class C, class D, class T1, class T2, class T3, class T4> 
Callback callback4(const Object *object, R (O::*method)(A, B, C, D) const, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
	return Callback(new CallbackMethodActionArg4<Object, R (O::*)(A, B,C,D) const, T1, T2, T3, T4>
// no const was inserted                             ^
	                    (object, method, arg1, arg2, arg3, arg4));
}

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: The problem with 'Null'
Next Topic: UTF8 and accented characters
Goto Forum:
  


Current Time: Mon Sep 08 13:13:12 CEST 2025

Total time taken to generate the page: 0.07407 seconds