From f69fdc3ff954e1358aa78c4da12c4e4b1a5e23ff Mon Sep 17 00:00:00 2001 From: jostephd Date: Sat, 12 Oct 2019 22:47:37 +0000 Subject: [PATCH] github: Fix syntax errors in example code --- .github/CONTRIBUTING.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f947065c4be5..039df63b554b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -48,8 +48,10 @@ Generally, we follow these conventions in our C++ code: // Use angle brackets for system and external includes. // Includes should also be sorted alphabetically. +#include #include #include +#include // Classes should have scope specifiers (public, protected, private), but structs can omit them. struct my_struct @@ -57,7 +59,7 @@ struct my_struct // Public members do not need a trailing underscore. // Inline initialization is acceptable over a constructor. bool member = false; -} +}; // Put braces on new lines after class and struct declarations. class my_class @@ -99,11 +101,11 @@ public: private: // End private class members with an underscore. Additionally, use C++ standard // like std::array as opposed to C equivalents (such as int[]) - std::array the_array_of_doom_; + std::array the_array_of_doom_; const alias_t* vec_ptr_; // Use static or constexpr for constants. Don't use macros. static const int how_far_to_mount_doom_ = 1000; -} +}; ```