by xigoi · 4y ago · 0 comments
I agree, but most C++ programmers don't :/
> And of course the parser doesn't really have a problem with this, so your editor should be able to find it with its 'goto declaration' function.
C++ syntax is Turing-complete, so due to the halting problem, finding the declaration can take a long time, potentially unlimited in pathological cases.
Absolutely not unlimited time. Once it's parsed and semantically analyzed you can find the declaration in no time. Exactly like the compiler does.
edit: to clarify, I was not taking into account unbounded recursion on template instantiation, which should be limited in any case by the compiler.