This is question rather than a problem.
I know it is bad to place header files in class definition files, as this means once the header file is included into the .cpp file it will include all the headers in the .h fille that are not needed.
I follow this rule to as much as I can, however, is it ok to do this:
If I compiled the code without the string header, I would get a compile error winging it string was not a member of std::. So, is this allowed in the sense of "a file should only get what it requries and nothing more"?Code:#ifndef FOO_H #define FOO_H #include <string> // i need this! class { Foo(); ~Foo(); private: std::string m_MyString; }; #endif