Latest Changes

The following noteworthy changes have been made:

2024 Mar 14Revision
21.11 -- Overloading typecastsRewrote section on when to use converting constructors vs overloaded typecasts. Also added a poem.
2024 Mar 7Revision
1.1 -- Statements and the structure of a programRevised section: Syntax and syntax errors
2024 Mar 5Revision
F.3 -- Constexpr functions (part 3) and constevalRevised section: Using consteval to make constexpr execute at compile-time
2024 Mar 4Revision
10.6 -- Explicit type conversion (casting) and static_castAdded section on Casting vs initializing a temporary object
2024 Mar 3Revision
10.1 -- Implicit type conversionAdded examples and a section on the standard conversions
2024 Mar 3Revision
2025 Feb 26Revision
4.1 -- Introduction to fundamental data typesRevised content re: integer vs integral types, added section on other sets of types
2025 Feb 17Revision
O.2 -- Bitwise operatorsAdded section on bitwise assignment operators
2025 Feb 13Revision
12.10 -- Pass by addressAdded content explaining why to avoid const pointer function parameters
2025 Feb 5Revision
8.8 -- Introduction to loops and while statementsAdded section: Unintentional infinite loops
2025 Jan 4Revision
5.6 -- Constexpr variablesAdded section: A brief introduction to constexpt functions
2024 Dec 28Revision
16.8 -- Range-based for loops (for-each)Added section: Range-based for loops and empty containers
2024 Dec 26Revision
16.2 -- Introduction to std::vector and list constructorsClarified that default initialization takes precedence over list initialization when initializer list is empty
2024 Dec 23Revision
14.12 -- Delegating constructorsRewrote section: Calling a constructor in the body of a function creates a temporary object
2024 Dec 20Revision
14.13 -- Temporary class objectsAdded optional section: Creating temporary objects via direct initialization
2024 Dec 19Revision
21.4 -- Overloading the I/O operatorsUpdates to partial extraction, semantically invalid values, and resetting objects to default on failure
2024 Dec 18Revision
10.9 -- Type deduction for functionsUpdates to return type deduction benefits and best practices
2024 Dec 11Revision
7.7 -- External linkage and variable forward declarationsAdded section: Avoid using `extern` on a non-const global variable with an initializer
2024 Dec 5Revision
8.2 -- If statements and blocksAdded section: if-else vs if-if
2024 Dec 2Revision
0.11 -- Configuring your compiler: Warning and error levelsRewrote some introductory text, noted that compilers have leeway to determine what is an error vs warning
2024 Nov 30Revision
4.6 -- Fixed-width integers and size_tAdded advanced note about the 8-bit fixed-width types
2024 Nov 26Revision
F.1 -- Constexpr functionsMoved constexpr functions into own chapter and split into multiple lessons
2024 Nov 24Revision
4.8 -- Floating point numbersRevisions to improve clarity and technical accuracy
2024 Nov 24Revision
4.11 -- CharsAdded section: Extracting whitespace characters
2024 Nov 21Revision
4.6 -- Fixed-width integers and size_tRevised lesson content. Added examples and reordered some sections
2024 Oct 28Revision
12.6 -- Pass by const lvalue referenceRevised content around when to use pass by value vs pass by (const) reference
2024 Oct 22Revision
2024 Oct 22Revision
5.4 -- The as-if rule and compile-time optimizationMoved and rewrote content from the following lesson
2024 Oct 19Revision
16.3 -- std::vector and the unsigned length and subscript problemAdded a neat workaround to index std::vector with signed indices
2024 Oct 11Revision
12.2 -- Value categories (lvalues and rvalues)Added method to determine whether expression is lvalue or rvalue
2024 Oct 11Revision
12.4 -- Lvalue references to constAdded warning and example exhibiting behavior to avoid
2024 Oct 11Revision
12.3 -- Lvalue referencesClarified what applies to non-const lvalue references, all lvalue references, and all references
2024 Oct 6Revision
9.5 -- std::cin and handling invalid inputRefactored section: Checking for EOF
2024 Oct 4Revision
14.13 -- Temporary class objectsAdded section: static_cast vs explicit instantiation of a temporary object
2024 Sep 30Revision
14.17 -- Constexpr aggregates and classesAdded more examples and discussion around const/constexpr objects and functions
2024 Sep 29Revision
14.10 -- Constructor member initializer listsAdded two sections discussing when constructors fail
2024 Sep 29Revision
12.8 -- Null pointersAdded a joke to the lesson
2024 Sep 29Revision
5.1 -- Constant variables (named constants)Added a joke to the optional reading section at the bottom of the lesson
2024 Sep 26Revision
8.5 -- Switch statement basicsAdded section: Switch vs if-else
2024 Sep 23Revision
11.8 -- Function templates with multiple template typesRevised section: Function templates with multiple template type parameters
2024 Sep 23Revision
10.9 -- Type deduction for functionsSeparated benefits and downsides and added more of them
2024 Sep 23Revision
10.5 -- Arithmetic conversionsAdded section: std::common_type and std::common_type_t
2024 Sep 20Revision
10.8 -- Type deduction for objects using the auto keywordClarified some type deduction cases with const and constexpr
2024 Sep 20Revision
5.1 -- Constant variables (named constants)Clarified that const is part of the type of an object
2024 Sep 17Revision