virtual

Usage virtual function specifier virtual base class specifier

void

Usage void specifier used to declare void* type

va_copy

Defined in header <cstdarg> void va_copy( va_list dest, va_list src ); (since C++11) The va_copy macro copies src to dest. va_end should be called on dest before the function returns or any subsequent re-initialization of dest (via calls to va_start or va_copy). Parameters dest - an instance of the va_list type to initialize src - the source va_list that will be used to initialize dest Expanded value (none). Example #include <iostream> #includ

Variadic functions

Variadic functions are functions (e.g. std::printf) which take a variable number of arguments. To declare a variadic function, an ellipsis is used as the last parameter, e.g. int printf(const char* format, ...);. See Variadic arguments for additional detail on the syntax, automatic argument conversions and the alternatives. To access the variadic arguments from the function body, the following library facilities are provided: Defined in header <cstdarg> va_start enables access to v

va_arg

Defined in header <cstdarg> T va_arg( va_list ap, T ); The va_arg macro expands to an expression of type T that corresponds to the next parameter from the va_list ap. Prior to calling va_arg, ap must be initialized by a call to either va_start or va_copy, with no intervening call to va_end. Each invocation of the va_arg macro modifies ap to point to the next variable argument. If va_arg is called when there are no more arguments in ap, or if the type of the next argument in

va_end

Defined in header <cstdarg> void va_end( va_list ap ); The va_end macro performs cleanup for an ap object initialized by a call to va_start or va_copy. va_end may modify ap so that it is no longer usable. If there is no corresponding call to va_start or va_copy, or if va_end is not called before a function that calls va_start or va_copy returns, the behavior is undefined. Parameters ap - an instance of the va_list type to clean up Expanded value (none). See

Variadic arguments

Allows a function to accept any number of arguments. Indicated by the parameter of the form ... which must appear last in the parameter-list of a function declaration. Where syntactically correct, , ... may be replaced by .... // the function declared as follows int printx(const char* fmt, ...); // may be called with one or more arguments: printx("hello world"); printx("a=%d b=%d", a, b); int printx(const char* fmt...); // same as above (comma is optional) int printy(..., const char* fmt); //

value initialization

This is the initialization performed when a variable is constructed with an empty initializer. Syntax T(); (1) new T (); (2) Class::Class(...) : member() {... (3) T object {}; (4) (since C++11) T{}; (5) (since C++11) new T {}; (6) (since C++11) Class::Class(...) :member{} {... (7) (since C++11) Explanation Value initialization is performed in these situations: 1,5) when a nameless temporary object is created with the initializer consisting of

ValueSwappable

Two objects of this type can be dereferenced and the resulting values can be swapped using unqualified function call swap() in the context where both std::swap and the user-defined swap()s are visible. Requirements Type T is ValueSwappable if. 1) Type T satisfies the Iterator requirements 2) For any dereferencable object x of type T (that is, any value other than the end iterator), *x satisfies the Swappable requirements. Many standard library functions expect their arguments to satisfy Va

Variable template

A variable template defines a family of variables or static data members. Syntax template < parameter-list > variable-declaration Explanation variable-declaration - a declaration of a variable. The declared variable name becomes a template name. parameter-list - a non-empty comma-separated list of the template parameters, each of which is either non-type parameter, a type parameter, a template parameter, or a parameter pack of any of those. A variable template