我认为C++中没有"广泛接受的"命名约定.Stroustrup的书籍和论文通常具有以下编码风格:
class Shape {
public: // interface to users of Shapes
virtual void draw() const;
virtual void rotate(int degrees);
// ...
protected: // common data (for implementers of Shapes)
Point center;
Color col;
// ...
};
Run Code Online (Sandbox Code Playgroud)
您还可以查看流行的样式指南,例如Google C++样式指南.