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

std::isgraph

Defined in header <cctype> int isgraph( int ch ); Checks if the given character is graphic (has a graphical representation) as classified by the currently installed C locale. In the default C locale, the following characters are graphic: digits (0123456789) uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ) lowercase letters (abcdefghijklmnopqrstuvwxyz) punctuation characters (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~) The behavior is undefined if the value of ch is

C-style file input/output

The C I/O subset of the C++ standard library implements C-style stream input/output operations. The <cstdio> header provides generic file operation support and supplies functions with narrow and multibyte character input/output capabilities, and the <cwchar> header provides functions with wide character input/output capabilities. C streams are objects of type std::FILE that can only be accessed and manipulated through pointers of type std::FILE* (Note: while it may be possible to cr

std::time_put::put

Defined in header <locale> public: iter_type put( iter_type out, std::ios_base& str, char_type fill, const std::tm* t, const CharT* fmtbeg, const CharT* fmtend ) const; (1) public: iter_type put( iter_type out, std::ios_base& str, char_type fill, const std::tm* t, char format, char modifier = 0 ) const; (2) protected: virtual iter_type do_put( iter_type out, std::ios_base& str,

std::acos(std::complex)

Defined in header <complex> template< class T > complex<T> acos( const complex<T>& z ); (since C++11) Computes complex arc cosine of a complex value z. Branch cuts exist outside the interval [−1 ; +1] along the real axis. Parameters z - complex value Return value If no errors occur, complex arc cosine of z is returned, in the range [0 ; ∞) along the real axis and in the range [−iπ ; iπ] along the imaginary axis. Error handling and spec

mutex

This header is part of the thread support library. Classes mutex (C++11) provides basic mutual exclusion facility (class) timed_mutex (C++11) provides mutual exclusion facility which implements locking with a timeout (class) recursive_mutex (C++11) provides mutual exclusion facility which can be locked recursively by the same thread (class) recursive_timed_mutex (C++11) provides mutual exclusion facility which can be locked recursively by the same thread and impl