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-

std::iswalpha

Defined in header <cwctype> int iswalpha( std::wint_t ch ); Checks if the given wide character is an alphabetic character, i.e. either an uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ), a lowercase letter (abcdefghijklmnopqrstuvwxyz) or any alphabetic character specific to the current locale. Parameters ch - wide character Return value Non-zero value if the wide character is a alphabetic character, 0 otherwise. Example #include <iostream> #include &l

friend

Usage friend specifier

const_cast

Usage const_cast type conversion expression: as the declaration of the expression

std::bad_array_new_length

Defined in header <new> class bad_array_new_length; (since C++11) std::bad_array_new_length is the type of the object thrown as exceptions by the new-expressions to report invalid array lengths if. 1) array length is negative. 2) total size of the new array would exceed implementation-defined maximum value. 3) the number of initializer-clauses exceeds the number of elements to initialize. Only the first array dimension may generate this exception; dimensions other than the

std::ldexp

Defined in header <cmath> float ldexp( float x, int exp ); (1) double ldexp( double x, int exp ); (2) long double ldexp( long double x, int exp ); (3) double ldexp( Integral x, int exp ); (4) (since C++11) 1-3) Multiplies a floating point value x by the number 2 raised to the exp power. 4) A set of overloads or a function template accepting an argument of any integral type. Equivalent to (2) (the argument is cast to double). Parameters

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

std::ctype&lt;char&gt;::scan_is

Defined in header <locale> const char* scan_not (mask m, const char* beg, const char* end) const; (1) Locates the first character in the character array [beg, end) that does not satisfy the classification mask m, that is, the first character c such that table()[(unsigned char)c] & m would return false. If (unsigned char)c >= std::ctype<char>::table_size, then an implementation-defined value is substituted instead of table()[(unsigned char)c], possibly different

std::stack::top

reference top(); const_reference top() const; Returns reference to the top element in the stack. This is the most recently pushed element. This element will be removed on a call to pop(). Effectively calls c.back(). Parameters (none). Return value Reference to the last element. Complexity Constant. Example #include <stack> #include <iostream> int main() { std::stack<int> s; s.push( 2 ); s.push( 6 ); s.push( 51 ); std::cou

attribute specifier sequence(since C++11)

Introduces implementation-defined attributes for types, objects, code, etc. [[ attr]] [[attr1, attr2, attr3(args)]] [[namespace::attr(args)]] alignas_specifier Explanation Attributes provide the unified standard syntax for implementation-defined language extensions, such as the GNU and IBM language extensions __attribute__((...)), Microsoft extension __declspec(), etc. An attribute can be used almost everywhere in the C++ program, and can be applied to almost everything: to types, to v