fix: Clean up of code examples in CONTRIBUTING to follow guidelines. (#1063)

This commit is contained in:
Filip Hlasek 2020-08-28 09:47:02 -07:00 committed by GitHub
parent f4fe0c6f5b
commit 4ed75018e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,10 +67,10 @@ namespace name {
/**
* Class documentation
*/
class cls_name{
class class_name {
private:
int var1; ///< short info of this variable
char *msg; ///< short info
int variable; ///< short info of this variable
char *message; ///< short info
public:
// other members also documented as below
@ -87,15 +87,16 @@ class cls_name{
template<class T>
bool func(int param1, T param2) {
// function statements here
if(/*something bad*/)
if (/*something bad*/) {
return false;
}
return true;
}
/** Test function */
void test() {
/* some statements */
static void test() {
/* desciptions of the following test */
assert(func(...) == ...); // this ensures that the algorithm works as expected
// can have multiple checks
@ -103,6 +104,7 @@ void test() {
/** Main function */
int main(int argc, char *argv[]) {
test(); // execute the tests
// code here
return 0;
}