There is no "official" C++ style guide. This one is my C++ style, that's all.
- Source files:
.cpp - Header files:
.hpp
Snake case with name of the class if any.
- Camel case:
camelCase - Pascal case:
PascalCase - Snake case:
snake_case - Kebab case:
kebab-case
Snake case, with preference to single words.
namespace communication
{
[...]
}Pascal case for the enum name and upper case with underscores for the values.
enum class Dummy
{
VALUE_X,
VALUE_Y
};Pascal case. Filename has to match the class name.
class Logger
{
[...]
};Snake case with a m_ prefix to distinguish it from public data
private:
int m_data;Camel case.
class PrivateSize
{
public:
int width() const;
int getData() const;
};All other names use snake case