Declaring functions

A function declaration introduces the function name and its type. A function definition associates the function name/type with the function body. Function declaration Function declarations may appear in any scope. A function declaration at class scope introduces a class member function (unless the friend specifier is used), see member functions and friend functions for details. The type of the function being declared is composed from the return type (provided by the decl-specifier-seq of the

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)

decltype specifier

Inspects the declared type of an entity or queries the type and value category of an expression. Syntax decltype ( entity ) (1) (since C++11) decltype ( expression ) (2) (since C++11) Explanation 1) If the argument is an unparenthesized id-expression or an unparenthesized class member access, then decltype yields the type of the entity named by this expression. If there is no such entity, or if the argument names a set of overloaded functions, the program is ill-formed. 2)

Declarations

Declarations introduce (or re-introduce) names into the C++ program. Each kind of entity is declared differently. Definitions are declarations that are sufficient to use the entity identified by the name. A declaration is one of the following: Function declaration Template declaration Explicit template instantiation Explicit template specialization Namespace definition Linkage specification Attribute declaration (attr ;) (since C++11) Empty declaration (;) Block declaration (a

Date and time utilities

C++ includes support for two types of time manipulation: The chrono library, a flexible collection of types that track time with varying degrees of precision (e.g. std::chrono::time_point). C-style date and time library (e.g. std::time) chrono library The chrono library defines three main types (durations, clocks, and time points) as well as utility functions and common typedefs. Duration A duration consists of a span of time, defined as some number of ticks of some time unit. For e

cwctype

This header was originally in the C standard library as <wctype.h>. This header is part of the C-style null-terminated wide strings library. Types wctrans_t scalar type that holds locale-specific character mapping wctype_t scalar type that holds locale-specific character classification wint_t integer type that can hold any valid wide character and at least one more value Macros WEOF a non-character value of type wint_t used to indicate errors (macro constant) F

cwchar

This header was originally in the C standard library as <wchar.h>. This header is part of the null-terminated wide and multibyte strings libraries. It also provides some C-style I/O functions and conversion from C-style Date. Macros NULL implementation-defined null pointer constant (macro constant) WEOF a non-character value of type wint_t used to indicate errors (macro constant) WCHAR_MIN the smallest valid value of wchar_t (macro constant) WCHAR_MAX the largest valid

cv type qualifiers

Appear in any type specifier, including decl-specifier-seq of declaration grammar, to specify constness or volatility of the object being declared or of the type being named. const - defines that the type is constant. volatile - defines that the type is volatile. mutable - applies to non-static class members of non-reference non-const type and specifies that the member does not affect the externally visible state of the class (as often used for mutexes, memo caches, lazy evaluation, and ac

ctime

This header was originally in the C standard library as <time.h>. This header is part of the C-style date and time library. Macro Constants CLOCKS_PER_SEC number of processor clock ticks per second (macro constant) NULL implementation-defined null pointer constant (macro constant) Types clock_t process running time (typedef) size_t unsigned integer type returned by the sizeof operator (typedef) time_t time since epoch type (typedef) tm calendar time ty

cuchar

This header was originally in the C standard library as <uchar.h>. This header is part of the null-terminated multibyte strings library. Macros __STDC_UTF_16__ indicates that UTF-16 encoding is used by mbrtoc16 and c16rtomb (macro constant) __STDC_UTF_32__ indicates that UTF-32 encoding is used by mbrtoc32 and c32rtomb (macro constant) Functions mbrtoc16 (C++11) generate the next 16-bit wide character from a narrow multibyte string (function) c16rtomb (C++11)