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

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

Constraints and concepts

This page describes an experimental core language feature. For named type requirements used in the specification of the standard library, see library concepts. Class templates, function templates, and non-template functions (typically members of class templates) may be associated with a constraint, which specifies the requirements on template arguments, which can be used to select the most appropriate function overloads and template specializations. Constraints may also be used to limit automat

Class template

A class template defines a family of classes. Syntax template < parameter-list > class-declaration (1) export template < parameter-list > class-declaration (2) (until C++11) Explanation class-declaration - a class declaration. The class name declared become a template name. parameter-list - a non-empty comma-separated list of the template parameters, each of which is either non-type parameter, a type parameter, a template parameter, or a parameter pack

std::is_sorted_until

Defined in header <algorithm> template< class ForwardIt > ForwardIt is_sorted_until( ForwardIt first, ForwardIt last ); (1) (since C++11) template< class ForwardIt, class Compare > ForwardIt is_sorted_until( ForwardIt first, ForwardIt last, Compare comp ); (2) (since C++11) Examines the range [first, last) and finds the largest range beginning at first in which the elements are sorted in ascending order. The first version of the

std::exchange

Defined in header <utility> template< class T, class U = T > T exchange( T& obj, U&& new_value ); (since C++14) Replaces the value of obj with new_value and returns the old value of obj. Parameters obj - object whose value to replace new_value - the value to assign to obj Type requirements - T must meet the requirements of MoveConstructible. Also, it must be possible to move-assign objects of type U to objects of type T Return value

std::find_end

Defined in header <algorithm> template< class ForwardIt1, class ForwardIt2 > ForwardIt1 find_end( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last ); (1) template< class ForwardIt1, class ForwardIt2, class BinaryPredicate > ForwardIt1 find_end( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last, BinaryPredicate p ); (2) Searches for the last subsequence of elements [s_f