C++ Bites: Glossary

keywords and terms

Generated with ChatGPT 4o
Term Definition
Abstract ClassA class containing at least one pure virtual function. Cannot be instantiated directly.
Access Specifierpublic, protected, or private keyword controlling member visibility within and outside a class.
AggregateA class or struct with no user-declared constructors, no private/protected non-static data members, no base classes, and no virtual functions; supports brace initialization.
AlgorithmA generic function in <algorithm> operating on iterator ranges (e.g., std::sort, std::find).
Associative ContainerSTL containers providing key-based O(log n) or O(1) lookup: map, set, unordered_map, unordered_set.
ClassA user-defined type that encapsulates data and functions. Supports inheritance and polymorphism.
CompositionA class that contains instances of other classes as members, modeling a "has-a" relationship.
ConceptA named constraint (C++20) specifying requirements on template type parameters, checked at compile time.
constQualifier making a variable, parameter, or member function read-only; enforced at compile time.
ConstructorA special class method automatically called when an object is created. Initializes the object.
Container AdapterA class template wrapping a sequential container to provide a restricted interface: stack, queue, priority_queue.
Copy ConstructorCreates a new object as a copy of an existing one. Signature: ClassName(const ClassName&).
Default ConstructorA constructor taking no arguments; generated by the compiler if no constructors are declared.
Deleted FunctionA constructor, operator, or function explicitly removed from the class interface using = delete.
DestructorA special method automatically called when an object goes out of scope. Used to release resources.
dynamic_castRuntime-checked downcast for polymorphic types; returns nullptr on pointer failure or throws std::bad_cast on reference failure.
EncapsulationCombining data and methods into a single unit (class) and restricting access using access specifiers.
Fold ExpressionC++17 syntax applying a binary operator across all elements of a parameter pack in a single expression.
FriendAllows external functions or classes to access private or protected members of another class.
Function OverloadingDefining multiple functions with the same name but different parameter types or counts.
Function PointerA pointer to a function; declared as RetType (*name)(params), used for callbacks and dispatch tables.
FunctorA class with operator(), making its instances callable like functions; stateful alternative to function pointers.
Header FileA file (typically .h or .hpp) containing declarations of functions, classes, etc.
HeapMemory region for dynamically allocated objects (via new and delete).
if constexprCompile-time conditional that discards the untaken branch during template instantiation, preventing compilation of invalid code paths.
InheritanceMechanism where a class (derived) inherits members from another class (base).
Inline FunctionA function suggested to be expanded in-place by the compiler to reduce function call overhead.
IteratorAn object that points into a container and supports increment (++) and dereference (*) operations.
LambdaAn anonymous function defined using [] syntax, often used in STL algorithms.
Move AssignmentTransfers ownership of resources from a temporary (rvalue) to an existing object via operator=(T&&).
Move ConstructorConstructs a new object by transferring resources from an rvalue, leaving the source in a valid but unspecified state.
NamespaceA way to group related code and avoid name collisions.
ObjectAn instance of a class, representing a data structure with behavior.
Operator OverloadingDefining custom behavior for operators (e.g., +, <<) for user-defined types.
OverrideKeyword marking a virtual member function as explicitly overriding a base class virtual; compile error if the signature doesn't match.
Parameter PackA template parameter representing zero or more types or values, declared and expanded with ....
PointerA variable that stores the address of another variable or object.
PolymorphismThe ability of objects to behave differently based on their dynamic type (usually via virtual functions).
Pure Virtual FunctionA virtual function declared with = 0; makes the class abstract and requires derived classes to provide an implementation.
RAIIResource Acquisition Is Initialization – a technique where resources are tied to object lifetime.
ReferenceAn alias for another variable, declared using &.
Rule of ThreeIf you explicitly define any of destructor, copy constructor, or copy assignment operator, define all three.
Rvalue ReferenceT&& syntax that binds to temporaries, enabling move semantics and perfect forwarding.
ScopeThe region of code in which a name is visible; determined by blocks {}, namespaces, classes, and function boundaries.
Sequential ContainerSTL containers maintaining element insertion order: vector, deque, list, forward_list.
Smart PointerClasses like std::unique_ptr or std::shared_ptr that manage object lifetime automatically.
StackMemory region for local variables with automatic lifetime and fast allocation/deallocation.
STL (Standard Template Library)A collection of generic containers, algorithms, and iterators.
StreamAbstraction for sequential character I/O; the base hierarchy is rooted at std::ios_base.
TemplateA feature allowing generic programming by defining functions or classes with type parameters.
Template MetaprogrammingUsing template instantiation to perform computation at compile time, producing types or constant values.
Template SpecializationA concrete implementation of a function or class template for a specific type, overriding the generic version.
Translation UnitA source file (.cpp) together with all its transitively included headers; the fundamental unit of compilation.
Type CoercionImplicit conversion of a value from one type to another performed automatically by the compiler.
Value SemanticsObjects behave like values: copying produces an independent duplicate; distinct from reference semantics.
Variadic TemplateA template accepting a variable number of type parameters via the ... pack syntax.
Virtual FunctionA member function that can be overridden in derived classes, enabling dynamic dispatch.