mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix: Clean up of code examples in CONTRIBUTING to follow guidelines. (#1063)
This commit is contained in:
parent
f4fe0c6f5b
commit
4ed75018e3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user