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++

SFINAE — substitution failure versus a compilation error

SFINAE allows a template overload to be discarded when argument substitution produces an invalid type or expression in the immediate context. It does not hide arbitrary template errors.

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

Sorting, comparisons, and search ranges

Correct sorting requires a comparator that defines a strict weak ordering. Binary search requires a range partitioned for the relevant condition; sorting the entire range is sufficient but not always necessary.

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

Strings and text: code units, code points, and grapheme clusters

A C++ string stores elements, not ready-made user-visible characters. Learn the distinction between UTF-8 code units, Unicode code points, and grapheme clusters, and understand the roles of std::u8string and a u8 string literal.

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

Templates and concepts: constrained template parameter

Templates describe families of functions or types, while concepts state requirements on template arguments. The declaration template<Integer T> introduces a type parameter T constrained by Integer<T>, checked during compilation rather than at runtime.

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

Testing and assertions

Tests compare program behavior with expectations, while assertions express conditions that should hold. Learn property-based testing, idempotence, and a deterministic test corpus, plus the distinction between assert, static_assert, and checks that remain active when NDEBUG is defined.

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

Dates and time with std::chrono

std::chrono separates durations, time points, and calendar dates. Learn the %F and %R formats and the distinction between a fixed UTC offset and a named time zone.

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

Translation units, linkage, and the ODR

Translation units let parts of a program be translated separately. Linkage determines name identity across declarations, while the ODR constrains the number and form of definitions. Distinguishing these concepts helps you split code correctly between headers and implementation files.

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

Type conversion

Type conversion adapts an expression to a required type. Learn implicit conversions, explicit static_cast conversions, integral promotions, and discarding a value with a cast to void.

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

Type system

The C++ type system defines the types of objects, references, functions, and expressions, together with permitted operations and conversions. Typing is static: auto deduces a type but does not let a variable change type later. Implicit conversions may be allowed even when they risk losing information.

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

User-defined literals

A user-defined literal combines a numeric, character, or string literal with a custom suffix. Its literal operator turns that spelling into a value, such as an object representing a distance.

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

Value categories and move semantics

The categories lvalue, prvalue, and xvalue describe expressions, not kinds of variables. Learn their glvalue and rvalue groupings and how they relate to references, overload selection, and std::move, which does not itself transfer resources.

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

Variables in C++

A variable lets a program store and refer to data of a particular type. Learn declarations, initialization, assignment, the roles of auto and const, and the distinction between a name's scope and an object's lifetime.

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

Algorithm execution-policy constants

The objects std::execution::seq, std::execution::par, std::execution::par_unseq and std::execution::unseq specify how an algorithm is permitted to execute. They do not guarantee a speedup; choosing a policy also changes the requirements on functions that process elements.

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

INT_MAX — the largest int value

The INT_MAX macro from <climits> specifies the largest int value for an implementation. Use it instead of hard-coding the limit, and check it before incrementing a value to avoid overflow.

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

Atomic memory orders

Constants of type std::memory_order control synchronization and ordering for atomic operations. Learn how relaxed, release, acquire, acq_rel, and seq_cst differ, and how an atomic flag can safely publish ordinary data.

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

std::ignore — skipping elements during tuple assignment

std::ignore is a standard-library object used with std::tie to skip selected elements during tuple assignment. It lets you store the values you need in existing variables without creating a dummy variable for the skipped element.

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

Aligned allocation overload matching

Learn how C++23 selects class-specific `operator new` and `operator delete` overloads and why the paired global calls must receive the same alignment value.

Advanced · ISO C++23; implementation support may vary
C++

The C++ array declarator (`[]`)

The `[]` declarator forms a built-in array type. The bound can be part of the array type, but array syntax in a function parameter does not pass a length.

Advanced · ISO C++23; implementation support may vary
C++

Array of structures (AoS) in C++

AoS stores complete records side by side, whereas SoA groups each field into its own array. Which layout fits depends on how the program accesses the data.

Advanced · ISO C++23; implementation support may vary
C++

assert and NDEBUG: runtime checks you can disable

`assert` checks an internal program assumption at runtime. Defining `NDEBUG` can disable the check without evaluating its condition; it does not affect `static_assert`.

Intermediate · ISO C++23; implementation support may vary
C++

Automatic storage duration versus dynamic allocation

Distinguish an object’s storage duration and lifetime from any separate allocations made by its members, such as storage for a `std::string`’s characters.

Advanced · ISO C++23; implementation support may vary
C++

Cache locality in C++: AoS and SoA

Choose a data layout based on what the program actually reads. AoS groups the fields of a record; SoA groups values of the same field across records.

Advanced · ISO C++23; implementation support may vary
C++

Capture by copy in C++ lambdas

Capture a threshold by value so the predicate keeps using it even when the original variable changes.

Advanced · ISO C++23; implementation support may vary