From 3ba3bb50f990dbd0fceeb2894a15539d46ee0a77 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 9 Nov 2016 12:34:17 -0600 Subject: [PATCH] callback - Fixed type-deduction when inheritance is involved The type deduction for the callback constructors was to strict and prevented implicit casts for the context pointer stored internally. As noted by @pan-, relaxing the contraints on the templated parameters allows C++ to correctly infer implicit casts such as conversions between child and parent classes when inheritance is involved. As an additional benefit, this may help the user experience by defering invalid type errors to when the types are expanded, limiting the number of error messages presented to users. --- platform/Callback.h | 336 ++++++++++++++++++++++---------------------- 1 file changed, 168 insertions(+), 168 deletions(-) diff --git a/platform/Callback.h b/platform/Callback.h index d76e32be64..f07e0fc2ed 100644 --- a/platform/Callback.h +++ b/platform/Callback.h @@ -90,8 +90,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(T *obj, R (T::*method)()) { + template + Callback(U *obj, R (T::*method)()) { generate(method_context(obj, method)); } @@ -99,8 +99,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const T *obj, R (T::*method)() const) { + template + Callback(const U *obj, R (T::*method)() const) { generate(method_context(obj, method)); } @@ -108,8 +108,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(volatile T *obj, R (T::*method)() volatile) { + template + Callback(volatile U *obj, R (T::*method)() volatile) { generate(method_context(obj, method)); } @@ -117,8 +117,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const volatile T *obj, R (T::*method)() const volatile) { + template + Callback(const volatile U *obj, R (T::*method)() const volatile) { generate(method_context(obj, method)); } @@ -366,8 +366,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(T *obj, R (T::*method)()) { + template + void attach(U *obj, R (T::*method)()) { this->~Callback(); new (this) Callback(obj, method); } @@ -376,8 +376,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const T *obj, R (T::*method)() const) { + template + void attach(const U *obj, R (T::*method)() const) { this->~Callback(); new (this) Callback(obj, method); } @@ -386,8 +386,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(volatile T *obj, R (T::*method)() volatile) { + template + void attach(volatile U *obj, R (T::*method)() volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -396,8 +396,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const volatile T *obj, R (T::*method)() const volatile) { + template + void attach(const volatile U *obj, R (T::*method)() const volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -797,8 +797,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(T *obj, R (T::*method)(A0)) { + template + Callback(U *obj, R (T::*method)(A0)) { generate(method_context(obj, method)); } @@ -806,8 +806,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const T *obj, R (T::*method)(A0) const) { + template + Callback(const U *obj, R (T::*method)(A0) const) { generate(method_context(obj, method)); } @@ -815,8 +815,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(volatile T *obj, R (T::*method)(A0) volatile) { + template + Callback(volatile U *obj, R (T::*method)(A0) volatile) { generate(method_context(obj, method)); } @@ -824,8 +824,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const volatile T *obj, R (T::*method)(A0) const volatile) { + template + Callback(const volatile U *obj, R (T::*method)(A0) const volatile) { generate(method_context(obj, method)); } @@ -1073,8 +1073,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(T *obj, R (T::*method)(A0)) { + template + void attach(U *obj, R (T::*method)(A0)) { this->~Callback(); new (this) Callback(obj, method); } @@ -1083,8 +1083,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const T *obj, R (T::*method)(A0) const) { + template + void attach(const U *obj, R (T::*method)(A0) const) { this->~Callback(); new (this) Callback(obj, method); } @@ -1093,8 +1093,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(volatile T *obj, R (T::*method)(A0) volatile) { + template + void attach(volatile U *obj, R (T::*method)(A0) volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -1103,8 +1103,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const volatile T *obj, R (T::*method)(A0) const volatile) { + template + void attach(const volatile U *obj, R (T::*method)(A0) const volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -1504,8 +1504,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(T *obj, R (T::*method)(A0, A1)) { + template + Callback(U *obj, R (T::*method)(A0, A1)) { generate(method_context(obj, method)); } @@ -1513,8 +1513,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const T *obj, R (T::*method)(A0, A1) const) { + template + Callback(const U *obj, R (T::*method)(A0, A1) const) { generate(method_context(obj, method)); } @@ -1522,8 +1522,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(volatile T *obj, R (T::*method)(A0, A1) volatile) { + template + Callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { generate(method_context(obj, method)); } @@ -1531,8 +1531,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const volatile T *obj, R (T::*method)(A0, A1) const volatile) { + template + Callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { generate(method_context(obj, method)); } @@ -1780,8 +1780,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(T *obj, R (T::*method)(A0, A1)) { + template + void attach(U *obj, R (T::*method)(A0, A1)) { this->~Callback(); new (this) Callback(obj, method); } @@ -1790,8 +1790,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const T *obj, R (T::*method)(A0, A1) const) { + template + void attach(const U *obj, R (T::*method)(A0, A1) const) { this->~Callback(); new (this) Callback(obj, method); } @@ -1800,8 +1800,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(volatile T *obj, R (T::*method)(A0, A1) volatile) { + template + void attach(volatile U *obj, R (T::*method)(A0, A1) volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -1810,8 +1810,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const volatile T *obj, R (T::*method)(A0, A1) const volatile) { + template + void attach(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -2211,8 +2211,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(T *obj, R (T::*method)(A0, A1, A2)) { + template + Callback(U *obj, R (T::*method)(A0, A1, A2)) { generate(method_context(obj, method)); } @@ -2220,8 +2220,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const T *obj, R (T::*method)(A0, A1, A2) const) { + template + Callback(const U *obj, R (T::*method)(A0, A1, A2) const) { generate(method_context(obj, method)); } @@ -2229,8 +2229,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(volatile T *obj, R (T::*method)(A0, A1, A2) volatile) { + template + Callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { generate(method_context(obj, method)); } @@ -2238,8 +2238,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const volatile T *obj, R (T::*method)(A0, A1, A2) const volatile) { + template + Callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { generate(method_context(obj, method)); } @@ -2487,8 +2487,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(T *obj, R (T::*method)(A0, A1, A2)) { + template + void attach(U *obj, R (T::*method)(A0, A1, A2)) { this->~Callback(); new (this) Callback(obj, method); } @@ -2497,8 +2497,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const T *obj, R (T::*method)(A0, A1, A2) const) { + template + void attach(const U *obj, R (T::*method)(A0, A1, A2) const) { this->~Callback(); new (this) Callback(obj, method); } @@ -2507,8 +2507,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(volatile T *obj, R (T::*method)(A0, A1, A2) volatile) { + template + void attach(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -2517,8 +2517,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const volatile T *obj, R (T::*method)(A0, A1, A2) const volatile) { + template + void attach(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -2918,8 +2918,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(T *obj, R (T::*method)(A0, A1, A2, A3)) { + template + Callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { generate(method_context(obj, method)); } @@ -2927,8 +2927,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const T *obj, R (T::*method)(A0, A1, A2, A3) const) { + template + Callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { generate(method_context(obj, method)); } @@ -2936,8 +2936,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(volatile T *obj, R (T::*method)(A0, A1, A2, A3) volatile) { + template + Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { generate(method_context(obj, method)); } @@ -2945,8 +2945,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const volatile T *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { + template + Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { generate(method_context(obj, method)); } @@ -3194,8 +3194,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(T *obj, R (T::*method)(A0, A1, A2, A3)) { + template + void attach(U *obj, R (T::*method)(A0, A1, A2, A3)) { this->~Callback(); new (this) Callback(obj, method); } @@ -3204,8 +3204,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const T *obj, R (T::*method)(A0, A1, A2, A3) const) { + template + void attach(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { this->~Callback(); new (this) Callback(obj, method); } @@ -3214,8 +3214,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(volatile T *obj, R (T::*method)(A0, A1, A2, A3) volatile) { + template + void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -3224,8 +3224,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const volatile T *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { + template + void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -3625,8 +3625,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(T *obj, R (T::*method)(A0, A1, A2, A3, A4)) { + template + Callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { generate(method_context(obj, method)); } @@ -3634,8 +3634,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const T *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { + template + Callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { generate(method_context(obj, method)); } @@ -3643,8 +3643,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { + template + Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { generate(method_context(obj, method)); } @@ -3652,8 +3652,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - Callback(const volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { + template + Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { generate(method_context(obj, method)); } @@ -3901,8 +3901,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(T *obj, R (T::*method)(A0, A1, A2, A3, A4)) { + template + void attach(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { this->~Callback(); new (this) Callback(obj, method); } @@ -3911,8 +3911,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const T *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { + template + void attach(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { this->~Callback(); new (this) Callback(obj, method); } @@ -3921,8 +3921,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { + template + void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -3931,8 +3931,8 @@ public: * @param obj Pointer to object to invoke member function on * @param method Member function to attach */ - template - void attach(const volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { + template + void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { this->~Callback(); new (this) Callback(obj, method); } @@ -4330,9 +4330,9 @@ Callback callback(const Callback &func) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(T *obj, R (T::*func)()) { - return Callback(obj, func); +template +Callback callback(U *obj, R (T::*method)()) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4341,9 +4341,9 @@ Callback callback(T *obj, R (T::*func)()) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const T *obj, R (T::*func)() const) { - return Callback(obj, func); +template +Callback callback(const U *obj, R (T::*method)() const) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4352,9 +4352,9 @@ Callback callback(const T *obj, R (T::*func)() const) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(volatile T *obj, R (T::*func)() volatile) { - return Callback(obj, func); +template +Callback callback(volatile U *obj, R (T::*method)() volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4363,9 +4363,9 @@ Callback callback(volatile T *obj, R (T::*func)() volatile) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const volatile T *obj, R (T::*func)() const volatile) { - return Callback(obj, func); +template +Callback callback(const volatile U *obj, R (T::*method)() const volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4603,9 +4603,9 @@ Callback callback(const Callback &func) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(T *obj, R (T::*func)(A0)) { - return Callback(obj, func); +template +Callback callback(U *obj, R (T::*method)(A0)) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4614,9 +4614,9 @@ Callback callback(T *obj, R (T::*func)(A0)) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const T *obj, R (T::*func)(A0) const) { - return Callback(obj, func); +template +Callback callback(const U *obj, R (T::*method)(A0) const) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4625,9 +4625,9 @@ Callback callback(const T *obj, R (T::*func)(A0) const) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(volatile T *obj, R (T::*func)(A0) volatile) { - return Callback(obj, func); +template +Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4636,9 +4636,9 @@ Callback callback(volatile T *obj, R (T::*func)(A0) volatile) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const volatile T *obj, R (T::*func)(A0) const volatile) { - return Callback(obj, func); +template +Callback callback(const volatile U *obj, R (T::*method)(A0) const volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4876,9 +4876,9 @@ Callback callback(const Callback &func) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(T *obj, R (T::*func)(A0, A1)) { - return Callback(obj, func); +template +Callback callback(U *obj, R (T::*method)(A0, A1)) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4887,9 +4887,9 @@ Callback callback(T *obj, R (T::*func)(A0, A1)) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const T *obj, R (T::*func)(A0, A1) const) { - return Callback(obj, func); +template +Callback callback(const U *obj, R (T::*method)(A0, A1) const) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4898,9 +4898,9 @@ Callback callback(const T *obj, R (T::*func)(A0, A1) const) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(volatile T *obj, R (T::*func)(A0, A1) volatile) { - return Callback(obj, func); +template +Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -4909,9 +4909,9 @@ Callback callback(volatile T *obj, R (T::*func)(A0, A1) volatile) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const volatile T *obj, R (T::*func)(A0, A1) const volatile) { - return Callback(obj, func); +template +Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5149,9 +5149,9 @@ Callback callback(const Callback &func) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(T *obj, R (T::*func)(A0, A1, A2)) { - return Callback(obj, func); +template +Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5160,9 +5160,9 @@ Callback callback(T *obj, R (T::*func)(A0, A1, A2)) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const T *obj, R (T::*func)(A0, A1, A2) const) { - return Callback(obj, func); +template +Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5171,9 +5171,9 @@ Callback callback(const T *obj, R (T::*func)(A0, A1, A2) const) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(volatile T *obj, R (T::*func)(A0, A1, A2) volatile) { - return Callback(obj, func); +template +Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5182,9 +5182,9 @@ Callback callback(volatile T *obj, R (T::*func)(A0, A1, A2) volat * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const volatile T *obj, R (T::*func)(A0, A1, A2) const volatile) { - return Callback(obj, func); +template +Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5422,9 +5422,9 @@ Callback callback(const Callback &func) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(T *obj, R (T::*func)(A0, A1, A2, A3)) { - return Callback(obj, func); +template +Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5433,9 +5433,9 @@ Callback callback(T *obj, R (T::*func)(A0, A1, A2, A3)) { * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const T *obj, R (T::*func)(A0, A1, A2, A3) const) { - return Callback(obj, func); +template +Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5444,9 +5444,9 @@ Callback callback(const T *obj, R (T::*func)(A0, A1, A2, A3) * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(volatile T *obj, R (T::*func)(A0, A1, A2, A3) volatile) { - return Callback(obj, func); +template +Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5455,9 +5455,9 @@ Callback callback(volatile T *obj, R (T::*func)(A0, A1, A2, A * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const volatile T *obj, R (T::*func)(A0, A1, A2, A3) const volatile) { - return Callback(obj, func); +template +Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5695,9 +5695,9 @@ Callback callback(const Callback & * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(T *obj, R (T::*func)(A0, A1, A2, A3, A4)) { - return Callback(obj, func); +template +Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5706,9 +5706,9 @@ Callback callback(T *obj, R (T::*func)(A0, A1, A2, A3, A4 * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const T *obj, R (T::*func)(A0, A1, A2, A3, A4) const) { - return Callback(obj, func); +template +Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5717,9 +5717,9 @@ Callback callback(const T *obj, R (T::*func)(A0, A1, A2, * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(volatile T *obj, R (T::*func)(A0, A1, A2, A3, A4) volatile) { - return Callback(obj, func); +template +Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments @@ -5728,9 +5728,9 @@ Callback callback(volatile T *obj, R (T::*func)(A0, A1, A * @param method Member function to attach * @return Callback with infered type */ -template -Callback callback(const volatile T *obj, R (T::*func)(A0, A1, A2, A3, A4) const volatile) { - return Callback(obj, func); +template +Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { + return Callback(obj, method); } /** Create a callback class with type infered from the arguments