devxlogo

July 18, 1998

A static class member

A class member declared static is a single instance of that member shared by all instances of this class (that’s why it is sometimes termed a class variable, as opposed

Placement new

Operator new allocates memory from the heap, on which an object is constructed. Standard C++ also supports placement new operator, which constructs an object on a pre-allocated buffer. This is

Namespace aliases

Choosing a short name for a namespace can eventually lead to a name clash. On the other hand, very long namespaces are not easy to use. For that purpose, namespace

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