Skip to content

Commit f8917e1

Browse files
committed
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.
1 parent 2564a83 commit f8917e1

File tree

1 file changed

+0
-288
lines changed

1 file changed

+0
-288
lines changed

hal/api/Callback.h

Lines changed: 0 additions & 288 deletions
Original file line numberDiff line numberDiff line change
@@ -4436,54 +4436,6 @@ Callback<R()> callback(R (*func)(const volatile T*), const volatile T *arg) {
44364436
return Callback<R()>(func, arg);
44374437
}
44384438

4439-
/** Create a callback class with type infered from the arguments
4440-
* @param func Function object to attach
4441-
* @note The function object is limited to a single word of storage
4442-
*/
4443-
template <typename F, typename R>
4444-
Callback<R()> callback(F f, typename detail::enable_if<
4445-
detail::is_type<R (F::*)(), &F::operator()>::value &&
4446-
sizeof(F) <= sizeof(uintptr_t)
4447-
>::type = detail::nil()) {
4448-
return Callback<R()>(f);
4449-
}
4450-
4451-
/** Create a callback class with type infered from the arguments
4452-
* @param func Function object to attach
4453-
* @note The function object is limited to a single word of storage
4454-
*/
4455-
template <typename F, typename R>
4456-
Callback<R()> callback(const F f, typename detail::enable_if<
4457-
detail::is_type<R (F::*)() const, &F::operator()>::value &&
4458-
sizeof(F) <= sizeof(uintptr_t)
4459-
>::type = detail::nil()) {
4460-
return Callback<R()>(f);
4461-
}
4462-
4463-
/** Create a callback class with type infered from the arguments
4464-
* @param func Function object to attach
4465-
* @note The function object is limited to a single word of storage
4466-
*/
4467-
template <typename F, typename R>
4468-
Callback<R()> callback(volatile F f, typename detail::enable_if<
4469-
detail::is_type<R (F::*)() volatile, &F::operator()>::value &&
4470-
sizeof(F) <= sizeof(uintptr_t)
4471-
>::type = detail::nil()) {
4472-
return Callback<R()>(f);
4473-
}
4474-
4475-
/** Create a callback class with type infered from the arguments
4476-
* @param func Function object to attach
4477-
* @note The function object is limited to a single word of storage
4478-
*/
4479-
template <typename F, typename R>
4480-
Callback<R()> callback(const volatile F f, typename detail::enable_if<
4481-
detail::is_type<R (F::*)() const volatile, &F::operator()>::value &&
4482-
sizeof(F) <= sizeof(uintptr_t)
4483-
>::type = detail::nil()) {
4484-
return Callback<R()>(f);
4485-
}
4486-
44874439
/** Create a callback class with type infered from the arguments
44884440
*
44894441
* @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
47574709
return Callback<R(A0)>(func, arg);
47584710
}
47594711

4760-
/** Create a callback class with type infered from the arguments
4761-
* @param func Function object to attach
4762-
* @note The function object is limited to a single word of storage
4763-
*/
4764-
template <typename F, typename R, typename A0>
4765-
Callback<R(A0)> callback(F f, typename detail::enable_if<
4766-
detail::is_type<R (F::*)(A0), &F::operator()>::value &&
4767-
sizeof(F) <= sizeof(uintptr_t)
4768-
>::type = detail::nil()) {
4769-
return Callback<R(A0)>(f);
4770-
}
4771-
4772-
/** Create a callback class with type infered from the arguments
4773-
* @param func Function object to attach
4774-
* @note The function object is limited to a single word of storage
4775-
*/
4776-
template <typename F, typename R, typename A0>
4777-
Callback<R(A0)> callback(const F f, typename detail::enable_if<
4778-
detail::is_type<R (F::*)(A0) const, &F::operator()>::value &&
4779-
sizeof(F) <= sizeof(uintptr_t)
4780-
>::type = detail::nil()) {
4781-
return Callback<R(A0)>(f);
4782-
}
4783-
4784-
/** Create a callback class with type infered from the arguments
4785-
* @param func Function object to attach
4786-
* @note The function object is limited to a single word of storage
4787-
*/
4788-
template <typename F, typename R, typename A0>
4789-
Callback<R(A0)> callback(volatile F f, typename detail::enable_if<
4790-
detail::is_type<R (F::*)(A0) volatile, &F::operator()>::value &&
4791-
sizeof(F) <= sizeof(uintptr_t)
4792-
>::type = detail::nil()) {
4793-
return Callback<R(A0)>(f);
4794-
}
4795-
4796-
/** Create a callback class with type infered from the arguments
4797-
* @param func Function object to attach
4798-
* @note The function object is limited to a single word of storage
4799-
*/
4800-
template <typename F, typename R, typename A0>
4801-
Callback<R(A0)> callback(const volatile F f, typename detail::enable_if<
4802-
detail::is_type<R (F::*)(A0) const volatile, &F::operator()>::value &&
4803-
sizeof(F) <= sizeof(uintptr_t)
4804-
>::type = detail::nil()) {
4805-
return Callback<R(A0)>(f);
4806-
}
4807-
48084712
/** Create a callback class with type infered from the arguments
48094713
*
48104714
* @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
50784982
return Callback<R(A0, A1)>(func, arg);
50794983
}
50804984

5081-
/** Create a callback class with type infered from the arguments
5082-
* @param func Function object to attach
5083-
* @note The function object is limited to a single word of storage
5084-
*/
5085-
template <typename F, typename R, typename A0, typename A1>
5086-
Callback<R(A0, A1)> callback(F f, typename detail::enable_if<
5087-
detail::is_type<R (F::*)(A0, A1), &F::operator()>::value &&
5088-
sizeof(F) <= sizeof(uintptr_t)
5089-
>::type = detail::nil()) {
5090-
return Callback<R(A0, A1)>(f);
5091-
}
5092-
5093-
/** Create a callback class with type infered from the arguments
5094-
* @param func Function object to attach
5095-
* @note The function object is limited to a single word of storage
5096-
*/
5097-
template <typename F, typename R, typename A0, typename A1>
5098-
Callback<R(A0, A1)> callback(const F f, typename detail::enable_if<
5099-
detail::is_type<R (F::*)(A0, A1) const, &F::operator()>::value &&
5100-
sizeof(F) <= sizeof(uintptr_t)
5101-
>::type = detail::nil()) {
5102-
return Callback<R(A0, A1)>(f);
5103-
}
5104-
5105-
/** Create a callback class with type infered from the arguments
5106-
* @param func Function object to attach
5107-
* @note The function object is limited to a single word of storage
5108-
*/
5109-
template <typename F, typename R, typename A0, typename A1>
5110-
Callback<R(A0, A1)> callback(volatile F f, typename detail::enable_if<
5111-
detail::is_type<R (F::*)(A0, A1) volatile, &F::operator()>::value &&
5112-
sizeof(F) <= sizeof(uintptr_t)
5113-
>::type = detail::nil()) {
5114-
return Callback<R(A0, A1)>(f);
5115-
}
5116-
5117-
/** Create a callback class with type infered from the arguments
5118-
* @param func Function object to attach
5119-
* @note The function object is limited to a single word of storage
5120-
*/
5121-
template <typename F, typename R, typename A0, typename A1>
5122-
Callback<R(A0, A1)> callback(const volatile F f, typename detail::enable_if<
5123-
detail::is_type<R (F::*)(A0, A1) const volatile, &F::operator()>::value &&
5124-
sizeof(F) <= sizeof(uintptr_t)
5125-
>::type = detail::nil()) {
5126-
return Callback<R(A0, A1)>(f);
5127-
}
5128-
51294985
/** Create a callback class with type infered from the arguments
51304986
*
51314987
* @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
53995255
return Callback<R(A0, A1, A2)>(func, arg);
54005256
}
54015257

5402-
/** Create a callback class with type infered from the arguments
5403-
* @param func Function object to attach
5404-
* @note The function object is limited to a single word of storage
5405-
*/
5406-
template <typename F, typename R, typename A0, typename A1, typename A2>
5407-
Callback<R(A0, A1, A2)> callback(F f, typename detail::enable_if<
5408-
detail::is_type<R (F::*)(A0, A1, A2), &F::operator()>::value &&
5409-
sizeof(F) <= sizeof(uintptr_t)
5410-
>::type = detail::nil()) {
5411-
return Callback<R(A0, A1, A2)>(f);
5412-
}
5413-
5414-
/** Create a callback class with type infered from the arguments
5415-
* @param func Function object to attach
5416-
* @note The function object is limited to a single word of storage
5417-
*/
5418-
template <typename F, typename R, typename A0, typename A1, typename A2>
5419-
Callback<R(A0, A1, A2)> callback(const F f, typename detail::enable_if<
5420-
detail::is_type<R (F::*)(A0, A1, A2) const, &F::operator()>::value &&
5421-
sizeof(F) <= sizeof(uintptr_t)
5422-
>::type = detail::nil()) {
5423-
return Callback<R(A0, A1, A2)>(f);
5424-
}
5425-
5426-
/** Create a callback class with type infered from the arguments
5427-
* @param func Function object to attach
5428-
* @note The function object is limited to a single word of storage
5429-
*/
5430-
template <typename F, typename R, typename A0, typename A1, typename A2>
5431-
Callback<R(A0, A1, A2)> callback(volatile F f, typename detail::enable_if<
5432-
detail::is_type<R (F::*)(A0, A1, A2) volatile, &F::operator()>::value &&
5433-
sizeof(F) <= sizeof(uintptr_t)
5434-
>::type = detail::nil()) {
5435-
return Callback<R(A0, A1, A2)>(f);
5436-
}
5437-
5438-
/** Create a callback class with type infered from the arguments
5439-
* @param func Function object to attach
5440-
* @note The function object is limited to a single word of storage
5441-
*/
5442-
template <typename F, typename R, typename A0, typename A1, typename A2>
5443-
Callback<R(A0, A1, A2)> callback(const volatile F f, typename detail::enable_if<
5444-
detail::is_type<R (F::*)(A0, A1, A2) const volatile, &F::operator()>::value &&
5445-
sizeof(F) <= sizeof(uintptr_t)
5446-
>::type = detail::nil()) {
5447-
return Callback<R(A0, A1, A2)>(f);
5448-
}
5449-
54505258
/** Create a callback class with type infered from the arguments
54515259
*
54525260
* @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
57205528
return Callback<R(A0, A1, A2, A3)>(func, arg);
57215529
}
57225530

5723-
/** Create a callback class with type infered from the arguments
5724-
* @param func Function object to attach
5725-
* @note The function object is limited to a single word of storage
5726-
*/
5727-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
5728-
Callback<R(A0, A1, A2, A3)> callback(F f, typename detail::enable_if<
5729-
detail::is_type<R (F::*)(A0, A1, A2, A3), &F::operator()>::value &&
5730-
sizeof(F) <= sizeof(uintptr_t)
5731-
>::type = detail::nil()) {
5732-
return Callback<R(A0, A1, A2, A3)>(f);
5733-
}
5734-
5735-
/** Create a callback class with type infered from the arguments
5736-
* @param func Function object to attach
5737-
* @note The function object is limited to a single word of storage
5738-
*/
5739-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
5740-
Callback<R(A0, A1, A2, A3)> callback(const F f, typename detail::enable_if<
5741-
detail::is_type<R (F::*)(A0, A1, A2, A3) const, &F::operator()>::value &&
5742-
sizeof(F) <= sizeof(uintptr_t)
5743-
>::type = detail::nil()) {
5744-
return Callback<R(A0, A1, A2, A3)>(f);
5745-
}
5746-
5747-
/** Create a callback class with type infered from the arguments
5748-
* @param func Function object to attach
5749-
* @note The function object is limited to a single word of storage
5750-
*/
5751-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
5752-
Callback<R(A0, A1, A2, A3)> callback(volatile F f, typename detail::enable_if<
5753-
detail::is_type<R (F::*)(A0, A1, A2, A3) volatile, &F::operator()>::value &&
5754-
sizeof(F) <= sizeof(uintptr_t)
5755-
>::type = detail::nil()) {
5756-
return Callback<R(A0, A1, A2, A3)>(f);
5757-
}
5758-
5759-
/** Create a callback class with type infered from the arguments
5760-
* @param func Function object to attach
5761-
* @note The function object is limited to a single word of storage
5762-
*/
5763-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3>
5764-
Callback<R(A0, A1, A2, A3)> callback(const volatile F f, typename detail::enable_if<
5765-
detail::is_type<R (F::*)(A0, A1, A2, A3) const volatile, &F::operator()>::value &&
5766-
sizeof(F) <= sizeof(uintptr_t)
5767-
>::type = detail::nil()) {
5768-
return Callback<R(A0, A1, A2, A3)>(f);
5769-
}
5770-
57715531
/** Create a callback class with type infered from the arguments
57725532
*
57735533
* @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
60415801
return Callback<R(A0, A1, A2, A3, A4)>(func, arg);
60425802
}
60435803

6044-
/** Create a callback class with type infered from the arguments
6045-
* @param func Function object to attach
6046-
* @note The function object is limited to a single word of storage
6047-
*/
6048-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
6049-
Callback<R(A0, A1, A2, A3, A4)> callback(F f, typename detail::enable_if<
6050-
detail::is_type<R (F::*)(A0, A1, A2, A3, A4), &F::operator()>::value &&
6051-
sizeof(F) <= sizeof(uintptr_t)
6052-
>::type = detail::nil()) {
6053-
return Callback<R(A0, A1, A2, A3, A4)>(f);
6054-
}
6055-
6056-
/** Create a callback class with type infered from the arguments
6057-
* @param func Function object to attach
6058-
* @note The function object is limited to a single word of storage
6059-
*/
6060-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
6061-
Callback<R(A0, A1, A2, A3, A4)> callback(const F f, typename detail::enable_if<
6062-
detail::is_type<R (F::*)(A0, A1, A2, A3, A4) const, &F::operator()>::value &&
6063-
sizeof(F) <= sizeof(uintptr_t)
6064-
>::type = detail::nil()) {
6065-
return Callback<R(A0, A1, A2, A3, A4)>(f);
6066-
}
6067-
6068-
/** Create a callback class with type infered from the arguments
6069-
* @param func Function object to attach
6070-
* @note The function object is limited to a single word of storage
6071-
*/
6072-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
6073-
Callback<R(A0, A1, A2, A3, A4)> callback(volatile F f, typename detail::enable_if<
6074-
detail::is_type<R (F::*)(A0, A1, A2, A3, A4) volatile, &F::operator()>::value &&
6075-
sizeof(F) <= sizeof(uintptr_t)
6076-
>::type = detail::nil()) {
6077-
return Callback<R(A0, A1, A2, A3, A4)>(f);
6078-
}
6079-
6080-
/** Create a callback class with type infered from the arguments
6081-
* @param func Function object to attach
6082-
* @note The function object is limited to a single word of storage
6083-
*/
6084-
template <typename F, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
6085-
Callback<R(A0, A1, A2, A3, A4)> callback(const volatile F f, typename detail::enable_if<
6086-
detail::is_type<R (F::*)(A0, A1, A2, A3, A4) const volatile, &F::operator()>::value &&
6087-
sizeof(F) <= sizeof(uintptr_t)
6088-
>::type = detail::nil()) {
6089-
return Callback<R(A0, A1, A2, A3, A4)>(f);
6090-
}
6091-
60925804
/** Create a callback class with type infered from the arguments
60935805
*
60945806
* @param obj Optional pointer to object to bind to function

0 commit comments

Comments
 (0)