Skip to content

Commit

Permalink
Update cpp.md
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Eichhorn <spl1nes.com@googlemail.com>
  • Loading branch information
spl1nes authored Jul 28, 2024
1 parent b981bc2 commit 25a866c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions standards/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ Be careful when you use unsigned and signed integers. When using unsigned intege

Make sure structs don't have too much overhead due to alignment padding. Re-ordering struct members can fix a lot of padding overhead.

```c++
struct Bad {
bool a;
int b;
bool c;
};
```
```c++
struct Good {
int b;
bool a;
bool c;
};
```

## Templates

Don't use C++ templates.
Expand Down

0 comments on commit 25a866c

Please sign in to comment.