代码拉取完成,页面将自动刷新
Copied and modified from Google Filament code style. Remember: break the rules if it makes sense, e.g. it improves readability substantially.
{
at the beginning of new line;
in loop conditionsfor (int i = 0; i < max; ++i)
{
}
class Foo
{
public:
protected:
private:
};
.h
extension.cpp
extension.inline
extension#include < >
for all public (exported) headers#include " "
for private headerstests
folderfoo
library must live in a folder named foo
include/foo/FooBar.h
src/FooBar.cpp
src/data.inc
#include <foo/FooBar.h>
#include "FooBarPrivate.h"
constants
are upper-cased and don't have a prefixglobal
variables prefix with g_
static
variables and class attributes prefix with s_
private
and protected
class attributes prefixed with _
public
class attributes prefix with _
or not prefixedextern int g_globalWarming;
const int FOO_COUNT = 10;
class FooBar
{
public:
void methodName(int arg1, bool arg2);
int sizeInBytes;
private:
int _attributeName;
static int s_globalAttribute;
enum { ONE, TWO, THREE };
};
std::
qualifier to disambiguate it from others.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。