Dependent names

Inside the definition of a template (both class template and function template), the meaning of some constructs may differ from one instantiation to another. In particular, types and expressions may depend on types of type template parameters and values of non-type template parameters. template<typename T> struct X : B<T> // "B<T>" is dependent on T { typename T::A* pa; // "T::A" is dependent on T // (see below for the meaning of this use of "typenam

delete expression

Destructs object(s) previously allocated by the new expression and releases obtained memory area. Syntax ::(optional) delete    expression (1) ::(optional) delete [] expression (2) 1) Destroys one non-array object created by a new-expression 2) Destroys an array created by a new[]-expression Explanation For the first (non-array) form, expression must be a pointer to a complete object type or a class type contextually implicitly convertible to such pointer, and its value

delete

Usage delete expression allocation functions as the name of operator-like functions deleted functions (since C++11)

Definitions and ODR

Definitions are declarations that fully define the entity introduced by the declaration. Every declaration is a definition, except for the following: Any declaration with an extern storage class specifier or with a language linkage specifier (such as extern "C") without an initializer extern const int a; // declares, but doesn't define a extern const int b = 1; // defines b A function declaration without a function body int f(int); // declares, but doesn't define f A parameter declaratio

DefaultInsertable

Specifies that an instance of the type can be default-constructed in-place by a given allocator. Requirements The type T is DefaultInsertable into the Container X whose value_type is identical to T if, given. A an allocator type m an lvalue of type A p the pointer of type T* prepared by the container where X::allocator_type is identical to std::allocator_traits<A>::rebind_alloc<T>, the following expression is well-formed: std::allocator_traits<A>::construct(m,

DefaultConstructible

Specifies that an instance of the type can be default constructed. Requirements The type T satisfies DefaultConstructible if. Given. u, an arbitrary identifier The following expressions must be valid and have their specified effects. Expression Post-conditions T u The object u is default-initialized T u{} The object u is value-initialized or aggregate-initialized. T() T{} A temporary object of type T is value-initialized or aggregate-initialized. Notes For objects of non

default initialization

This is the initialization performed when a variable is constructed with no initializer. Syntax T object ; (1) new T ; new T ( ) ; (until c++03). (2) Explanation Default initialization is performed in three situations: 1) when a variable with automatic, static, or thread-local storage duration is declared with no initializer. 2) when an object with dynamic storage duration is created by a new-expression with no initializer or when an object is created by a new-expression

Default constructors

A default constructor is a constructor which can be called with no arguments (either defined with an empty parameter list, or with default arguments provided for every parameter). A type with a public default constructor is DefaultConstructible. Syntax ClassName ( ) ; (1) ClassName :: ClassName ( ) body (2) ClassName() = delete ; (3) (since C++11) ClassName() = default ; (4) (since C++11) Explanation 1) Declaration of a default constructor. 2) Definition of the

Default arguments

Allows a function to be called without providing one or more trailing arguments. Indicated by using the following syntax for a parameter in the parameter-list of a function declaration. attr(optional) decl-specifier-seq declarator = initializer (1) attr(optional) decl-specifier-seq abstract-declarator(optional) = initializer (2) Default arguments are used in place of the missing trailing arguments in a function call: void point(int x = 3, int y = 4); point(1,2); // calls point

default

Usage switch statement: as the declaration of the default case label explicitly-defaulted function definition: as an explicit instruction to the compiler to generate special member function for a class. (since C++11)