
1 Sep
2011
1 Sep
'11
5:44 a.m.
On 01/09/2011 2:33, Jeffrey Lee Hellrung, Jr. wrote:
Create a new class that keeps references to all such function objects, and
implements implicit conversions to each of them. Then you can use an instance of this class as an "overloaded function object".
Wouldn't that result in a conversion ambiguity? How would the compiler know which function object to implicitly convert to when invoking operator()?
Of course, that technique only works as long as the function call is not ambiguous. I confess not having read the entire thread; I just assumed that this was implied by "function overloads", same overload resolution rules that work for regular functions do apply in this case. Agustín K-ballo Bergé.- http://talesofcpp.blogspot.com