C++ style guide: Difference between revisions

Jump to navigation Jump to search
276 bytes added ,  22 September 2017
no edit summary
m (→‎Doxygen Style Guide: Apply the rest of the guide ;-))
No edit summary
(2 intermediate revisions by 2 users not shown)
Line 221: Line 221:
Doxygen allows for a variety of commenting styles. In order to maintain uniformity across the entire project the following rules should be applied:
Doxygen allows for a variety of commenting styles. In order to maintain uniformity across the entire project the following rules should be applied:


* For Doxygen comments use only {{codeline|//!}} and NOT {{codeline|/*! ... */}}
* For Doxygen comments use only {{codeline|//!}} and NOT {{codeline|/*! ... */}}, regardless of the size of the block comment
* Use {{codeline|@}} for any [https://www.stack.nl/~dimitri/doxygen/manual/commands.html Doxygen Special Commands]
* Use {{codeline|@}} for any [https://www.stack.nl/~dimitri/doxygen/manual/commands.html Doxygen Special Commands]
* Use as little formatting as possible.  Restrict to [https://www.stack.nl/~dimitri/doxygen/manual/markdown.html Markdown] and avoid HTML-markup.
* Use as little formatting as possible.  Restrict to [https://www.stack.nl/~dimitri/doxygen/manual/markdown.html Markdown] and avoid HTML-markup.
* Do NOT use the {{codeline|@brief}} command, the first sentence will automatically be used as the summary description.
* The first sentence should describe briefly what the function does and end with a period.
* Leave a blank line between the Doxygen comment and function definition.
* Leave a blank line between the Doxygen comment and function definition.


Line 229: Line 231:


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
//! @brief Some cool function.
//! Does something interesting with its arguments.
//!
//!
//! Long comment with **bold** special commands.
//! Long comment with **bold** special commands.
Line 244: Line 246:
//! @endcode
//! @endcode


void some_function (double some_param, int another_param)
void
some_function (double some_param, int another_param)
{
{
   // ...
   // ...
Anonymous user

Navigation menu