value initialization

This is the initialization performed when a variable is constructed with an empty initializer. Syntax T(); (1) new T (); (2) Class::Class(...) : member() {... (3) T object {}; (4) (since C++11) T{}; (5) (since C++11) new T {}; (6) (since C++11) Class::Class(...) :member{} {... (7) (since C++11) Explanation Value initialization is performed in these situations: 1,5) when a nameless temporary object is created with the initializer consisting of

std::strstreambuf::pcount

int pcount() const; Returns the number of characters written to the output sequence. If the next pointer for the put area (std::streambuf::pptr()) is a null pointer, returns zero. Otherwise, returns the next pointer in the put area minus the beginning pointer in the put area, that is pptr() - pbase(). Parameters (none). Return value The number of characters written to the put area. Example #include <strstream> #include <iostream> int main() { std::strstream

std::unordered_set::bucket

size_type bucket( const Key& key ) const; (since C++11) Returns the index of the bucket for key key. Elements (if any) with keys equivalent to key are always found in this bucket. The returned value is valid only for instances of the container for which bucket_count() returns the same value. The behavior is undefined if bucket_count() is zero. Parameters key - the value of the key to examine Return value Bucket index for the key key. Complexity Constant. See also

default initialization

This is the initialization performed when a variable is constructed with no initializer. Syntax T object ; (1) new T ; new T ( ) ; (until c++03). (2) Explanation Default initialization is performed in three situations: 1) when a variable with automatic, static, or thread-local storage duration is declared with no initializer. 2) when an object with dynamic storage duration is created by a new-expression with no initializer or when an object is created by a new-expression

queue

This header is part of the containers library. Includes <initializer_list>(C++11) Classes queue adapts a container to provide queue (FIFO data structure) (class template) priority_queue adapts a container to provide priority queue (class template) std::uses_allocator<std::queue> (C++11) specializes the std::uses_allocator type trait (function template) std::uses_allocator<std::priority_queue> (C++11) specializes the std::uses_allocator type tr

std::vwprintf

Defined in header <cwchar> int vwprintf( const wchar_t* format, va_list vlist ); (1) int vfwprintf( std::FILE* stream, const wchar_t* format, va_list vlist ); (2) int vswprintf( const wchar_t* buffer, std::size_t buf_size, const wchar_t* format, va_list vlist ); (3) Loads the data from locations, defined by vlist,, converts them to wide string equivalents and writes the results to a variety of sinks. 1) Writes the results to stdout. 2) Writes th

std::array::swap

void swap( array& other ); (since C++11) Exchanges the contents of the container with those of other. Does not cause iterators and references to associate with the other container. Parameters other - container to exchange the contents with Return value (none). Exceptions noexcept specification: noexcept(noexcept(std::swap(declval<T&>(), declval<T&>()))) For zero-sized arrays, noexcept specification: noexcept(noexcept(true)) Complexity Li

std::vector::clear

void clear(); Removes all elements from the container. Invalidates any references, pointers, or iterators referring to contained elements. May invalidate any past-the-end iterators. Leaves the capacity() of the vector unchanged. Parameters (none). Return value (none). Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Linear in the size of the container. clear is defined in terms of erase, which has linear complexity. (until C++1

keywords

This is a list of reserved keywords in C++. Since they are used by the language, these keywords are not available for re-definition or overloading. alignas (since C++11)alignof (since C++11)andand_eqasmauto(1)bitandbitorboolbreakcasecatchcharchar16_t (since C++11)char32_t (since C++11)classcomplconcept (concepts TS)constconstexpr (since C++11)const_castcontinuedecltype (since C++11)default(1)delete(1)dodoubledynamic_cast. elseenumexplicitexport(1)externfalsefloatforfriendgotoifinlineintlongm

std::piecewise_constant_distribution

Defined in header <random> template< class RealType = double > class piecewise_constant_distribution; (since C++11) std::piecewise_constant_distribution produces random floating-point numbers, which are uniformly distributed within each of the several subintervals [bi, bi+1), each with its own weight wi. The set of interval boundaries and the set of weights are the parameters of this distribution. The probability density for any b. i≤x<bi+1 is wk S (bi+1 - bi)