std::chrono::time_point::time_since_epoch

duration time_since_epoch() const; (since C++11) (until C++14) constexpr duration time_since_epoch() const; (since C++14) Returns a duration representing the amount of time between *this and the clock's epoch. Parameters (none). Return value The amount of time between this time_point and the clock's epoch. Example #include <iostream> #include <chrono> #include <ctime> int main() { std::chrono::time_point<std::chrono::system_clock> p1, p2, p

std::memset

Defined in header <cstring> void* memset( void* dest, int ch, std::size_t count ); Converts the value ch to unsigned char and copies it into each of the first count characters of the object pointed to by dest. If the object is not trivially-copyable (e.g., scalar, array, or a C-compatible struct), the behavior is undefined. If count is greater than the size of the object pointed to by dest, the behavior is undefined. Parameters dest - pointer to the object to fill

std::deque::emplace_front

template< class... Args > void emplace_front( Args&&... args ); (since C++11) Inserts a new element to the beginning of the container. The element is constructed through std::allocator_traits::construct, which typically uses placement-new to construct the element in-place at the location provided by the container. The arguments args... are forwarded to the constructor as std::forward<Args>(args).... Parameters args - arguments to forward to the constructor of

std::negative_binomial_distribution

Defined in header <random> template< class IntType = int > class negative_binomial_distribution; (since C++11) Produces random non-negative integer values i, distributed according to discrete probability function: P(i|k,p) = ⎛⎜⎝k + i − 1i⎞⎟⎠ · pk · (1 − p)i The value represents the number of failures in a series of independent yes/no trials (each succeeds with probability p), before exactly k successes occur. std::negative_binomial_distribution satisfies RandomNu

std::void_t

Defined in header <type_traits> template< class... > using void_t = void; (since C++17) Utility metafunction that maps a sequence of any types to the type void. Notes This metafunction is used in template metaprogramming to detect ill-formed types in SFINAE context: // primary template handles types that have no nested ::type member: template< class, class = std::void_t<> > struct has_type_member : std::false_type { }; // specialization recognizes typ

std::chrono::duration_values::min

static constexpr Rep min(); Returns the lowest possible representation. Parameters (none). Return value returns std::numeric_limits<Rep>::lowest(). See also min [static] returns the special duration value min (public static member function of std::chrono::duration) zero [static] returns a zero-length representation (public static member function) max [static] returns the largest possible representation (public static member function)

std::multiset::size

size_type size() const; 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 (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. Example The following code uses size to display the number of elements in a std::multiset: #include <set> #include <iostream> int main() { std::multiset<int> nums {

vector

This header is part of the containers library. Includes <initializer_list>(C++11) Classes vector dynamic contiguous array (class template) vector<bool> space-efficient dynamic bitset (class template specialization) std::hash<std::vector<bool>> (C++11) hash support for std::vector<bool> (class template specialization) Functions operator==operator!=operator<operator<=operator>operator>= lexicographically compares the va

std::ctype::toupper

Defined in header <locale> public: CharT toupper( CharT c ) const; (1) public: const CharT* toupper( CharT* beg, const CharT* end ) const; (2) protected: virtual CharT do_toupper( CharT c ) const; (3) protected: virtual const CharT* do_toupper( CharT* beg, const CharT* end ) const; (4) 1,2) public member function, calls the protected virtual member function do_toupper of the most derived class. 3) Converts the character c to upper case if an upper case f

The as-if rule

Allows any and all code transformations that do not change the observable behavior of the program. Explanation The C++ compiler is permitted to perform any changes to the program as long as the following remains true: 1) At every sequence point, the values of all volatile objects are stable (previous evaluations are complete, new evaluations not started) (until C++11) 1) Accesses (reads and writes) to volatile objects occur strictly according to the semantics of the expressions in whic