alignof operator

Queries alignment requirements of a type. Syntax alignof( type-id ) Returns a value of type std::size_t. Explanation Returns the alignment, in bytes, required for any instance of the type indicated by type-id, which is either complete type, an array type, or a reference type. If the type is reference type, the operator returns the alignment of referenced type; if the type is array type, alignment requirement of the element type is returned. Keywords alignof. Notes See alignm

std::basic_ifstream::is_open

bool is_open(); (until C++11) bool is_open() const; (since C++11) Checks if the file stream has an associated file. Effectively calls rdbuf()->is_open(). Parameters (none). Return value true if the file stream has an associated file, false otherwise. Example #include <string> #include <fstream> #include <iostream> //this file is called main.cpp bool file_exists(const std::string& str) { std::ifstream fs(str); return fs.is_open(); } int

std::ratio_less_equal

Defined in header <ratio> template< class R1, class R2 > struct ratio_less_equal : std::integral_constant; If the ratio R1 is less than or equal to the ratio R2, provides the member constant value equal true. Otherwise, value is false. Helper variable template template< class R1, class R2 > constexpr bool ratio_less_equal_v = ratio_less_equal<R1, R2>::value; (since C++17) Inherited from std::integral_constant Member constants value [st

std::basic_streambuf::pubseekpos

pos_type pubseekpos( pos_type pos, ios_base::openmode which = ios_base::in | ios_base::out ); (1) protected: virtual pos_type seekpos( pos_type pos, ios_base::openmode which = ios_base::in | ios_base::out); (2) Sets the position indicator of the input and/or output sequence to an absolute position. 1) Calls seekpos(pos, which) of the most derived class. 2) The base class version of this function has no effect. The derived classes may

std::ostreambuf_iterator::failed

bool failed() const; Returns true if the iterator encountered the end-of-file condition, that is, if an earlier call to std::basic_streambuf::sputc (made by operator=) returned Traits::eof. Parameters (none). Return value true if this iterator has encountered the end-of-file condition on output, false otherwise. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Example

ATOMIC_VAR_INIT

Defined in header <atomic> #define ATOMIC_VAR_INIT(value) /* implementation-defined */ Expands to an expression which can be used to initialize an std::atomic object that can be initialized from value. If the atomic object has static storage duration, this initialization is constant initialization. Notes Accessing the variable during initialization from another thread, even through an atomic operation, is a data race (it may happen if the address is immediately passed to

std::allocator::destroy

Defined in header <memory> void destroy( pointer p ); (until C++11) template< class U > void destroy( U* p ); (since C++11) Calls the destructor of the object pointed to by p. 1) Calls ((T*)p)->~T() 2) Calls p->~U() Parameters p - pointer to the object that is going to be destroyed Return value (none). See also destroy [static] destructs an object stored in the allocated storage (function template)

std::regex_constants::error_type

Defined in header <regex> typedef /*implementation defined*/ error_type; (since C++11) constexpr error_type error_collate = /*unspecified*/; constexpr error_type error_ctype = /*unspecified*/; constexpr error_type error_escape = /*unspecified*/; constexpr error_type error_backref = /*unspecified*/; constexpr error_type error_brack = /*unspecified*/; constexpr error_type error_paren = /*unspecified*/; constexpr error_type error_brace = /*unspecified*/; constexpr error_type er

std::deque::shrink_to_fit

void shrink_to_fit(); (since C++11) Requests the removal of unused capacity. It is a non-binding request to reduce capacity to size(). It depends on the implementation if the request is fulfilled. All iterators and references are potentially invalidated. Past-the-end iterator is also potentially invalidated. Parameters (none). Type requirements - T must meet the requirements of MoveInsertable. Return value (none). Complexity At most linear in the size of the container.

std::iswxdigit

Defined in header <cwctype> int iswxdigit( wint_t ch ); Checks if the given wide character corresponds (if narrowed) to a hexadecimal numeric character, i.e. one of 0123456789abcdefABCDEF. Parameters ch - wide character Return value Non-zero value if the wide character is a hexadecimal 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