@sehe My question is why the boost macro causes this behaviour, that is the failure to detect the method's implementation in the .cpp – Matthew Green 10 mins ago
The answer to that is: because macros are a preprocessor feature. Fully implementing the preprocessing is an expensive thing to do both in implementation complexity and in runtime cost. Many tools simplify/take shortcuts when trying to parse C++ code.
Accurate results can only be achieved if the tools do the complete preprocessing, and parsing in the exact same way that a compiler does¹. If you know a bit about the complexity of compilers then it should not come as a surprise that very few tools do this.
The most notable exception to the rule is libclang
which does allow vendors to create "high-fidelity" C++ tools without having to implement all the mechanics.
For this reason, I use YouCompleteMe with CMake's compiler_commands.json
to make sure that libclang
always uses the same flags and defines. It yields the best completions and diagnostics I've seen among IDE's and tools.
That said, I have no problems using the lesser tools (Eclipse's C++ indexing, Microsoft's Visual Studio Intellisense, QtCreator's completion²). It's just something that historically comes with the field of C++, that tools may not always be able to grok every construct.
¹ And it must be using the same include paths, flags and defines
² Other notable mentions are Doxygen and ... SourceInsight (which I never used, but analyzed here: How can I make SourceInsight understand smart pointers?)