Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 5788

C++

Atomic shared_ptr stores and loads through free functions

The std::shared_ptr overloads of std::atomic_store_explicit and std::atomic_load_explicit atomically replace and retrieve a shared handle. Deprecated in C++23, they protect the handle and ownership, not arbitrary operations on the pointed-to object.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::atomic_thread_fence — synchronization using memory fences

std::atomic_thread_fence establishes memory-ordering constraints without reading or writing a specified object. Inter-thread synchronization requires appropriately connected atomic operations; fences alone are not enough.

Advanced · C++23; repository compiler flag, production runtime not attested
C++

std::back_insert_iterator — appending through an output iterator

std::back_insert_iterator is an output iterator adaptor that turns value assignment into a container push_back call. It lets you append elements using *out++ = value without overwriting existing elements.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::bad_alloc — allocation failure exception

std::bad_alloc from <new> reports failure to allocate storage. Learn how to catch it by const reference, why what() has no portable fixed text, and how throwing allocation differs from std::nothrow.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::bad_optional_access — exception for empty optional access

std::bad_optional_access is the exception thrown by value() when std::optional contains no value. Distinguish this checked access from the * and -> operators, which require a value to be present.

Basic · C++23; repository compiler flag, production runtime not attested
C++

std::basic_ios::tie — tying a stream to an output stream

std::basic_ios::tie queries or changes a tied output stream. The tie allows its buffer to be flushed before input; nullptr removes the tie, and the setter overload returns the previous pointer.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::basic_ostream::flush — synchronize the output buffer

std::basic_ostream::flush requests synchronization of a stream buffer and returns a reference to the same stream. It does not append a newline; synchronization failure is reported through badbit.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::basic_string::operator+= — appending to a string

std::basic_string::operator+= appends characters to an existing string and returns a reference to it. It accepts another string, a single character, a null-terminated string, an initializer list, or a string-view-compatible type.

Basic · C++23; repository compiler flag, production runtime not attested
C++

std::bit_cast — creating a value from a bit representation

std::bit_cast<To>(from) creates a new object from the source object's bits. Both types must have equal size and be trivially copyable; this is neither a numeric conversion nor access to the source through an alias.

Intermediate · C++23; repository compiler flag, production runtime not attested
C++

std::boolalpha — textual bool values in streams

std::boolalpha enables textual output and input of bool values on a particular stream. With the classic locale, the names are true and false. The setting remains active until changed.

Basic · C++23; repository compiler flag, production runtime not attested
C++

std::chars_format — floating-point conversion format

std::chars_format selects floating-point notation for std::to_chars and parsing rules for std::from_chars. It provides general, fixed, scientific, and hex formats; it does not set precision by itself.

Intermediate · C++23; repository compiler flag, production runtime not attested