std::bitset::count

size_t count() const; Returns the number of bits that are set to true. Parameters (none). Return value number of bits that are set to true. Example #include <iostream> #include <bitset> int main() { std::bitset<8> b("00010010"); std::cout << "initial value: " << b << '\n'; // find the first unset bit size_t idx = 0; while (idx < b.size() && b.test(idx)) ++idx; // continue setting bits until half the

std::cos(std::valarray)

Defined in header <valarray> template< class T > valarray<T> cos( const valarray<T>& va ); For each element in va computes cosine of the value of the element. Parameters va - value array to apply the operation to Return value Value array containing cosines of the values in va. Notes Unqualified function (cos) is used to perform the computation. If such function is not available, std::cos is used due to argument dependent lookup. The fu

std::basic_ofstream::basic_ofstream

basic_ofstream(); (1) explicit basic_ofstream( const char* filename, ios_base::openmode mode = ios_base::out ); (2) explicit basic_ofstream( const string& filename, ios_base::openmode mode = ios_base::out ); (3) (since C++11) basic_ofstream( basic_ofstream&& other ); (4) (since C++11) basic_ofstream( const basic_ofstream& rhs) = delete; (5) (since C++11) Constructs new file stream.

std::sqrt

Defined in header <cmath> float sqrt( float arg ); (1) double sqrt( double arg ); (2) long double sqrt( long double arg ); (3) double sqrt( Integral arg ); (4) (since C++11) Computes the square root of arg. 4) A set of overloads or a function template accepting an argument of any integral type. Equivalent to 2) (the argument is cast to double). Parameters arg - Value of a floating-point or Integral type Return value If no err

abstract class

Defines an abstract type which cannot be instantiated, but can be used as a base class. Syntax pure virtual function is a virtual function whose declarator has the following syntax: declarator virt-specifier(optional) = 0 Here the sequence = 0 is known as pure-specifier, and appears either immediately after the declarator or after the optional virt-specifier (override or final). pure-specifier cannot appear in a member function definition. struct Base { virtual int g(); virtual ~Base

std::condition_variable_any

Defined in header <condition_variable> class condition_variable_any; (since C++11) The condition_variable_any class is a generalization of std::condition_variable. Whereas std::condition_variable works only on std::unique_lock<std::mutex>, condition_variable_any can operate on any user-defined lock that meets the BasicLockable requirements. See std::condition_variable for the description of the semantics of condition variables. The class std::condition_variable_any is

std::find_first_of

Defined in header <algorithm> (1) template< class ForwardIt1, class ForwardIt2 > ForwardIt1 find_first_of( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last ); (until C++11) template< class InputIt, class ForwardIt > InputIt find_first_of( InputIt first, InputIt last, ForwardIt s_first, ForwardIt s_last ); (since C++11) (2) template< class ForwardIt1, class ForwardIt2, class Binary

signed

Usage signed type modifier

std::rend

Defined in header <iterator> template< class C > auto rend( C& c ) -> decltype(c.rend()); (1) (since C++14) template< class C > auto rend( const C& c ) -> decltype(c.rend()); (1) (since C++14) template< class T, size_t N > reverse_iterator<T*> rend( T (&array)[N] ); (2) (since C++14) template< class C > auto crend( const C& c ) -> decltype(std::rend(c)); (3) (since C++14) Returns an iterator to the

std::iswdigit

Defined in header <cwctype> int iswdigit( wint_t ch ); Checks if the given wide character corresponds (if narrowed) to one of the ten decimal digit characters 0123456789. Parameters ch - wide character Return value Non-zero value if the wide character is an numeric character, zero otherwise. Notes std::iswdigit and std::iswxdigit are the only standard wide character classification functions that are not affected by the currently installed C locale. Exampl