devxlogo

Avoid using double underscore in your identifiers

Avoid using double underscore in your identifiers

Identifiers starting with __ (double underscore) are reserved for C/C++ implementations and standard libraries. Furthermore, C++ programs are transformed by the compiler (inline substitution, addition of this as an argument to a non-static member function and creation of temporary objects – to name a few). As a result, new identifiers are inserted into the source file, which weren’t declared by the programmer. In order to avoid name conflicts, the compiler-generated identifiers are usually decorated with a double underscore, so __ should be avoided by users.

devx-admin

Share the Post: