C++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 attestedC++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 attestedC++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 attestedC++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 attestedC++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 attestedC++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 attestedC++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 attestedC++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 attestedC++std::max_element searches a range and returns an iterator to its first largest element. An empty range yields last; an optional comparator determines the ordering.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::memcpy from <cstring> copies a specified number of bytes between non-overlapping memory regions. It does not check bounds and is not a replacement for copying resource-owning objects.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::memory_order from <atomic> specifies ordering and synchronization for atomic operations. It distinguishes atomicity alone from safely publishing data between threads; incorrectly weakening an order can introduce a data race.
Advanced · C++23; repository compiler flag, production runtime not attestedC++std::merge from <algorithm> copies two sorted ranges into a separate output range. It preserves duplicates and stability, and returns an iterator one past the last element written.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::min from <algorithm> selects the smaller of two arguments or the minimum of a nonempty list. The two-argument overload returns a reference, while the list overload returns a copy; an optional comparator defines the ordering.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::min_element from <algorithm> returns an iterator to the first smallest element in a range. It does not sort the data. For an empty range it returns last, so check the iterator before reading the result.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::minmax from <algorithm> finds the minimum and maximum together. The two-argument overload returns a pair of references, whereas the initializer-list overload returns a pair of copied values.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::minmax_element finds a range's minimum and maximum and returns a pair of iterators. Ties select the first minimum and last maximum; an empty range requires checking the result before dereferencing.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::move from <utility> exposes an object as an xvalue, enabling selection of a move operation. The call itself neither transfers resources nor empties the object; the actual effect depends on the operation that consumes its result.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::move_backward assigns range elements from last to first while preserving their order in the destination. It supports safely shifting an overlapping range to the right.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++C++23 std::move_only_function stores a callable with a specified signature, including a lambda owning an exclusive resource. The wrapper can be moved but not copied. It must contain a target before it is called.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::multimap from <map> stores key–value pairs in key order and allows multiple elements with equivalent keys. equal_range retrieves the entire matching group, while erase(key) removes every element in that group.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::multiset from <set> stores keys in comparator-defined order and permits equivalent keys. Learn how lookup and counting work, and distinguish removing one element from removing every equivalent element.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::mutex from <mutex> allows only one thread at a time to own its lock. It protects shared data when all conflicting accesses follow the same locking protocol. std::lock_guard manages lock release within a scope.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++std::nano is a type alias from <ratio> representing the exact factor 1/1,000,000,000. It exposes the numerator num and denominator den as compile-time constants; it is neither a floating-point number nor a unit of time.
Basic · C++23; repository compiler flag, production runtime not attestedC++std::next from <iterator> returns a copy of an iterator advanced by n positions, defaulting to one. It also supports iterators without operator +. It does not check range boundaries; a negative offset requires a bidirectional iterator.
Basic · C++23; repository compiler flag, production runtime not attested