Home » U++ Library support » U++ Core » Possible bug/clarification only callback2 was changed for const Object*
Possible bug/clarification only callback2 was changed for const Object* [message #20586] |
Tue, 24 March 2009 16:14 |
hans
Messages: 44 Registered: March 2006 Location: Germany
|
Member |
|
|
Hi,
in current (1007) svn repository, in the function
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>
}
the template class was changed from
CallbackMethodActionArg2<Object, ....>
to
CallbackMethodActionArg2<const Object, ....>
But, the other functions callback3, callback4 are not changed.
I think this should made consistent IMHO.
|
|
|
Re: Possible bug/clarification only callback2 was changed for const Object* [message #20597 is a reply to message #20586] |
Wed, 25 March 2009 08:39 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
hans wrote on Tue, 24 March 2009 11:14 | Hi,
in current (1007) svn repository, in the function
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>
}
the template class was changed from
CallbackMethodActionArg2<Object, ....>
to
CallbackMethodActionArg2<const Object, ....>
But, the other functions callback3, callback4 are not changed.
I think this should made consistent IMHO.
|
In "my copy" of Callback.h, there seem to always be both variants (non-const and const) for callback2, 3, 4, which IMO makes sense...
Mirek
|
|
|
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 |
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));
}
|
|
|
|
Goto Forum:
Current Time: Fri Nov 01 01:16:09 CET 2024
Total time taken to generate the page: 0.01944 seconds
|