EventQueue::event is now defined for the following overloads:
event(R (*)(A...), C...);
event(F, C...);
event(const F, C...);
event(volatile F, C...);
event(const volatile F, C...);
event(T *, R (T::*)(A...), C...);
event(const T *, R (T::*)(A...) const, C...);
event(volatile T *, R (T::*)(A...) volatile, C...);
event(const volatile T *, R (T::*)(A...) const volatile, C...);
This insures cleaner error messages when invalid types are used.
It should be noted that different types are used for the infered function parameters and the arguments supplied to event, this is important for inducing implicit casts.
Otherwise, deceptively confusing bugs can occur:
void doit(unsigned value);
queue.event(doit, 1); // Error - 1 is signed without implicit casts
With the stricter type inference on the convenience event function, it is trivial to determine the quantity of parameters present in a function type.
With the arity of the function type, we can determine which Event class must be generated entirely based on type inference. This is a huge benefit to the value of the convenience event functions and removes any lingering limitations on the event function usage.
EventQueue::event is now defined for the following overloads:
This insures cleaner error messages when invalid types are used.
It should be noted that different types are used for the infered function parameters and the arguments supplied to event, this is important for inducing implicit casts.
Otherwise, deceptively confusing bugs can occur:
With the stricter type inference on the convenience event function, it is trivial to determine the quantity of parameters present in a function type.
With the arity of the function type, we can determine which Event class must be generated entirely based on type inference. This is a huge benefit to the value of the convenience event functions and removes any lingering limitations on the event function usage.