std::discrete_distribution::probabilities

std::vector<double> probabilities() const; (since C++11) Obtains a std::vector<double> containing the individual probabilities of each integer that is generated by this distribution. Parameters (none). Return value An object of type std::vector<double> Example #include <iostream> #include <vector> #include <random> int main() { std::discrete_distribution<> d({40, 10, 10, 40}); std::vector<double> p = d.probabilities();

std::unique_ptr::release

pointer release(); (since C++11) Releases the ownership of the managed object if any. get() returns nullptr after the call. Parameters (none). Return value Pointer to the managed object or nullptr if there was no managed object, i.e. the value which would be returned by get() before the call. Exceptions noexcept specification: noexcept Example #include <memory> #include <iostream> #include <cassert> struct Foo { Foo() { std::cout << "Foo\n";

std::integer_sequence

Defined in header <utility> template< class T, T... Ints > class integer_sequence; (since C++14) The class template std::integer_sequence represents a compile-time sequence of integers. When used as an argument to a function template, the parameter pack Ints can be deduced and used in pack expansion. Template parameters T - an integer type to use for the elements of the sequence ...Ints - a non-type parameter pack representing the sequence Member ty

operator-(move_iterator)

template< class Iterator1, class Iterator2 > auto operator-( const move_iterator<Iterator1>& lhs, const move_iterator<Iterator2>& rhs ) -> decltype(lhs.base() - rhs.base()); (since C++11) Returns the distance between two iterator adaptors. Parameters lhs, rhs - iterator adaptors to compute the difference of Return value lhs.base() - rhs.base(). Example

std::codecvt_utf16

Defined in header <codecvt> template< class Elem, unsigned long Maxcode = 0x10ffff, std::codecvt_mode Mode = (std::codecvt_mode)0 > class codecvt_utf16 : public std::codecvt<Elem, char, std::mbstate_t>;; std::codecvt_utf16 is a std::codecvt facet which encapsulates conversion between a UTF-16 encoded byte string and UCS2 or UCS4 character string (depending on the type of Elem). This codecvt facet can be used to read and write UTF-16 files in

std::merge

Defined in header <algorithm> template< class InputIt1, class InputIt2, class OutputIt > OutputIt merge( InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first ); (1) template< class InputIt1, class InputIt2, class OutputIt, class Compare> OutputIt merge( InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first, Compare comp ); (2) Merges t

std::basic_filebuf::close

std::basic_filebuf<CharT, Traits>* close(); If a put area exist (e.g. file was opened for writing), first calls overflow(Traits::eof()) to write all pending output to the file, including any unshift sequences. If the most recently called function, out of underflow(), overflow(), seekpos(), and seekoff(), was overflow(), then calls std::codecvt::unshift(), perhaps multiple times, to determine the unshift sequence according to the imbued locale, and writes that sequence to file with

std::gamma_distribution::reset

void reset(); (since C++11) Resets the internal state of the distribution object. After a call to this function, the next call to operator() on the distribution object will not be dependent on previous calls to operator(). Parameters (none). Return value (none). Complexity Constant.

Name lookup

Name lookup is the procedure by which a name, when encountered in a program, is associated with the declaration that introduced it. For function names, name lookup can associate multiple declarations with the same name, and may obtain additional declarations from argument-dependent lookup. Template argument deduction may also apply, and the set of declarations is passed to overload resolution, which selects the declaration that will be used. Member access rules, if applicable, are considered on

short

Usage short type modifier