mirror of https://github.com/ARMmbed/mbed-os.git
callback - Removed problematic callback overloads
Unfortunately, it is very difficult to infer the parameters of function-objects generically in C++03 without any additional type information. The current implementation fails to do so, and the compiler simply bails with "unable to deduce template parameter". Rather than leaving the user with a small novel of error messages, this patch removes the problematic callback overloads, leaving only callback overloads for the original pointer types.pull/2869/head
parent
2564a833c0
commit
f8917e1cd9
|
|
@ -4436,54 +4436,6 @@ Callback<R()> callback(R (*func)(const volatile T*), const volatile T *arg) {
|
|||
return Callback<R()>(func, arg);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R>
|
||||
Callback<R()> callback(F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(), &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R()>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R>
|
||||
Callback<R()> callback(const F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)() const, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R()>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R>
|
||||
Callback<R()> callback(volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)() volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R()>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R>
|
||||
Callback<R()> callback(const volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)() const volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R()>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
*
|
||||
* @param obj Optional pointer to object to bind to function
|
||||
|
|
@ -4757,54 +4709,6 @@ Callback<R(A0)> callback(R (*func)(const volatile T*, A0), const volatile T *arg
|
|||
return Callback<R(A0)>(func, arg);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0>
|
||||
Callback<R(A0)> callback(F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0), &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0>
|
||||
Callback<R(A0)> callback(const F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0) const, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0>
|
||||
Callback<R(A0)> callback(volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0) volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0>
|
||||
Callback<R(A0)> callback(const volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0) const volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
*
|
||||
* @param obj Optional pointer to object to bind to function
|
||||
|
|
@ -5078,54 +4982,6 @@ Callback<R(A0, A1)> callback(R (*func)(const volatile T*, A0, A1), const volatil
|
|||
return Callback<R(A0, A1)>(func, arg);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1>
|
||||
Callback<R(A0, A1)> callback(F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1), &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1>
|
||||
Callback<R(A0, A1)> callback(const F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1) const, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1>
|
||||
Callback<R(A0, A1)> callback(volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1) volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1>
|
||||
Callback<R(A0, A1)> callback(const volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1) const volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
*
|
||||
* @param obj Optional pointer to object to bind to function
|
||||
|
|
@ -5399,54 +5255,6 @@ Callback<R(A0, A1, A2)> callback(R (*func)(const volatile T*, A0, A1, A2), const
|
|||
return Callback<R(A0, A1, A2)>(func, arg);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2>
|
||||
Callback<R(A0, A1, A2)> callback(F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2), &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2>
|
||||
Callback<R(A0, A1, A2)> callback(const F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2) const, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2>
|
||||
Callback<R(A0, A1, A2)> callback(volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2) volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2>
|
||||
Callback<R(A0, A1, A2)> callback(const volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2) const volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
*
|
||||
* @param obj Optional pointer to object to bind to function
|
||||
|
|
@ -5720,54 +5528,6 @@ Callback<R(A0, A1, A2, A3)> callback(R (*func)(const volatile T*, A0, A1, A2, A3
|
|||
return Callback<R(A0, A1, A2, A3)>(func, arg);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
|
||||
Callback<R(A0, A1, A2, A3)> callback(F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3), &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
|
||||
Callback<R(A0, A1, A2, A3)> callback(const F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3) const, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
|
||||
Callback<R(A0, A1, A2, A3)> callback(volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3) volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
|
||||
Callback<R(A0, A1, A2, A3)> callback(const volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3) const volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
*
|
||||
* @param obj Optional pointer to object to bind to function
|
||||
|
|
@ -6041,54 +5801,6 @@ Callback<R(A0, A1, A2, A3, A4)> callback(R (*func)(const volatile T*, A0, A1, A2
|
|||
return Callback<R(A0, A1, A2, A3, A4)>(func, arg);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
Callback<R(A0, A1, A2, A3, A4)> callback(F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3, A4), &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3, A4)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
Callback<R(A0, A1, A2, A3, A4)> callback(const F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3, A4) const, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3, A4)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
Callback<R(A0, A1, A2, A3, A4)> callback(volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3, A4) volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3, A4)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
* @param func Function object to attach
|
||||
* @note The function object is limited to a single word of storage
|
||||
*/
|
||||
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
Callback<R(A0, A1, A2, A3, A4)> callback(const volatile F f, typename detail::enable_if<
|
||||
detail::is_type<R (F::*)(A0, A1, A2, A3, A4) const volatile, &F::operator()>::value &&
|
||||
sizeof(F) <= sizeof(uintptr_t)
|
||||
>::type = detail::nil()) {
|
||||
return Callback<R(A0, A1, A2, A3, A4)>(f);
|
||||
}
|
||||
|
||||
/** Create a callback class with type infered from the arguments
|
||||
*
|
||||
* @param obj Optional pointer to object to bind to function
|
||||
|
|
|
|||
Loading…
Reference in New Issue