How can a :: operator be used as unary operator?
The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn?t have a name, the notation :: member-name refers to a member of the global namespace. This can be useful for referring to members of global namespace whose names have been hidden by names declared in nested local scope. Unless we specify to the compiler in which namespace to search for a declaration, the compiler simple searches the current scope, and any scopes in which the current scope is nested, to find the declaration for the name. What is placement new? When you want to call a constructor directly, you use the placement new. Sometimes you have some raw memory that’s already been allocated, and you need to construct an object in the memory you have. Operator new’s special version placement new allows you to do it. class Widget { public : Widget(int widgetsize); … Widget* Construct_widget_int_buffer(void *buffer,int widgetsize) { return new(buffer) Widget(widgetsize); }