Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Code style guide
Indentation : 2 spaces.
Classes & structs naming :
Files naming :
Public member naming :
Private member naming :
- Use modern C++ features where it makes sense and makes the code cleaner.
- Try to use value semantics and pass-by-reference most of the time.
- Try to limit the use of pointers, when it is necessary use
std::unique_ptrunless a problem specifically calls for
- Try to limit inheritance, and especially the use of virtual functions.
- If a virtual function makes sense, don't forget to :
- Make the destructor virtual.
- Put the destructor implementation in a .cpp file.
variantfor closed polymorphism (when you know all the types from the beginning).
string_viewwhen a function works on strings without storing them, and use
optionalwhen parsing something or when a function may not always yield a result.