But you might find this functionality seems to fail with C++ STL headers : when the cursor is blinking under "#include <iostream>", say, and your hitting 'gf' will not respond by entering that header but engender a grouch like following instead:
"E447: Can't find file iostream in path".
In actuality it is quite easy to resolve this problem by riffling through vim manual.
Treatment:
open the rc file of vim, for instance, /etc/vimrc, add following setting :
set path = **,/usr/include/c++/**
provided your c++ STL headers are hoarded in /usr/include/c++.
reopen the source code you were previously browsing around and try "gf" again, it should work now! It is really that piece of cake! Really extensible is vim!