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::is_same and std::is_same_v — type identity

std::is_same and std::is_same_v from <type_traits> check at compile time whether two types are exactly the same type. They account for const, volatile, and references; they do not test value equality or convertibility.

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

std::isspace — recognizing whitespace

std::isspace from <cctype> recognizes whitespace using the current C locale. When passing char values, ensure that the argument is in the permitted range.

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

std::is_standard_layout — checking standard-layout types

std::is_standard_layout checks at compile time whether a type satisfies the standard-layout rules. std::is_standard_layout_v exposes the same result directly as a bool. The trait does not guarantee padding-free storage or a portable binary format.

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

std::istringstream — reading values from text

std::istringstream reads values from in-memory text using operator >>. It follows the same formatting rules and error-state conventions as other input streams, without opening a file.

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

std::is_trivially_copyable — detecting trivially copyable types

This <type_traits> trait checks at compile time whether a type is trivially copyable. Learn the equivalent ::value and _v forms and the limits of copying an object's representation.

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

std::iterator_traits — iterator-associated types

std::iterator_traits<I>, declared in <iterator>, exposes types describing an iterator, including a raw pointer. It supports container-independent algorithms and distinguishes the value type from the type produced by dereferencing.

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

std::jthread — automatic joining and cooperative stopping

std::jthread owns a thread and, when a joinable object is destroyed, requests stopping and then waits for completion. std::jthread::request_stop does not forcibly interrupt execution: the worker must cooperate, for example by checking a std::stop_token.

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

std::latch — one-shot waiting for a counter to reach zero

std::latch from <latch> lets threads wait for a counter to reach zero. count_down() reports completion of a unit of work, while wait() waits for the countdown to finish without changing the counter.

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

std::launder — a pointer after storage reuse

std::launder from <new> obtains a pointer to an object at a given address when an old pointer does not automatically refer to its replacement. It neither creates an object nor repairs invalid memory access.

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

std::left — left-align an output field

std::left selects left alignment for formatted stream output. When a field is wider than its value, fill characters appear after the value. The alignment setting remains active until it is changed.

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

std::length_error — exceeding an allowable length

std::length_error, declared in <stdexcept>, reports an attempt to produce an object whose length exceeds its allowable limit. Learn its inheritance, message constructors, and handling through a const reference.

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

std::less — typed and transparent comparison

std::less from <functional> is a comparison function object. std::less<T> accepts arguments as const T&, whereas std::less<void>, also written std::less<>, deduces their types independently. Its is_transparent marker enables heterogeneous lookup.

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

std::list — sequences and element transfer with splice

std::list is a sequence container with bidirectional iterators. Learn begin(), empty(), and splice(): transferring elements between lists while preserving their identity, including complexity and the conditions required for valid use.

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

std::llabs — absolute value of a long long

std::llabs from <cstdlib> computes the absolute value of a long long and returns the same type. The result must be representable; calling it with the minimum long long value has undefined behavior.

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

std::locale — localization rules

std::locale from <locale> holds a collection of facets controlling rules such as numeric notation, character classification, and text collation. Assign it to a stream with imbue() to choose that stream's rules explicitly.

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

std::lock_guard — scope-bound lock ownership

std::lock_guard from <mutex> manages a lock using RAII. The constructor that takes only the mutex locks it. The std::adopt_lock overload takes responsibility for an exclusive lock the current thread already holds, without calling lock(). In both cases, the destructor unlocks the mutex. A named object protects a critical section throughout its lifetime.

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

std::logic_error — program logic exception

std::logic_error, declared in <stdexcept>, represents errors in a program's internal logic, such as violated preconditions or class invariants. It stores a message available through what() and derives from std::exception.

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

std::lower_bound — first position not less than a key

std::lower_bound searches a suitably partitioned range for its boundary: the first element not less than the key, or the end of the range. It returns an iterator, not confirmation that an equal value exists.

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

std::make_heap — building a heap from a range

std::make_heap rearranges a range into a heap in linear time. By default, the largest element moves to the front; a custom comparator can create a min-heap. The resulting range is not guaranteed to be sorted.

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

std::make_shared — creating an object with shared ownership

std::make_shared creates an object and returns a managing std::shared_ptr. For a non-array type, it forwards arguments to initialize the object. Copies of the pointer share the same object and responsibility for its lifetime.

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

std::make_tuple — creating a tuple with deduced types

std::make_tuple from <tuple> creates a tuple whose element types are deduced from its arguments. It normally stores values, but std::ref and std::cref let you create reference elements instead of copies.

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

std::make_unique — creating an exclusively owned object

std::make_unique from <memory> creates an object or a dynamic array and returns a std::unique_ptr that manages it. Ownership is exclusive, and the memory is automatically released when the owner is destroyed.

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

std::map — an ordered map of unique keys

std::map stores key–value pairs in comparator order, with at most one element for each equivalent key. Learn non-mutating lookup, insertion, erasure, and node transfer, including why operator[] is not a presence check.

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

std::max — selecting the largest value

std::max from <algorithm> selects the larger of two arguments or the largest element of a nonempty initializer list. It supports custom comparison; the two-value overload returns a reference, whereas the list overload returns a copy.

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