From 9a033391c9fcf9a0993d46471af38d9b9417fbbb Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Fri, 28 Aug 2020 16:49:56 +0000 Subject: [PATCH] Documentation for 4ed75018e38c21d2582b8dd101d83395a0301956 --- d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html b/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html index 27ca29fad..1c56c71b9 100644 --- a/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html +++ b/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html @@ -160,7 +160,7 @@ Typical structure of a program:
#include
-
/**
+
/**
* @namespace <check from other files in this repo>
*/
namespace name {
@@ -168,42 +168,44 @@ Typical structure of a program:
/**
* 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
+
// other members also documented as below
}
/**
-
* Function documentation
+
* Function documentation
* @tparam T this is a one-line info about T
* @param param1 on-line info about param1
* @param param2 on-line info about param2
* @returns `true` if ...
-
* @returns `false` if ...
+
* @returns `false` if ...
*/
template<class T>
bool func(int param1, T param2) {
-
// function statements here
-
if(/*something bad*/)
+
// function statements here
+
if (/*something bad*/) {
return false;
+
}
return true;
}
/** Test function */
-
void test() {
-
/* some statements */
-
assert(func(...) == ...); // this ensures that the algorithm works as expected
+
static void test() {
+
/* desciptions of the following test */
+
assert(func(...) == ...); // this ensures that the algorithm works as expected
-
// can have multiple checks
+
// can have multiple checks
}
/** Main function */
int main(int argc, char *argv[]) {
+
test(); // execute the tests
// code here
return 0;
}