Skip to content

Commit

Permalink
github: Fix syntax errors in example code
Browse files Browse the repository at this point in the history
  • Loading branch information
jostephd committed Oct 12, 2019
1 parent 10b90ec commit f69fdc3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -48,16 +48,18 @@ Generally, we follow these conventions in our C++ code:

// Use angle brackets for system and external includes.
// Includes should also be sorted alphabetically.
#include <algorithm>
#include <array>
#include <iostream>
#include <vector>

// Classes should have scope specifiers (public, protected, private), but structs can omit them.
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
Expand Down Expand Up @@ -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<int> the_array_of_doom_;
std::array<int, 8> 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;
}
};
```

0 comments on commit f69fdc3

Please sign in to comment.