Filesystem and virtual filesystem
std::filesystem provides paths and filesystem operations. Distinguish a pathname from an existing file, and this library from a VFS: C++23 does not define a standard interface for plugging in custom filesystems.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
std::filesystem provides paths and filesystem operations. Distinguish a pathname from an existing file, and this library from a VFS: C++23 does not define a standard interface for plugging in custom filesystems.
Combine std::views::filter and std::views::transform to select range elements and compute new values. The pipeline creates a lazy view rather than a ready-made container of results.
A finite-state machine (FSM) describes behavior using a finite set of states and event-driven transitions. In C++, enum class and a transition function can represent the model while making each next-state rule explicit.
A function describes an operation called with arguments. Learn the difference between declarations and definitions, parameters and arguments, and passing by value versus passing by reference.
Input/output transfers data, while serialization defines its representation. Learn how to encode an integer in little-endian order, decode it safely, and supplement round-trip validation with a known-byte check.
The iterator pair first and last describes [first, last): the beginning is included and the end is excluded. The std::vector range constructor constructs elements from that range; equal boundaries describe an empty range.
An iterator describes a position and how to traverse a sequence, while a generator produces its elements on demand. Learn about half-open ranges, sentinels, iterator categories, and the single-pass std::generator from C++23.
Linear search checks successive elements without requiring sorting. In C++, std::find returns an iterator to the first match or the end iterator.
Loops repeat statements. Learn the differences between while, do ... while, classic for, and range-based for, and how break, continue, and references affect iteration.
Separate storage from the object living in it and from responsibility for a resource. Understand automatic and dynamic storage duration, copy semantics, placement new, explicit destruction, and strict-aliasing restrictions.
A named module groups translation units and exposes declarations through export. import lets clients use its interface without textually including a file. The module boundary separates API from implementation, but is neither a security boundary nor a separate namespace.
A node handle owns an element extracted from an associative container. It lets you modify its key and transfer the node to a compatible container without copying or moving the element itself. Correct use requires checking emptiness, allocator compatibility, and insertion results.
Numeric types determine how values are represented and calculations behave. Learn the division into integral and floating-point types, the difference between signed and unsigned, and how conversions affect division and information loss.
An object has a type, storage, and a lifetime; it can contain member and base-class subobjects. Composition connects objects through members, while inheritance enables a shared interface. The language determines initialization and destruction order.
Pools and arenas manage storage, but an address does not establish object identity. Reusing a slot can leave a pointer without a live target or make it refer to a different object. Distinguish storage duration, object lifetime, and application-level handle validity.
Complexity describes how cost grows with input size, not a number of milliseconds. AoS and SoA layouts can have the same complexity while using caches differently. Choosing between them requires measurements for the actual access pattern.
In a hosted environment, the global-scope main function is the entry point of a C++ program. It returns int, can receive startup arguments, and supplies the termination status.
RAII ties resource management to an object's lifetime: initialization establishes ownership, and the destructor releases the resource. A correctly designed owner therefore also performs cleanup during exception-driven stack unwinding.
A range exposes elements through a beginning iterator and an end sentinel. A view is a range with additional requirements that make it useful for building pipelines. The std::views::filter and std::views::transform adaptors select and transform elements without creating an intermediate result container.
A record groups named fields, usually in a struct. An aggregate is a formal C++ category that allows element initialization without a user-declared constructor. Not every struct is an aggregate.
Recursion means a function calls itself, directly or through other functions. For the computation to terminate, it needs a reachable base case and recursive steps that make progress toward that case.
A reduction combines a range into one result. Learn how std::accumulate, std::reduce, and std::transform_reduce differ, and calculate a mean and variance while accounting for accumulator types and operation order.
Scope determines the context for name lookup in source code, while lifetime describes an object's existence during execution. Hiding a name does not destroy its object. Storage duration is a separate, related concept.
A security boundary separates data or code with different levels of trust. In C++, private access control must not be confused with execution isolation: validating data before use is a separate responsibility, and undefined behavior does not guarantee safe program termination.