Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C++

Knowledge base — C++

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

Entries: 674

C++

std::sort_heap — sorting an existing heap

std::sort_heap turns a heap into a sorted range. It requires random-access iterators and a range that is a valid heap under the comparison the function uses; it does not sort arbitrary input directly.

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

std::span — a view over contiguous elements

std::span provides access to contiguous elements without owning them. It lets you pass a range together with its size, while subspan creates a view of part of that range without copying elements.

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

std::stable_partition — stable range partitioning

std::stable_partition rearranges a range so that elements satisfying a predicate precede the others. It preserves relative order within both groups and returns an iterator to the partition boundary.

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

std::stable_sort — stable sorting

std::stable_sort sorts a range while preserving the relative order of elements equivalent under the comparison. It lets you order records by a key without changing the previous order of records with the same key.

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

std::stack — a LIFO container adaptor

std::stack from <stack> provides a LIFO stack: the most recently added element is removed first. The adaptor supports adding elements, inspecting the top, and removing it, but exposes neither iterators nor indexed access.

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

std::stod — convert text to double

std::stod from <string> converts a numeric prefix of text to double. The optional idx parameter identifies where conversion stopped; remaining characters do not automatically cause an error.

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

std::stoi — converting text to int

std::stoi from <string> converts an initial portion of text to int. It lets you specify the numeric base and retrieve the position where conversion stopped. It does not require consuming the entire string and reports errors through exceptions.

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

std::stop_source — a source of stop requests

std::stop_source provides shared stop-request state. get_token() exposes that state for observation, while request_stop() requests stopping. This is a cooperative mechanism: it does not automatically interrupt a running thread.

Intermediate · C++23; repository compiler flag, production runtime not attested
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