How to use #include in large projects?

Should I # include everything I need in every header / cpp file? I am working on a 2d atm game engine (mainly for practice), and, looking at my code, I understand that I repeat the line and the vector in almost every file. This is a problem and how can I deal with it?

I always had the opinion that each class or module that you write should stand on it, as it were, with two legs. I really like universal programming (I include my own script language in my engine with my own draft script engine), but I also understand that this can cause a lot of overhead and confusion.

+5
source share
2 answers

<string> <vector> , .

, , , Google ++ . , foo.hpp include, foo.cpp. , , foo.hpp , - , .

+5

. - , .

+2

All Articles