User:Cubbi/Sandbox/language old

This is a brief reference of available C++ language constructs.

Conditional execution statements
Conditional statements execute different code paths according to the value of given expression.


 * executes code conditionally
 * executes code according to the value of an integral argument

Iteration statements
Iteration statements execute a code path multiple times.


 * executes loops by specifying initialization, comparison, and increment
 * executes loops over a range
 * executes loop, checking condition before each iteration
 * executes loop, checking condition after each iteration

Jump statements
Jump statements continue program execution at a different location.


 * skips the remaining part of the enclosing loop body
 * terminates the enclosing loop
 * continues execution in another location
 * terminates execution of the enclosing function

Functions
The same code can be reused at different locations in the program.


 * declare functions
 * declare lambda functions
 * declare function templates
 * hints that the compiler insert a function's body directly into the calling code
 * declare that a function throws only specific exceptions
 * declares whether or not a function throws any exceptions

Exceptions
Exceptions are a more robust way to signal error condition than function return codes or global error variables.


 * signal errors and transfer control to error handlers
 * catch exceptions originating from specific blocks of code
 * and define and test if expressions throw exceptions

Namespaces
Namespaces provide a way to prevent name clashes in large projects.


 * declare namespaces
 * declare alternate names for existing namespaces

Types

 * define basic character, integer and floating point types
 * define types holding a memory location
 * define types that hold several data members (essentially the same as class)
 * define types that are able to hold only one of the specified values
 * define types that can hold data in several representations
 * define function call signatures, that is the types of arguments and the return type
 * defines a type equivalent to the type of an expression

Specifiers

 * specify constness and volatility of types
 * specify storage duration of types
 * specifies that the value of a variable or function can be computed at compile time
 * specifies that the actual type shall be defined from the expression, assigned to the variable
 * specifies that the storage for the variable should be aligned by specific amount

Initialization
Whenever a named variable is declared, and whenever a temporary object is created, the initial value of the new object is provided through one of the following mechanisms:


 * occurs when no initializer is provided
 * occurs when the initializer is an empty set of parentheses
 * initializes every bit of the object to zero
 * initializes an object from another object
 * provides the initial value or the list of constructor arguments, in parentheses
 * provides initial values to every member of an array or a struct without a constructor
 * provides an arbitrary long list of values, which can initialize a or
 * initializes all constant static objects before anything else
 * binds references to objects and extend the lifetimes of the temporaries

Literals
Literals are the tokens of a C++ program that represent constant values, embedded in the source code.


 * are decimal, octal, or hexadecimal numbers of integer type.
 * are individual characters of type, , , or
 * are values of type, , or
 * are sequences of characters, which may be narrow, multibyte, or wide
 * are values of type, that is and
 * is the pointer literal which specifies a null pointer value
 * are constant values of user-specified type

Expressions
An expression is a sequence of operators and operands that specifies a computation. An expression can result in a value and can cause side effects.


 * (lvalue, rvalue, glvalue, prvalue, xvalue) classify expressions by their values
 * of arguments and subexpressions specify the order in which intermediate results are obtained
 * allow the use of syntax commonly found in mathematics


 * defines the order in which operators are bound to their arguments
 * are alternative spellings for some operators

Utilities

 * Types
 * create synonyms for types
 * create synonyms for types
 * define additional information about variables
 * Casts
 * implicit conversions from one type to another
 * conversion using C-style cast notation and functional notation
 * Memory allocation
 * allocates memory dynamically
 * deallocates memory dynamically
 * conversion using C-style cast notation and functional notation
 * Memory allocation
 * allocates memory dynamically
 * deallocates memory dynamically

Classes
Classes provide the concept of object-oriented programming in C++.


 * declare classes
 * links to the current instance of a class in member methods
 * determine visibility of class members
 * grants access privileges to private/protected parts for non-member classes or functions
 * initialize class member data

Class-specific function properties

 * declares that a function is virtual
 * declares that a virtual function overrides another virtual function.
 * declares that a virtual function can not be overridden in a inheriting class.
 * declares that a constructor or conversion operator can not be used in implicit conversions
 * declares that a function does not use class data
 * declares that a member function can only be used on cv qualified objects

Special member functions

 * initializes the object with default contents
 * initializes the object with the contents of another object
 * initializes the object with the contents of other, temporary object, minimizing copying overhead
 * replaces the contents of the object with the contents of another object
 * replaces the contents of the object with the contents of other, temporary object, minimizing copying overhead
 * releases claimed resources

Templates
Allows functions and classes to operate on generic types


 * declares a class template
 * declares a function template
 * defines an existing template for a specific type
 * change the behavior of the template when instantiated
 * allows the use of lists of types in templates

Start and termination

 * provides a designated starting point for the program
 * describes how static and thread-local variables are initialized
 * describes the process of program shutdown

Optimizations

 * allows any code transformation that doesn't change the output
 * , including RVO and NRVO, makes pass-by-value the preferred approach in many situations.
 * makes multiple inheritance from interfaces or policy classes overhead-free and is required for standard-layout types.

Miscellaneous

 * allows the use of assembly code alongside C++ code

cpp/language cpp/language cpp/language cpp/language cpp/language cpp/language cpp/language cpp/language cpp/language