I was wondering if there is some pro and contra having include statements directly in the include files as opposed to have them in the source file.
Personally I like to
I think second approach is a better one just because of following reason.
when you have a function template in your header file.
class myclass
{
template
void method(T& a)
{
...
}
}
And you don't want to use it in the source file for myclass.cxx. But you want to use it in xyz.cxx, if you go with your first approach then you will end up in including all files that are required for myclass.cxx, which is of no use for xyz.cxx.
That is all what I think of now the difference. So I would say one should go with second approach as it makes your code each to maintain in future.