diff options
author | 2016-06-17 19:01:03 -0700 | |
---|---|---|
committer | 2016-06-17 19:01:03 -0700 | |
commit | 50c5511a9bcd7f4cf469078cfdeffb7fdf753860 (patch) | |
tree | cbb4c87d4d1626c08bada171f9a18da609784900 /doc | |
parent | 377bfdef920ef36ab53f409f7037f3f683020f9f (diff) | |
parent | b6163dfb4af3bf11df6cf3f051015ec3ee4a0f68 (diff) |
Merge branch 'master' of github.com:grpc/grpc into simplify_compression_interop
Diffstat (limited to 'doc')
-rw-r--r-- | doc/cpp-style-guide.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/cpp-style-guide.md b/doc/cpp-style-guide.md index 9408c4abd6..0138ceb737 100644 --- a/doc/cpp-style-guide.md +++ b/doc/cpp-style-guide.md @@ -53,6 +53,12 @@ default capture). Other C++ functional features such as (../include/grpc++/impl/codegen/config.h). Instead, pointers should be checked for validity using their implicit conversion to `bool`. In other words, use `if (p)` rather than `if (p != nullptr)` +- Do not initialize global/static pointer variables to `nullptr`. Just let + the compiler implicitly initialize them to `nullptr` (which it will + definitely do). The reason is that `nullptr` is an actual object in + our implementation rather than just a constant pointer value, so + static/global constructors will be called in a potentially + undesirable sequence. - Do not use `final` or `override` as these are not supported by some compilers. Instead use `GRPC_FINAL` and `GRPC_OVERRIDE` . These compile down to the traditional C++ forms for compilers that support |