Is there anyway to figure out what STL header file has not been included directly?

前端 未结 2 1769
小鲜肉
小鲜肉 2021-01-20 12:06

Our product uses C++ as the programming language. One annoying issue of using C++ STL is that we forget to include the necessary header files, because the file may have been

相关标签:
2条回答
  • 2021-01-20 12:14

    You can use a common_includes.h file that includes all necessary files there, and include that file everywhere you need. This will simplify the situation and will help out forgetting to include some file. At least you will forget it only one time :).

    0 讨论(0)
  • 2021-01-20 12:35

    The only tool I know of... is the compiler itself.

    Whenever the issue is portability, the best solution I have seen was to simply put on automated build/test suites for all required environments. Then, whenever a pull request is made it will be validated on all your build bots, and you will be warned if you forgot something.

    0 讨论(0)
提交回复
热议问题