Boolean literals

Syntax true (1) false (2) Explanation The Boolean literals are the keywords true and false. They are prvalues of type bool. Notes See Integral conversions for implicit conversions from bool to other types and boolean conversions for the implicit conversions from other types to bool. Example #include <iostream> int main() { std::cout << std::boolalpha << true << '\n' << false << '\n' <<

std::shared_ptr::owner_before

template< class Y > bool owner_before( const shared_ptr<Y>& other) const; template< class Y > bool owner_before( const std::weak_ptr<Y>& other) const; Checks whether this shared_ptr precedes other in implementation defined owner-based (as opposed to value-based) order. The order is such that two smart pointers compare equivalent only if they are both empty or if they both own the same object, even if the values of the pointers obtained by get() are

class

Usage declaration of a class declaration of a scoped enumeration type (since C++11) In a template declaration, class can be used to introduce type template parameters and template template parameters If a function or a variable exists in scope with the name identical to the name of a class type, class can be prepended to the name for disambiguation, resulting in an elaborated type specifier Example class Foo; // forward declaration of a class class Bar { // definit

operators

template< class T > complex<T> operator+( const complex<T>& lhs, const complex<T>& rhs); (1) template< class T > complex<T> operator+( const complex<T>& lhs, const T& rhs); (2) template< class T > complex<T> operator+( const T& lhs, const complex<T>& rhs); (3) template< class T > complex<T> operator-( const complex<T>& lhs, const complex<T>& rhs); (4) temp

operators (std::uniform_int_distribution)

template< class ResultType > bool operator==( const uniform_int_distribution<ResultType>& lhs, const uniform_int_distribution<ResultType>& rhs ); (1) template< class ResultType > bool operator!=( const uniform_int_distribution<ResultType>& lhs, const uniform_int_distribution<ResultType>& rhs ); (2) Compares two distribution objects. Two distribution objects are equal when parameter values and int

std::isalnum(std::locale)

Defined in header <locale> template< class charT > bool isalnum( charT ch, const locale& loc ); Checks if the given character classified as an alphanumeric character by the given locale's std::ctype facet. Parameters ch - character loc - locale Return value Returns true if the character is classified as alphanumeric, false otherwise. Possible implementation template< class charT > bool isalnum( charT ch, const std::locale& loc ) {

std::atomic_flag::atomic_flag

Defined in header <atomic> atomic_flag(); (1) (since C++11) atomic_flag( const atomic_flag& ) = delete; (2) (since C++11) Constructs a new std::atomic_flag. 1) Trivial default constructor, initializes std::atomic_flag to unspecified state. 2) The copy constructor is deleted; std::atomic_flag is not copyable. In addition, std::atomic_flag can be value-initialized to clear state with the expression ATOMIC_FLAG_INIT. For an atomic_flag with static storage duration, t

std::basic_regex::basic_regex

basic_regex(); (1) (since C++11) explicit basic_regex( const CharT* s, flag_type f = std::regex_constants::ECMAScript ); (2) (since C++11) basic_regex( const CharT* s, std::size_t count, flag_type f = std::regex_constants::ECMAScript ); (3) (since C++11) basic_regex( const basic_regex& other ); (4) (since C++11) basic_regex( basic_regex&& other ); (5) (since C++11) template< class ST, class SA > explicit basic_

std::shuffle_order_engine::shuffle_order_engine

shuffle_order_engine(); (1) (since C++11) explicit shuffle_order_engine( result_type s ); (2) (since C++11) template< class Sseq > explicit shuffle_order_engine( Sseq& seq ); (3) (since C++11) explicit shuffle_order_engine( const Engine& e ); (4) (since C++11) explicit shuffle_order_engine( Engine&& e ); (5) (since C++11) Constructs new pseudo-random engine adaptor. 1) Default constructor. The underlying engine is also default-constructed.

std::array::size

constexpr size_type size(); (since C++11) (until C++14) constexpr size_type size() const; (since C++14) Returns the number of elements in the container, i.e. std::distance(begin(), end()). Parameters (none). Return value The number of elements in the container. Exceptions noexcept specification: noexcept Complexity Constant. Example The following code uses size to display the number of elements in a std::array: #include <array> #include <iostream> i