From a713e2bb894c713091f5c20bfb612033f6f92319 Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Thu, 15 Feb 2024 11:20:30 -1000 Subject: [PATCH] Remove the other `{{` that confuse Pages rendering --- CppCoreGuidelines.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 6e2364b..e2e4220 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -7,7 +7,7 @@ Editors: * [Bjarne Stroustrup](http://www.stroustrup.com) * [Herb Sutter](http://herbsutter.com/) -This is a living document under continuous improvement. +This is a living document under continuous improvement. Had it been an open-source (code) project, this would have been release 0.8. Copying, use, modification, and creation of derivative works from this project is licensed under an MIT-style license. Contributing to this project requires agreeing to a Contributor License. See the accompanying [LICENSE](LICENSE) file for details. @@ -8359,7 +8359,7 @@ Subscripting the resulting base pointer will lead to invalid object access and p void use(B*); - D a[] = {{1, 2}, {3, 4}, {5, 6}}; + D a[] = { {1, 2}, {3, 4}, {5, 6} }; B* p = a; // bad: a decays to &a[0] which is converted to a B* p[1].x = 7; // overwrite a[0].y @@ -12543,7 +12543,7 @@ In the rare cases where the slicing was deliberate the code can be surprising. class Shape { /* ... */ }; class Circle : public Shape { /* ... */ Point c; int r; }; - Circle c {{0, 0}, 42}; + Circle c { {0, 0}, 42 }; Shape s {c}; // copy construct only the Shape part of Circle s = c; // or copy assign only the Shape part of Circle @@ -12551,7 +12551,7 @@ In the rare cases where the slicing was deliberate the code can be surprising. { dest = src; } - Circle c2 {{1, 1}, 43}; + Circle c2 { {1, 1}, 43 }; assign(c, c2); // oops, not the whole state is transferred assert(c == c2); // if we supply copying, we should also provide comparison, // but this will likely return false @@ -15891,7 +15891,7 @@ To make error handling systematic, robust, and non-repetitive. void use() { - Foo bar {{Thing{1}, Thing{2}, Thing{monkey}}, {"my_file", "r"}, "Here we go!"}; + Foo bar { {Thing{1}, Thing{2}, Thing{monkey} }, {"my_file", "r"}, "Here we go!"}; // ... }