From f8917e1cd9f86227c67df0fef7a433c31452376e Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 29 Sep 2016 16:30:49 -0500 Subject: [PATCH] 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. --- hal/api/Callback.h | 288 --------------------------------------------- 1 file changed, 288 deletions(-) diff --git a/hal/api/Callback.h b/hal/api/Callback.h index a587b24b32..a6d63790e7 100644 --- a/hal/api/Callback.h +++ b/hal/api/Callback.h @@ -4436,54 +4436,6 @@ Callback callback(R (*func)(const volatile T*), const volatile T *arg) { return Callback(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 -Callback callback(F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 callback(R (*func)(const volatile T*, A0), const volatile T *arg return Callback(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 -Callback callback(F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 callback(R (*func)(const volatile T*, A0, A1), const volatil return Callback(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 -Callback callback(F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 callback(R (*func)(const volatile T*, A0, A1, A2), const return Callback(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 -Callback callback(F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 callback(R (*func)(const volatile T*, A0, A1, A2, A3 return Callback(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 -Callback callback(F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 callback(R (*func)(const volatile T*, A0, A1, A2 return Callback(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 -Callback callback(F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(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 -Callback callback(const volatile F f, typename detail::enable_if< - detail::is_type::value && - sizeof(F) <= sizeof(uintptr_t) - >::type = detail::nil()) { - return Callback(f); -} - /** Create a callback class with type infered from the arguments * * @param obj Optional pointer to object to bind to function