45
edits
(Added Development category) |
(Added syntax highlighting) |
||
Line 49: | Line 49: | ||
=== UsefulClass.h === | === UsefulClass.h === | ||
< | <syntaxhighlight lang="cpp">#pragma once | ||
class UsefulClass : public SomeParent, public AnotherParent | class UsefulClass : public SomeParent, public AnotherParent | ||
Line 86: | Line 86: | ||
return m_x; | return m_x; | ||
} | } | ||
// Every file should end in a newline</ | // Every file should end in a newline</syntaxhighlight> | ||
Line 93: | Line 93: | ||
Follow the indentation/whitespace style shown below. | Follow the indentation/whitespace style shown below. | ||
< | <syntaxhighlight lang="cpp">namespace Example | ||
{ | { | ||
// Namespace contents are not indented | // Namespace contents are not indented | ||
Line 180: | Line 180: | ||
} | } | ||
}</ | }</syntaxhighlight> | ||
Line 187: | Line 187: | ||
Do not do any of this. | Do not do any of this. | ||
< | <syntaxhighlight lang="cpp">// Try to avoid macros, use a constant variable instead | ||
#define FOO_BAR 5 | #define FOO_BAR 5 | ||
Line 241: | Line 241: | ||
/* Don't use multiline comments */ | /* Don't use multiline comments */ | ||
}</ | }</syntaxhighlight> | ||
[[Category:Development]] | [[Category:Development]] |