Array declaration

Declares an object of array type. Syntax An array declaration is any simple declaration whose declarator has the form. noptr-declarator [ constexpr(optional) ] attr(optional) (1) noptr-declarator - any valid declarator, but if it begins with *, &, or &&, it has to be surrounded by parentheses. attr(C++11) - optional list of attributes constexpr - an integral constant expression (until C++14)a converted constant expression of type std::size_t (since C++14)

array

This header is part of the containers library. Includes <initializer_list>(C++11) Classes array (since C++11) static contiguous array (class template) std::tuple_size<std::array> obtains the size of an array (class template specialization) std::tuple_element<std::array> obtains the type of the elements of array (class template specialization) Functions operator==operator!=operator<operator<=operator>operator>= lexicographically c

Arithmetic operators

Returns the result of specific arithmetic operation. Operator name Syntax Over​load​able Prototype examples (for class T) Inside class definition Outside class definition unary plus +a Yes T T::operator+() const; T operator+(const T &a); unary minus -a Yes T T::operator-() const; T operator-(const T &a); addition a + b Yes T T::operator+(const T2 &b) const; T operator+(const T &a, const T2 &b); subtraction a - b Yes T T::operator-

Argument-dependent lookup

Argument-dependent lookup, also known as ADL, or Koenig lookup, is the set of rules for looking up the unqualified function names in function-call expressions, including implicit function calls to overloaded operators. These function names are looked up in the namespaces of their arguments in addition to the scopes and namespaces considered by the usual unqualified name lookup. Argument-dependent lookup makes it possible to use operators defined in a different namespace. #include <iostream&

and_eq

Usage alternative operators: as an alternative for &= Example #include <iostream> #include <bitset> int main() { std::bitset<4> mask("1100"); std::bitset<4> val("0111"); val and_eq mask; std::cout << val << '\n'; } Output: 0100

and

Usage alternative operators: as an alternative for && Example #include <iostream> int n; int main() { if(n > 0 and n < 5) { std::cout << "n is small and positive\n"; } }

Alternative operator representations

C++ (and C) source code may be written in any non-ASCII 7-bit character set that includes the ISO 646:1983 invariant character set. However, several C++ operators and punctuators require characters that are outside of the ISO 646 codeset: {, }, [, ], #, \, ^, |, ~. To be able to use character encodings where some or all of these symbols do not exist (such as the German DIN 66003), C++ defines two kinds of alternatives: additional keywords that correspond to the operators that use these characte

AllocatorAwareContainer

An AllocatorAwareContainer is a Container that holds an instance of an Allocator and uses that instance to allocate and deallocate memory in all of its member functions. The following rules apply to object construction. Copy constructors of AllocatorAwareContainers obtain their instances of the allocator by calling std::allocator_traits<allocator_type>::select_on_container_copy_construction on the allocator of the container being copied. Move constructors obtain their instances of allo

Allocator

Encapsulates a memory allocation and deallocation strategy. Every standard library component that may need to allocate or release storage, from std::string, std::vector, and every container except std::array, to std::shared_ptr and std::function, does so through an Allocator: an object of a class type that satisfies the following requirements. Some requirements are optional: the template std::allocator_traits supplies the default implementations for all optional requirements, and all standard l

alignof operator

Queries alignment requirements of a type. Syntax alignof( type-id ) Returns a value of type std::size_t. Explanation Returns the alignment, in bytes, required for any instance of the type indicated by type-id, which is either complete type, an array type, or a reference type. If the type is reference type, the operator returns the alignment of referenced type; if the type is array type, alignment requirement of the element type is returned. Keywords alignof. Notes See alignm