Generally speaking it is important in C++ to ensure that all files are self-sufficient and idempotent with respect to their #includes. They should explicitly include what they need and not rely on other files having done so already.
There is however a case (and possible exception) to be made for when you have pairs of header and source files, such as foo.h and foo.cpp. Usually these headers define a class called 'Foo' and the source file is always going to include the header because it provides the definition while the header provides the declaration.
My question is, if the header #includes something (say <string>), should the source file have to re-include it too?
The two major opinions around the office are:
1) Yes - because ALL files should include everything they need, no exceptions.
2) No - because the two files are really two halves of one thing, if there is an include in the header we needn't repeat that in the source.
I am a bit of a hypocrite on the subject, I quite like opinion #2 but have generally only practiced #1.
What do you think?
Certainly it would be interesting to know if there was a genuinely convincing reason to go one way or the other?