How can I dump candidate functions (or viable functions or best viable functions) for a function invocation?
I know g++ provides an option to dump class hierarchy. (In fact, Visual Studio 2010 provides a similar option, but it's undocumented. I remember reading something about it—maybe in the VC++ team blog—but I can't remember it clearly.)
Recently, I have been reading about overload resolution in the C++0x draft, and it really embarrassed me.
Does any compiler provide an option to dump candidate functions, viable functions, or best viable functions?
Note: The candidate functions in overload resolution scenario is different from the candidate functions in the compiler error. The candidate/viable/best viable function in overload resolution scenario has their own meaning. I know their are three stages in overload resolution: find the candidate functions; find the viable functions; find the best viable functions. Normally, the best viable function is just one candidate; otherwise, the call is ambiguous. Each stage has their own rules.
The easiest way to do this in Visual Studio is to compile an ambiguous call. The compiler will spit an error with a list of available candidates. Probably g++ will do the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With