3 ms·
Or use a good IDE which would have something like "right click -> jump to declaration" and it will show you what/where the function is implemented. Or at least
by unnouinceput 6y ago
Or use a good IDE which would have something like "right click -> jump to declaration" and it will show you what/where the function is implemented. Or at least that's what I do to keep up my productivity instead of wondering at the marvels of overloading / namespaces that export same function names.
- masterofmisc 6y agoHuh... So your saying "right click -> jump to declaration" uses the compiler to resolve all the candidate functions to determine the function that would of been chosen at compile time? ..and then take you to that function? I thought it just took you to the 1st occurrence of the function it found. If so, that's interesting.
- MauranKilom 6y agoReally depends on your IDE. As an example, Visual Studio ships Microsoft's CPP compiler (MSVC [0]), but uses a completely different compiler frontend (namely EDG [1]) for IntelliSense. In a way, it does use a compiler to resolve the candidate functions, but it doesn't go through all the compilation stages. And it's not even the same compiler as when you hit compile :) [0]: https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B [1]: https://www.edg.com/ https://www.edg.com/
- masterofmisc 6y agoAhh that's interesting to know. Thanks for the info.
- nestorD 6y agoThe complexity of the language makes it hard to do even for state-of-the-art IDEs. I have had up to date versions of CLion suggest a dozen potential declarations in some hairy codebases...
- gjulianm 6y agoThe point of the article is not to manually resolve all function calls. Understanding the algorithm allows you to see why a compiler sometimes doesn't choose the function you want and fix it.
- unnouinceput 6y ago*doesn't chose the function you wish for - there, I fixed for you. The compiler doesn't chose on its own whim, it's you who made mistakes and a good IDE allows you to correct it.