Skip to content

Commit cf84b02

Browse files
Merge pull request #118 from kadet1090/fix-build
Use {% raw %} problematic code blocks
2 parents 532e849 + fe09d64 commit cf84b02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bestpractices/c++practices.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ Move the data into a container e.g. `constexpr std::array`, not a vector or map.
531531
Container elements are typically value, array, pair, tuple, or a defined struct.
532532
Pair and tuple should only be used for very short lived data, such as this case:
533533
534+
{% raw %}
534535
```cpp
535536
using Pair = std::pair<std::string_view, size_t>;
536537
@@ -542,9 +543,10 @@ constexpr std::array<Pair, numItems> items {{
542543
{ "George", 40 }
543544
}};
544545
```
546+
{% endraw %}
545547
546548
A struct can also be used, which has the advantage of named elements, but is slightly more overhead.
547-
549+
{% raw %}
548550
```cpp
549551
struct Button {
550552
std::string_view name;
@@ -560,5 +562,5 @@ constexpr std::array<Button, numButtons> buttonDefs {{
560562
{ "On your marks", 15, 15 }
561563
}};
562564
```
563-
565+
{% endraw %}
564566
When in doubt, use a struct - it is better to have good names than not.

0 commit comments

Comments
 (0)