std::packaged_task::packaged_task

packaged_task(); (1) (since C++11) template <class F> explicit packaged_task( F&& f ); (2) (since C++11) (3) template <class F, class Allocator> explicit packaged_task( std::allocator_arg_t, const Allocator& a, F&& f ); (since C++11) (until C++17) template <class F, class Allocator> packaged_task( std::allocator_arg_t, const Allocator& a, F&& f ); (since C++17) (4) packaged_task( packaged_task& ) = delete; (sinc

std::make_error_code(std::errc)

Defined in header <system_error> std::error_code make_error_code( std::errc e ); (since C++11) Creates error code value for errc enum e. Equivalent to std::error_code(static_cast<int>(e), std::generic_category()). Parameters e - error code enum to create error code for Return value Error code corresponding to e. Exceptions noexcept specification: noexcept

operators (std::reverse_iterator)

template< class Iterator1, class Iterator2 > bool operator==( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); (1) template< class Iterator1, class Iterator2 > bool operator!=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); (2) template< class Iterator1, class Iterator2 > bool operator<( const reverse_iterator<Iterator

std::isnormal

Defined in header <cmath> bool isnormal( float arg ); (1) (since C++11) bool isnormal( double arg ); (2) (since C++11) bool isnormal( long double arg ); (3) (since C++11) bool isnormal( Integral arg ); (4) (since C++11) 1-3) Determines if the given floating point number arg is normal, i.e. is neither zero, subnormal, infinite, nor NaN. 4) A set of overloads or a function template accepting the from argument of any integral type. Equivalent to (2) (the ar

std::list::sort

void sort(); (1) template< class Compare > void sort( Compare comp ); (2) Sorts the elements in ascending order. The order of equal elements is preserved. The first version uses operator< to compare the elements, the second version uses the given comparison function comp. Parameters comp - comparison function object (i.e. an object that satisfies the requirements of Compare) which returns ​true if the first argument is less than (i.e. is ordered before) the secon

sizeof... operator

Queries the number of elements in a parameter pack. Syntax sizeof...( parameter_pack ) (since C++11) Returns a constant of type std::size_t. Explanation Returns the number of elements in a parameter pack. Keywords sizeof. Example #include <iostream> #include <array> template<typename... Ts> constexpr auto make_array(Ts&&... ts) -> std::array<std::common_type_t<Ts...>,sizeof...(ts)> { return { std::forward<Ts>(ts)...

std::modulus

Defined in header <functional> template< class T > struct modulus; (until C++14) template< class T = void > struct modulus; (since C++14) Function object for computing remainders of divisions. Implements operator% for type T. Specializations The standard library provides a specialization of std::modulus when T is not specified, which leaves the parameter types and return type to be deduced. modulus<void> function object implementing x % y ded

operators (std::unordered_set)

template< class Key, class Hash, class KeyEqual, class Allocator > bool operator==( const unordered_set<Key,Hash,KeyEqual,Allocator>& lhs, const unordered_set<Key,Hash,KeyEqual,Allocator>& rhs ); (1) template< class Key, class Hash, class KeyEqual, class Allocator > bool operator!=( const unordered_set<Key,Hash,KeyEqual,Allocator>& lhs, const unordered_set<Key,Hash,KeyEqual,Allocator>& rhs ); (2)

std::function::target

template< class T > T* target(); (1) (since C++11) template< class T > const T* target() const; (2) (since C++11) Returns a pointer to the stored callable function target. Parameters (none). Return value A pointer to the stored function if target_type() == typeid(T), otherwise a null pointer. Exceptions noexcept specification: noexcept Example #include <functional> #include <iostream> int f(int, int) { return 1; } int g(int, int) { retur

std::rethrow_exception

Defined in header <exception> [[noreturn]] void rethrow_exception( std::exception_ptr p ) (since C++11) Throws the previously captured exception object, referred to by the exception pointer p. Parameters p - non-null std::exception_ptr Return value (none). Example #include <iostream> #include <string> #include <exception> #include <stdexcept> void handle_eptr(std::exception_ptr eptr) // passing by value is ok { try {