A C++ Graph Library
Style Guidelines:
naming rules:
- Classes: CamelCase
- member variables and member functions: lowercase separated by underscore.
- enums, macros and constant names: CAPITALS separated by underscore
- file names: lowercase separated by underscore.
- complete words in names unless too long.
code:
- use nullptr or {} (empty initializer list) instead of NULL.
- Constructors with initializer lists preferred (new style), people no more write code inside the {} of a constructors, unless its to impose checks.
- Write code inside a namespace. (for now its lib, we can change it)
- use const wherever it makes sense to use it.
regarding header files:
- Don't use an #include when a forward declaration would suffice.
- Important if we are using templatized classes: http://stackoverflow.com/questions/6807369/undefined-reference-to-constructor-generic-class?rq=1
- All header files should have #define guards to prevent multiple inclusion.
code editing guidelines (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml - Formatting section):
- feel free to express yourselves in comments wherever needed.
- indentation length: 2 space characters (or a tab consisting of 2 space characters)
- try to keep lines of 80 characters, move extra code to next line with an extra indent (moving code to next line requires care).
- function/class beginning parenthesis ({) at the end of the function signature instead of the next line
- standard header file includes before self defined header file includes
NOTE: Most of the code is in .h files instead of .cpp because of the problem with C++ templatized classes which does not allow templatized implementation in .cpp. http://stackoverflow.com/questions/6807369/undefined-reference-to-constructor-generic-class?rq=1