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::unique — removing consecutive duplicates

std::unique keeps the first element of each consecutive group of equivalent elements. It returns the new logical end of the range without reducing the container's size.

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

std::unique_lock — flexible mutex lock management

std::unique_lock is a movable but noncopyable RAII object from <mutex> that manages mutex lock ownership. It supports deferred locking, unlocking before scope exit, and locking again. Its destructor unlocks the mutex only when the object still owns the lock.

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

std::unique_ptr — exclusive resource ownership

std::unique_ptr is an exclusively owning smart pointer that automatically disposes of its resource. It cannot be copied, but ownership can be moved to another pointer.

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

std::unordered_map — a hash map with unique keys

std::unordered_map stores key–value pairs without a guaranteed order. Learn non-inserting lookup, the difference between operator[] and at, and how bucket management affects iterator validity.

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

std::unordered_multimap — multiple values for one key

std::unordered_multimap stores key–value pairs and permits multiple entries with equivalent keys. It provides hash-based lookup but does not keep keys sorted. Use equal_range to retrieve every matching entry.

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

std::unordered_multiset — a hash container allowing duplicates

std::unordered_multiset stores keys while allowing multiple equivalent occurrences. It supports lookup and removal without maintaining sorted order, and requires the hash function to agree with the key equivalence predicate.

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

std::unordered_set — a set of unique keys

std::unordered_set stores unique keys using hashing. It supports membership checks, insertion, and removal without guaranteeing iteration order. Common operations have constant average complexity but linear worst-case complexity.

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

std::upper_bound — the boundary after equivalent elements

`std::upper_bound` finds the partition boundary for the search value: it returns an iterator to the first element for which `value` compares less than that element, or `last` if no such element exists. With the default comparison on numbers sorted in ascending order, this is the first number greater than `value`.

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

std::uppercase — uppercase letters in numeric output

std::uppercase is a stream manipulator that selects uppercase letters in formatted numeric output, such as hexadecimal digits A–F and the exponent marker E. It does not transform text or select a number base; the setting remains active until changed.

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

std::variant — one of a fixed set of alternative types

std::variant stores a value of one of the alternatives specified by its template parameters and manages that value's lifetime. It models data such as “number or text” and provides checked ways to inspect and handle the active alternative.

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

std::vector — dynamic array

std::vector manages a resizable sequence of elements. Learn the difference between size and capacity, how to add and remove elements, how iterators provide access, and when pointers and references become invalid.

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

std::vformat — formatting with a runtime format string

std::vformat from <format> builds a string from a format string and a std::format_args argument pack. It accepts a pattern determined at runtime and reports invalid formatting for the supplied arguments through std::format_error.

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

std::views::all — a view of an entire range

std::views::all adapts a range to the view interface while retaining every element. Its result can be a copy or move of an existing view, a reference view, or an owning view; that choice determines how data lifetime must be managed.

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

std::views::chunk — divide a range into chunks

C++23 std::views::chunk creates a lazy range of views over successive, non-overlapping groups of n elements. The final chunk may be shorter; n must be positive.

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

std::views::drop — skipping the first N elements

std::views::drop creates a view of a range without its first N elements, without erasing them from the container. Use either the two-argument call or pipeline syntax. The number of elements to skip must be nonnegative.

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

std::views::enumerate — iteration with an index

C++23 std::views::enumerate creates a lazy view that associates each range element with a zero-based index. It lets a loop access both the index and the element without maintaining a separate counter.

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

std::views::filter — lazy range filtering

std::views::filter creates a lazy view of elements satisfying a predicate. It does not build a separate result container and preserves the order of selected elements.

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

std::views::iota — a lazy sequence of successive values

std::views::iota creates a lazy view of values obtained by incrementing. The two-argument form excludes its end bound, while the one-argument form has no reachable end.

Basic · C++23 (repository compiler mode; displayed example verified by execution in an isolated environment)
C++

std::views::join — lazy range flattening

std::views::join creates a lazy view of elements from a range of ranges. It flattens one level, preserves order, and skips empty inner ranges without building a new container.

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

std::views::keys — a view of first elements

std::views::keys creates a lazy view of the index-0 elements in a range of pairs or tuples. It lets you traverse map keys, but also works with other compatible ranges without creating a separate collection of keys.

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

std::views::reverse — a range viewed in reverse order

std::views::reverse exposes a range's elements from last to first without rearranging the source. It requires a range that can be converted into a bidirectional view. If the view exposes mutable references, writing through them changes the original elements.

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

std::views::slide — sliding window view

C++23 std::views::slide creates a lazy view of consecutive, overlapping windows of length n. The windows refer to elements in the underlying range rather than forming separate containers. It requires at least a forward_range and n > 0.

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

std::views::split — split a range into subranges

std::views::split creates a view of parts separated by an element or pattern. Parts refer to the underlying data rather than becoming separate strings; adjacent and trailing delimiters can produce empty parts.

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