Ok this is such a basic question and I feel sort of dumb for not remembering. I know how to work with multiple files, include guards and all that. That's not the issue. Actually my question isn't really an issue but more of what is correct.
Let's say I have a header file like this
#ifndef FOO_H_ #define FOO_H_ #include <vector> #include <string> // the rest of the header file, maybe a Foo Class #endif
In Foo.cpp when I include Foo.h should I also go ahead and include vector and string or would that just be a waste?
Then lets say in another file I will be using the Foo Class. So I include Foo.h. Lets say in that file I also need to use vector and string. If I just include Foo.h then vector and string should still work just fine? Though should I also go ahead and include vector and string again, just to make things clear or is this waste just slowing down the compile time?
Is their a "proper" way? Or could this just be where precompiled header files could come in handy to speed up the compile time process? I feel dumb having to ask something this basic and something I work with every day though I'm not sure if I was every taught a "proper" way besides just include guards and all that stuff.