Skip to content

Instantly share code, notes, and snippets.

@alepez
Last active December 18, 2015 12:18
Show Gist options
  • Save alepez/5781841 to your computer and use it in GitHub Desktop.
Save alepez/5781841 to your computer and use it in GitHub Desktop.
C++ Style
/********** This begin a section **********/
/** This is short comment */
/**
* This is a long long
* long, but very long comment
*/
/**
* Comment with // to disable code
*/
// disabledCode();
/********** Variables **********/
/** local variables */
int localVariable;
/**
* object variables (members)
* must be inside class definition
*/
int objectVariable_;
/**
* class variables
* must be inside class definition
*/
static int classVariable_c;
/**
* Global variables
* Accessible outside current source file (external linkage)
* Use only in extreme cases!
*/
int globalVariable_g;
/**
* Global variables, only current source file.
* Use unnamed-namespace, instead of static to avoid external linkage.
* Must be inside unnamed-namespace.
* Use only in extreme cases!
*/
namespace {
int pretendClientReady_u;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment