std::unique_ptr::operator bool

explicit operator bool() const; (since C++11) Checks whether *this owns an object, i.e. whether get() != nullptr. Parameters (none). Return value true if *this owns an object, false otherwise. Exceptions noexcept specification: noexcept Example #include <iostream> #include <memory> int main() { std::unique_ptr<int> ptr(new int(42)); if (ptr) std::cout << "before reset, ptr is: " << *ptr << '\n'; ptr.reset(); if (ptr

RAII

"Resource Acquisition Is Initialization" or RAII, is a C++ programming technique[1] which binds the life cycle of a resource (allocated memory, open socket, open file, mutex, database connection - anything that exists in limited supply) to the lifetime of an object with automatic storage duration. RAII guarantees that the resource is available to any function that may access the object (resource availability is a class invariant). It also guarantees that all resources are released when their co

std::srand

Defined in header <cstdlib> void srand( unsigned seed ); Seeds the pseudo-random number generator used by std::rand() with the value seed. If rand() is used before any calls to srand(), rand() behaves as if it was seeded with srand(1). Each time rand() is seeded with srand(), it must produce the same sequence of values. srand() is not guaranteed to be thread-safe. Parameters seed - the seed value Return value (none). Notes Generally speaking, the pseudo-ran

std::data

Defined in header <iterator> Defined in header <array> Defined in header <deque> Defined in header <forward_list> Defined in header <list> Defined in header <map> Defined in header <regex> Defined in header <set> Defined in header <string> Defined in header <unordered_map> Defined in header <unordered_set> Defined in header <vector> templat

std::uses_allocator&lt;std::queue&gt;

template< class T, class Container, class Alloc > struct uses_allocator<queue<T,Container>,Alloc> : std::uses_allocator<Container, Alloc>::type { }; (since C++11) Provides a transparent specialization of the std::uses_allocator type trait for std::queue: the container adaptor uses allocator if and only if the underlying container does. Inherited from std::integral_constant Member constants value [static] true (public static member constant) Mem

std::atomic::operators (int)

T operator++(); T operator++() volatile; (1) (member only of atomic<Integral> template specialization)(since C++11) T* operator++(); T* operator++() volatile; (1) (member only of atomic<T*> template specialization)(since C++11) T operator++( int ); T operator++( int ) volatile; (2) (member only of atomic<Integral> template specialization)(since C++11) T* operator++( int ); T* operator++( int ) volatile; (2) (member only of atomic<T*> template speci

std::deque::pop_back

void pop_back(); Removes the last element of the container. Calling pop_back on an empty container is undefined. Iterators and references to the erased element are invalidated. It is unspecified whether the past-the-end iterator is invalidated. Other references and iterators are not affected. (until C++11) Iterators and references to the erased element are invalidated. The past-the-end iterator is also invalidated. Other references and iterators are not affected. (since C++11) P

std::swap(std::map)

template< class Key, class T, class Compare, class Alloc > void swap( map<Key,T,Compare,Alloc>& lhs, map<Key,T,Compare,Alloc>& rhs ); Specializes the std::swap algorithm for std::map. Swaps the contents of lhs and rhs. Calls lhs.swap(rhs). Parameters lhs, rhs - containers whose contents to swap Return value (none). Complexity Constant. Exceptions noexcept specification: noexcept(noexcept(lhs.swap(rhs))) (since C++17) See a

std::ctype&lt;char&gt;::is

Defined in header <locale> bool is(mask m, char c) const; (1) const char* is(const char* low, const char* high, mask* vec) const; (2) 1) Checks if the character c is classified by the mask m according to the classification table returned by the member function table(). Effectively calculates table()[(unsigned char)c] & m 2) For every character in the character array [low, high), reads its full classification mask from the classification table returned by the me

std::locale::id

Defined in header <locale> class locale::id; The class std::locale::id provides implementation-specific identification of a locale facet. Each class derived from std::locale::facet must have a public static member of type std::locale::id and each std::locale object maintains a list of facets it implements, indexed by their ids. Facets with the same id belong to the same facet category and replace each other when added to a locale object. Member functions (constructor)