VS2015--win32工程配置的一些想法之Google Code Style中头文件的顺序

博客探讨了在大型C++项目中,按照Google Code Style规范来组织头文件的顺序,以提高可读性和避免隐藏依赖。内容强调了在Visual Studio 2015的Win32工程中,应该如何正确地包含C系统文件、C++系统文件、第三方库头文件以及项目内的头文件,并提倡每个头文件独立可编译,以减少依赖性。
摘要由CSDN通过智能技术生成

工程大了,有很多的头文件,也要引用很多的库文件。
从我们学习C++写hello world的那一刻起,就知道要包含一些系统文件。

那么顺序如何呢?
在review的时候,感觉自己写的东西就是一坨屎。

看看Google code style中是如何描述include文件顺序的:

Names and Order of Includes
Use standard order for readability and to avoid hidden dependencies: C library, C++ library, other libraries’ .h, your project’s .h.

All of a project’s header files should be listed as descendants of the project’s source directory without use of UNIX directory shortcuts . (the current directory) or .. (the parent directory). For example, google-awesome-project/src/base/logging.h should be included as

#include "base/logging.h"

In dir/foo.cc or dir/foo_test.cc, whose main purpose is to implement or test the stuff in dir2/foo2.h, order your includes as follows:<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一苇渡江694

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值