| High Integrity CPP Rule 17.20 | Directly include necessary STL headers. |
| Justification |
Some implementations may include extra STL headers not explicitly specified by the standard. Code that is dependent on these indirect inclusions and does not directly include the appropriate header in the source file will be non portable.
#include <vector>
void foo()
{
// May work with some STL implementations which include
// < string > in < vector >
//
std::string s;
}
|
| Reference |
Effective STL Item 48; |