mirror of
https://github.com/zh-google-styleguide/zh-google-styleguide.git
synced 2025-02-19 20:50:10 +08:00
* 已参照<http://google.github.io/styleguide/cppguide.html#Header_Files>内容更新 * 修正`#includes`为`#include` * 注:最新的规范已经将“1.5. 函数参数的顺序”一节移动到“Functions”一章中,本commit删除这一节,删去的代码如下: ```rst 1.5. 函数参数的顺序 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tip:: 定义函数时, 参数顺序依次为: 输入参数, 然后是输出参数. C/C++ 函数参数分为输入参数, 输出参数, 和输入/输出参数三种. 输入参数一般传值或传 ``const`` 引用, 输出参数或输入/输出参数则是非 ``const`` 指针. 对参数排序时, 将只输入的参数放在所有输出参数之前. 尤其是不要仅仅因为是新加的参数, 就把它放在最后; 即使是新加的只输入参数也要放在输出参数之前. 这条规则并不需要严格遵守. 输入/输出两用参数 (通常是类/结构体变量) 把事情变得复杂, 为保持和相关函数的一致性, 你有时不得不有所变通. ``` |
||
---|---|---|
.. | ||
classes.rst | ||
comments.rst | ||
contents.rst | ||
end.rst | ||
exceptions.rst | ||
formatting.rst | ||
headers.rst | ||
index.rst | ||
magic.rst | ||
naming.rst | ||
others.rst | ||
scoping.rst |