What you will learn in Learn C++ by Example
Covers versions 11 to 23
Chapter by chapter
Concepts explained in this book
- vectorstd::vector is the C++ standard library's dynamically sized contiguous sequence container.
- autoAuto type deduction is the C++ language feature that lets the compiler infer a variable's type from its initializer.
- operator[]The subscript operator is an indexing operator that accesses an element associated with a subscript expression and may insert a value for certain containers.
- time_pointstd::chrono::time_point is a class template representing a point in time relative to a clock's epoch using a duration.
- special member functionA special member function is one of the compiler-recognized constructors, destructor, copy operations, or move operations that govern object initialization, copying, moving, and destruction.
- cardA card is a playing-card entity with properties such as rank and suit that can participate in a card game.
- unordered_mapunordered_map is an unordered associative container that stores key-value pairs and supports lookup by key.
- parameter packA parameter pack is a template parameter or function parameter representing zero or more arguments of potentially varying types.
- probability distributionA random number distribution is a rule or library component that produces values according to a specified probability distribution.
- ranges API<ranges> is the C++ standard library header that declares ranges, views, and range adaptors.
- variadic templateA variadic template is a template containing at least one parameter pack and therefore capable of accepting a variable number of template arguments.
- coroutineA coroutine is a function whose execution can be suspended and resumed while preserving its state.
- unordered associative containerAn unordered container is a container whose elements are organized without a sequence-based ordering, commonly using hashing for associative lookup.
- coroutine taskA coroutine task is a user-defined return type that packages the state and operations needed to manage a coroutine's suspension, resumption, yields, and completion.
- invocableinvocable is a C++ standard concept requiring that a callable object can be invoked with a specified set of arguments.
- structured bindingA structured binding is C++ declaration syntax that introduces names referring to elements of an aggregate, tuple-like object, or pair.
- smart pointerA smart pointer is a C++ library type that manages an object pointer and can automate ownership and storage cleanup.
- year_month_dayyear_month_day is a C++ chrono calendar type representing a calendar date composed of a year, month, and day.
- rule of zeroThe rule of zero is a C++ design guideline in which a class declares none of the special member functions so the compiler can provide appropriate defaults.
- class template argument deductionClass template argument deduction is a C++ feature that deduces template arguments from a class template's construction arguments.
- virtual methodA virtual function is a C++ member function whose implementation can be selected according to the object's dynamic type through polymorphic dispatch.
- deckA deck is an ordered collection of playing cards from which cards can be drawn or shuffled.
- std::multimapstd::multimap is a C++ standard library associative container that stores key-value pairs while allowing multiple elements with the same key.
- state tableA state table is a table that associates a finite game-history state with recorded outcomes or predictions.
- triangle numberA triangle number is a number in the sequence formed by summing the positive integers from one through its position.
- ratioA ratio is a C++ standard library class template representing a rational number with compile-time numerator and denominator values.
- initializer listAn initializer list is a brace-enclosed sequence of initial values used to initialize an object or pass initialization values to a construct.
- std::unique_ptrstd::unique_ptr is a C++ standard library smart pointer that exclusively owns a dynamically allocated object and destroys it when ownership ends.
- undefined behaviorUndefined behavior is program execution for which the C++ language imposes no requirements on the result.
- std::hashstd::hash is a C++ standard library class template that produces hash values for objects of a specified type.
- uniform initializationBrace initialization is C++ initialization syntax that uses braces to initialize objects and values.
- duration_castduration_cast is a C++ chrono conversion function template that explicitly converts one duration type to another, truncating when the target period cannot represent the full precision.
- Pascal's trianglePascal’s triangle is a triangular arrangement of numbers in which each interior entry is the sum of the two entries above it and the n-th row contains n numbers.
- templateA C++ template is a parameterized declaration from which the compiler can generate functions, classes, or other code for specified types or values.
- promise_typeA promise type is a compiler-recognized coroutine type that defines how coroutine results, suspension, resumption, and completion are handled.
- matching penniesMatching pennies is a two-player game in which each player independently chooses heads or tails and the outcome depends on whether the choices match.
- polymorphismPolymorphism is the ability to invoke a common interface while allowing the actual object's type to determine the implementation.
- all_ofall_of is a C++ standard algorithm that tests whether a unary predicate is true for every element in a sequence or range.
- using keywordA using statement is C++ syntax that introduces a name or defines an alias for a type or declaration.
- constexprconstexpr is a C++ specifier for variables and functions that permits evaluation at compile time when their initialization or arguments satisfy the required constant-expression rules.
- suitA suit is one of the four categories that classify playing cards in a standard deck.
- aggregate initializationAggregate initialization initializes an aggregate object from a brace-enclosed sequence of initializers for its elements or members.
- co_yieldco_yield is a C++ coroutine expression that suspends execution while producing a value to the coroutine's consumer.
- <algorithm><algorithm> is the C++ standard library header that declares general-purpose algorithms for operating on sequences and ranges.
- move assignment operatorA move assignment operator is a class member function that replaces an object's state by transferring resources from another object, typically an rvalue.
- std::functionstd::function is a C++ standard library polymorphic function wrapper that can store and invoke callable objects with a specified signature.
- emplace_backemplace_back is a C++ sequence-container member function that constructs and appends an element at the container's end.
- push_backpush_back is a C++ sequence-container member function that appends an element to the container.
- system_clockThe system clock is a clock representing system-wide calendar time that can move backward when the system time is adjusted.
- pipe operatorThe pipe operator is the operator used in C++ ranges expressions to compose a range with a view adaptor or transformation.
- conceptA C++ concept is a compile-time constraint that specifies requirements a type or expression must satisfy.
- std::visitstd::visit is a C++ standard library function template that invokes a callable with the currently held alternative of one or more std::variant objects.
- unsigned integerAn unsigned integer is an integer type representing only nonnegative values within a fixed range using unsigned arithmetic.
- drop_whiledrop_while is a range adaptor that skips an initial sequence of elements while a predicate is true.
- remove_ifremove_if is a C++ standard algorithm that rearranges elements according to a predicate and returns an iterator marking the resulting logical end.
- transformstd::transform is a C++ standard-library algorithm that applies a unary or binary operation to input elements and stores the resulting values in an output range.
- pure virtual member functionA pure virtual function is a virtual member function declared without an implementation requirement in its declaring class, making that class abstract unless overridden.
- big fiveThe rule of five is a C++ design guideline that a class managing resources and declaring one relevant special member function should explicitly consider all five copy and move special member functions.
- co_returnco_return is a C++ coroutine statement that completes a coroutine and supplies its final result or completion signal.
- random number engineA random number engine is a pseudorandom generator component that produces a deterministic sequence from an internal state and algorithm.
- operator>>The stream extraction operator reads formatted data from an input stream into objects supplied as operands.
- type_traits headerThe type_traits header is the C++ standard library header that declares compile-time type property queries and transformations.
- std::string_viewstd::string_view is a non-owning C++ standard library view over a contiguous sequence of characters.
- c++ standardA C++ standard is a formally ratified specification defining the language and its standard library for a particular version.
- resource acquisition is initializationResource acquisition is initialization is a C++ resource-management technique that acquires a resource during object construction and releases it during object destruction.
- std::views::zipstd::views::zip is a C++23 range adaptor that produces a view of tuples containing corresponding elements from multiple input ranges.
- big threeThe rule of three is a C++ resource-management guideline stating that a class defining a destructor, copy constructor, or copy assignment operator will generally need to define all three.
- is_constructibleis_constructible is a C++ type trait that determines whether a type can be constructed from a specified set of argument types.
- is_move_assignableis_move_assignable is a C++ type trait that determines whether an object of a type can be assigned from an rvalue of that type.
- is_move_constructibleis_move_constructible is a C++ type trait that determines whether a type can be constructed from an rvalue of the same type.
- move special member functionA move special member function is a move constructor or move assignment operator that transfers resources from another object.
- type-trait variable templateA type-trait variable template is a C++17 shorthand variable template exposing the Boolean value of a corresponding type trait.
- requirementsIn C++ generic programming, requirements are constraints describing the operations and properties that a type or expression must satisfy.
- function templateA function template is a parameterized function definition from which functions for specific template arguments can be generated.
- std::chrono::durationstd::chrono::milliseconds is a C++ chrono duration type whose period is one millisecond.
- std::chrono::minutesA chrono minute is a standard duration type representing a time interval measured in minutes.
- coroutine handlestd::coroutine_handle is the C++ standard-library type that provides access to coroutine execution and destruction operations.
- Long literalA literal suffix is a token appended to a literal to determine or customize the type or interpretation of its value.
- as-if ruleThe as-if rule permits a C++ implementation to transform or remove instructions provided the program's observable behavior is unchanged.
- requires clauseA requires clause is C++ syntax that constrains a declaration or definition with compile-time requirements.
- std::movestd::move is a C++ standard library utility that casts an expression to an rvalue reference to enable moving from it.
- time zoneA time zone is a geographic or rule-defined region whose local civil time is determined by a particular offset and calendar-time rules.
- logarithmic time complexityLogarithmic complexity is an algorithmic growth rate proportional to the logarithm of the number of input elements, commonly expressed as O(log(n)).
- substringA substring is a contiguous sequence of characters taken from a string.
- std::getstd::get is a C++ standard library function template that retrieves an element from a tuple or another supported tuple-like object by index or type.
- associative containerAn associative container is a data structure that organizes elements by keys or ordered values rather than by positional indexes.
- whole value idiomThe whole value idiom represents a meaningful quantity, including its associated semantics or unit, with a lightweight type rather than a bare primitive value.
- getlinestd::getline is a C++ standard library function that extracts characters from an input stream into a string until a delimiter is encountered.
- std::chrono::daysstd::chrono::days is a C++ chrono duration type representing a 24-hour day.
- rvalueAn rvalue is an expression category representing a value that is generally suitable for moving or binding to an rvalue reference.
- equal_rangeequal_range is a container member function or standard algorithm that returns the pair of positions delimiting elements equivalent to a specified value.
- lower_boundlower_bound is a map member function or standard algorithm that returns the first position whose element is greater than or equal to a specified value.
- upper_boundAn upper bound operation returns an iterator to the first element in an ordered range whose key is greater than a specified key.
- sys_timesys_time is a chrono time representation based on system time and suitable for measuring physical elapsed time across civil-time changes.
- arrayAn array is a fixed-size sequence of elements stored in contiguous positions and accessed by index.
- normal distributionThe normal distribution is a continuous probability distribution characterized by a symmetric bell-shaped density determined by its mean and standard deviation.
- trailing return typeA trailing return type is C++ syntax that places a function's return type after its parameter list using an arrow.
- balanced binary treeA balanced binary tree is a binary tree whose height is kept sufficiently even across branches to support efficient operations.
- binary search treeA binary search tree is a binary tree whose nodes are ordered so smaller elements lie to the left and larger elements lie to the right.
- binary treeA binary tree is a tree data structure in which each node has at most two child branches.
- linear time complexityLinear complexity is an algorithmic growth rate proportional to the number of input elements, commonly expressed as O(n).
- overload helperAn overload helper is a class template that combines call operators from multiple lambda or callable base objects into one callable object.
- deduction guideA deduction guide is a declaration that specifies how class template argument deduction interprets constructor arguments.
- lvalueAn lvalue is a C++ expression category associated with an identifiable object that has a persistent location.
- move constructorA move constructor is a constructor that initializes an object by taking ownership of resources from another object, typically an rvalue.
- perfect forwardingPerfect forwarding is a C++ technique for passing arguments through a wrapper while preserving their original value categories and cv-ref qualifiers.
- rvalue referenceAn rvalue reference is a C++ reference type, written with &&, that can bind to an rvalue.
- virtual destructorA virtual destructor is a destructor declared virtual so that deleting an object through a base-class pointer invokes the appropriate derived-class destructor.
- Mersenne Twistermt19937 is a C++ standard library pseudorandom number engine implementing the Mersenne Twister algorithm with a period of 2^19937−1.
- std::equal_tostd::equal_to is a C++ standard library function-object template that compares two values for equality.
- prime numberA prime number is a positive integer greater than one that has no positive divisors other than one and itself.
- digitA digit is a single numerical symbol used to represent a place in a positional numeral system.
- mind readerA mind reader is a game component that predicts a player's next binary choice from the player's previous choices and game state.
- has_valuehas_value is an optional member function that reports whether an optional currently contains a value.
- valuevalue is an optional member function that accesses the contained object and throws when no value is present.
- fmtfmt is an open-source C++ formatting library that provides format-string-based text formatting facilities.
- nested replacement fieldA nested replacement field is a replacement field embedded within another replacement field to supply a formatting value dynamically.
- range-based for loopA range-based for loop iterates over the elements of a range or container without explicit iterator management.
- clueA clue is a feedback string that marks guessed digits as correctly placed, misplaced, or absent from a hidden number.
- if statement with initializerAn if statement with an initializer combines a local initialization and a conditional test in one statement, limiting the initialized name's scope to the statement.
- callableA callable is a function or function-like object that can be invoked with a specified argument list.
- std::random_devicestd::random_device is a C++ standard library generator interface that supplies nondeterministic random values when supported by the implementation.
- closureA closure is a callable object that packages executable code with captured values from an enclosing scope.
- back_inserterback_inserter is a C++ standard-library function that creates an output iterator which appends assigned values to a container.
- even numberAn even number is an integer divisible by two without a remainder.
- odd integerAn odd number is an integer that is not evenly divisible by two.
- parityParity is the classification of an integer as odd or even.
- atat is a map member function that accesses the value for a key without inserting a missing entry and throws std::out_of_range if the key is absent.
- fold expressionA fold expression is a C++ expression that applies an operator across the elements of a parameter pack.
- unary foldA unary fold is a fold expression that combines a parameter pack with an operator without an explicit initial value.
- type traitA type trait is a compile-time facility that exposes a property or transformation of a C++ type.
- ratio headerThe ratio header is the C++ standard library header that declares compile-time rational arithmetic facilities such as std::ratio and ratio_multiply.
- digit separatorA digit separator is a source-code character that visually groups digits within a numeric literal without changing its value.
- operator""hoperator""h is the C++ chrono user-defined literal operator that converts a numeric literal with the h suffix to an hours duration.
- user-defined literalA user-defined literal is a literal whose suffix invokes a programmer-defined or library-provided literal operator to produce a specified type.
- std::chrono::hoursstd::chrono::hours is a C++ chrono duration type whose period is one hour.
- ratio_multiplyratio_multiply is a C++ type trait that computes the compile-time product of two rational ratio types.
- type aliasA type alias is a declaration that gives an existing type an alternative name.
- random numberA random number is a value generated by a process intended to provide unpredictable or pseudorandom outcomes according to a specified domain.
- finalThe final specifier is a C++ specifier that prevents a virtual function from being overridden or a class from being used as a base class.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
