I've seen a lot of times in c++ libraries tones of objects whose names start with underscores. I know some cases when this is useful for example:
class Person {
private:
unsigned int age;
//...
public:
Person(unsigned int _age): age(_age) {}
};
here it's useful to distinguish logically same objects _age
, age
.
But there are also cases when global functions names (not from a class) also have single or multiple underscores. So I would like to understand this in general and more ideologically.
So:
What are the benefits for this kind of naming ?
When it's need to use single and when multiple underscores at the start ?