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::ios_base::sync_with_stdio — synchronizing C++ and C streams

std::ios_base::sync_with_stdio controls synchronization between the standard C++ streams and C library streams. Calling it with false allows them to operate independently; the function returns the previous state, not a success indicator.

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

std::isalpha — checking whether a character is a letter

std::isalpha from <cctype> checks whether a value represents a letter under the current C locale. It returns int: zero or a nonzero value. To classify a char value, convert it to unsigned char and pass the result only if it fits in int.

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

std::is_convertible — testing implicit conversion

std::is_convertible checks at compile time whether From can be implicitly converted to To. std::is_convertible_v exposes the same bool value without ::value; success does not guarantee value preservation or freedom from exceptions.

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

std::isdigit — checking for digits

std::isdigit from <cctype> checks whether a character is a decimal digit. It returns int, not bool. After converting a character to unsigned char, the resulting value must fit in int.

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

std::is_heap — checking the heap property

std::is_heap checks whether a range satisfies the heap property without changing its elements. By default it recognizes a max-heap; a custom comparator lets you check another ordering, such as a min-heap.

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

std::is_nothrow_copy_constructible — non-throwing copy construction

This <type_traits> trait checks at compile time whether constructing T from const T& is valid and known not to throw. std::is_nothrow_copy_constructible<T>::value and std::is_nothrow_copy_constructible_v<T> expose the same bool result.

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

std::is_nothrow_destructible — checking non-throwing destruction

A <type_traits> trait that checks at compile time whether destruction is valid and cannot propagate an exception. std::is_nothrow_destructible<T>::value and std::is_nothrow_destructible_v<T> expose the same bool result.

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