Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

https://www.doxygen.nl/index.html

Bracket usage

 

When using brackets, always do

...

Code Block
languagecpp
constexpr int square(int x) { return x*x; }
//NOT
#define SQUARE(r) ((r)*(r))
double square_macro = AREA(4.6);

Assertions

Occasionally use assert statements to double-check any condition. If the statement inside the assert is false, the program will terminate.

Code Block
themeRDark
languagecpp
bool value = 8;
assert(value != NULL);
assert(value == 5); //Program will terminate