From 8c4da230fc15e01e0ba3545c8a6ff55bc3da4649 Mon Sep 17 00:00:00 2001 From: Daniel Cheng Date: Thu, 5 Sep 2024 13:32:14 -0700 Subject: [PATCH] Update C++ style guide (#835) - Explicitly ban `long double` - Use absl formatting libraries or `std::ostream` over printf-style functions. - Portability: use serialization libraries instead of copying the in-memory representation. - Update guidance to use `uintptr_t` (previously `intptr_t`) when working with pointers as integers. - Ban C++20 modules. - Ban coroutines (though this is expected to be temporary). - Minor wording updates. --- cppguide.html | 129 +++++++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 58 deletions(-) diff --git a/cppguide.html b/cppguide.html index 7c87799ed..dca5dfe69 100644 --- a/cppguide.html +++ b/cppguide.html @@ -3026,70 +3026,53 @@

On Unsigned Integers

representing bitfields or modular arithmetic). Do not use an unsigned type merely to assert that a variable is non-negative.

-

64-bit Portability

+

Floating-Point Types

-

Code should be 64-bit and 32-bit friendly. Bear in mind -problems of printing, comparisons, and structure alignment.

- -