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++

std::stop_token — cooperative operation cancellation

std::stop_token lets an operation check whether a stop request has been made. Its stop_requested() member reads shared state; the token itself neither stops a thread nor issues a request.

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

std::string — storing and modifying text

std::string is an owning, variable-length sequence of char elements. Learn construction, appending, searching, and substring extraction, including the difference between reserve and resize and the rules for safely using data().

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

std::stringstream — reading and writing text in memory

std::stringstream from <sstream> formats values as text and reads values from text held in memory. It combines the << and >> operators with a string buffer and stream error state.

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

std::string_view — a non-owning view of text

std::string_view provides access to text without copying characters or owning their storage. Learn to search with find, create subviews with substr, and check npos while keeping the underlying data alive.

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

std::strong_ordering — a strong ordering result

std::strong_ordering from <compare> describes a three-way comparison result: less, equal, or greater. It represents a total order with substitutability of equal values and has no unordered state.

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

std::suspend_always — unconditional coroutine suspension

std::suspend_always from <coroutine> is a simple awaitable that suspends a coroutine without producing a value. It does not schedule resumption: managing code must retain a handle and resume or destroy the suspended coroutine.

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

std::suspend_never — awaiting without suspending a coroutine

std::suspend_never from <coroutine> is a trivial awaiter that does not suspend a coroutine and produces no value. It helps specify immediate coroutine startup or completion; at completion, careful attention to coroutine-state lifetime is necessary.

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

std::swap — exchanging values

std::swap from <utility> exchanges the values of two objects and returns void. Learn the primary template's requirements, the array overload, and the call pattern that enables ADL in generic code.

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

std::system_error — an exception carrying an error code

std::system_error combines an error code with diagnostic text. It lets low-level errors travel as exceptions while retaining structured information for identifying the cause programmatically.

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

std::terminate — terminating without returning

std::terminate, declared in <exception>, invokes a program-termination handler and never returns. It is triggered by conditions such as an unhandled exception or an exception escaping a noexcept function, and can also be called explicitly. It does not guarantee destructor-based resource cleanup.

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

std::this_thread::sleep_for — pause the current thread

std::this_thread::sleep_for blocks the calling thread for a relative interval expressed as std::chrono::duration. It neither creates a thread nor synchronizes access to data. Returning may take longer than the requested interval.

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

std::this_thread::yield — an opportunity to reschedule

std::this_thread::yield() gives the implementation an opportunity to reschedule threads. It guarantees neither that another thread runs nor any particular waiting time, and it provides no memory synchronization.

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

std::thread — starting a thread and managing its lifetime

std::thread runs a callable in a separate thread. Learn how joinable(), join(), and detach() differ, and why the association with a thread must be resolved before its object is destroyed.

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

std::tie — a tuple of references to existing objects

std::tie from <tuple> creates a tuple of lvalue references to existing objects. It lets you assign tuple elements to variables and skip selected positions with std::ignore, without copying the referenced objects.

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

std::to_chars — write a number into a character buffer

std::to_chars writes a number's textual representation into a caller-provided buffer. Its result contains an end pointer and an error code; the function does not append a terminating '\0'.

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

std::tolower — lowercase conversion

std::tolower from <cctype> converts one character to lowercase according to the current C locale. For char data, convert to unsigned char first and call the function only if the resulting value fits in int.

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

std::to_string — convert a number to text

std::to_string from <string> returns a number's textual representation as a std::string. This entry covers C++23, including floating-point formatting limitations and the distinction from the newer working draft.

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

std::to_underlying — convert an enumeration to its underlying type

std::to_underlying, declared in <utility>, converts an enumeration value to its exact underlying type. Available since C++23, it is constexpr and noexcept; it neither forces the result to int nor checks whether the value corresponds to a named enumerator.

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

std::toupper — convert one character to uppercase

std::toupper from <cctype> returns a character's uppercase equivalent using the current C locale. Its argument must equal EOF or be representable as unsigned char; its return type is int.

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

std::transform — transforming range elements

std::transform from <algorithm> writes the results of a unary or binary operation into an output range. It neither creates a container nor automatically increases its size.

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

std::transform_reduce — transformation and reduction

std::transform_reduce from <numeric> transforms elements of one range or corresponding pairs from two ranges, then combines the results with init. The reduction order and grouping are unspecified.

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

std::tuple — a tuple of elements with fixed types

std::tuple from <tuple> groups a fixed number of elements whose types may differ. std::get provides access, while structured bindings let you give the elements local names.

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

std::u8string — a string of UTF-8 code units

std::u8string is an alias for std::basic_string<char8_t> from <string>. It stores UTF-8 code units but does not validate the encoding; size() does not count user-perceived characters.

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

std::unexpected — explicitly marking an error result

std::unexpected<E> from <expected> wraps an error value to construct std::expected<T, E> in its failure state. It distinguishes an error from a successful result even when T and E are the same type.

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