std::discrete_distribution

Defined in header <random> template< class IntType = int > class discrete_distribution; (since C++11) std::discrete_distribution produces random integers on the interval [0, n), where the probability of each individual integer i is defined as wi/S, that is the weight of the ith integer divided by the sum of all n weights. std::discrete_distribution satisfies all requirements of RandomNumberDistribution. Template parameters IntType - The result type generated b

complex

This header is part of the numeric library. Classes complex a complex number type (class template) complex<float>complex<double>complex<long double> a complex number type (class template specialization) Functions Operations operator+operator- applies unary operators to complex numbers (function template) operator+operator-operator*operator/ performs complex number arithmetics on two complex values or a complex and a scalar (function template)

std::search_n

Defined in header <algorithm> template< class ForwardIt, class Size, class T > ForwardIt search_n( ForwardIt first, ForwardIt last, Size count, const T& value ); (1) template< class ForwardIt, class Size, class T, class BinaryPredicate > ForwardIt search_n( ForwardIt first, ForwardIt last, Size count, const T& value, BinaryPredicate p ); (2) Searches the range [first, last) for the first sequence of count identical elements, e

Member access operators

Accesses a member of its operand. Operator name Syntax Over​load​able Prototype examples (for class T) Inside class definition Outside class definition subscript a[b] Yes R& T::operator[](S b); N/A indirection *a Yes R& T::operator*(); R& operator*(T a); address-of &a Yes R* T::operator&(); R* operator&(T a); member of object a.b No N/A N/A member of pointer a->b Yes R* T::operator->(); N/A pointer to membe

std::wcstok

Defined in header <cwchar> wchar_t* wcstok( wchar_t* str, const wchar_t* delim, wchar_t ** ptr); Finds the next token in a null-terminated wide string pointed to by str. The separator characters are identified by null-terminated wide string pointed to by delim. This function is designed to be called multiples times to obtain successive tokens from the same string. If str != NULL, the call is treated as the first call to std::wcstok for this particular wide string. The fu

std::rethrow_if_nested

Defined in header <exception> template< class E > void rethrow_if_nested( const E& e ); (since C++11) If E is not a polymorphic class type, does nothing. Otherwise, if dynamic_cast<const std::nested_exception&>(e) would succeed (i.e., if E or the dynamic type (the most derived type) of the object referenced by e is std::nested_exception or publicly and unambiguously derived from std::nested_exception), extracts and throws the nested exception as if by ca

std::log

Defined in header <cmath> float log( float arg ); (1) double log( double arg ); (2) long double log( long double arg ); (3) double log( Integral arg ); (4) (since C++11) 1-3) Computes the the natural (base e) logarithm of arg. 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 arg - value of floating-point or Integral type Retu

copy elision

Optimizes out copy- and move-constructors, resulting in zero-copy pass-by-value semantics. Explanation Under the following circumstances, the compilers are permitted to omit the copy- and move-constructors of class objects even if copy/move constructor and the destructor have observable side-effects. If a function returns a class type by value, and the return statement's expression is the name of a non-volatile object with automatic storage duration, which isn't the function parameter, or a

std::basic_stringbuf::seekoff

protected: virtual pos_type seekoff(off_type off, ios_base::seekdir dir, ios_base::openmode which = ios_base::in | ios_base::out); Repositions std::basic_streambuf::gptr and/or std::basic_streambuf::pptr, if possible, to the position that corresponds to exactly off characters from beginning, end, or current position of the get and/or put area of the buffer. If which includes ios_base::in and this buffer is open for reading (that is, if

Functions

Functions are C++ entities that associate a sequence of statements (a function body) with a name and a list of zero or more function parameters. // function name: "isodd" // parameter list has one parameter, with name "n" and type int // the return type is bool bool isodd(int n) { // the body of the function begins return n % 2; } // the body of the function ends When a function is invoked, e.g. in a function-call expression, the parameters are init