From Jason Turner
Showing 504 of 504 episodes
Tags:

This episode extends the previous episode's NTTP bind concept by implementing a custom bind_front that accepts multiple compile-time parameters, not...

c++26 zero-cost lambdas nttp optimization metaprogramming

This episode explores C++26's enhancement to std::bind_front and std::bind_back that allows passing functions as non-type template parameters (NTTP)...

c++26 bind_front nttp optimization zero-overhead

This episode showcases the most practical application of C++26 reflection: automatic binding of C++ functions to scripting interfaces. Jason...

c++26 reflection scripting metaprogramming automation

This episode explores C++26's expansion statements (template for), a powerful new feature that enables compile-time iteration over heterogeneous...

c++26 template for expansion statements metaprogramming constexpr tuple +1 more

Ep 502: Simple Reflection For C++20

2025-10-13 5:36 10,521 2 std links

This episode demonstrates a basic reflection technique achievable in C++20 using structured bindings and template metaprogramming. Jason creates a...

c++20 reflection structured-bindings metaprogramming visitor-pattern

Ep 501: Does C++26 Solve the constexpr Problem?

2025-10-06 11:31 9,693 3 std links

This episode examines C++26's define_static_string and define_static_array features (from paper P3491R3) that finally solve a long-standing problem:...

c++26 constexpr reflection define_static_string compile-time

Ep 500: The Show's Half Over!

2025-09-29 9:01 6,473

In this milestone 500th episode, Jason reflects on C++ Weekly's journey since March 7, 2016, having never missed a single week. He announces plans to...

milestone channel-news programming-puzzles education sustainability

This episode explores GCC's built-in stack usage analysis tools, which are invaluable for embedded development and resource-constrained environments....

gcc stack-usage embedded optimization compiler-explorer

Ep 498: Lifetimes of Local Variables

2025-09-15 7:59 6,680 2 std links

Jason explains the lifetime rules for automatic (lexically scoped) variables in C++, demonstrating that lifetime begins at declaration and ends at...

object lifetime RAII scope fundamentals destructors

Jason provides practical guidance for incrementally adding compiler warnings and static analysis to legacy codebases without being overwhelmed. He...

static analysis compiler warnings legacy code best practices code quality

Ep 496: Stack vs Heap

2025-09-01 9:12 9,143 1 std links

Jason explains the fundamental differences between stack and heap memory allocation, noting that while the C++ standard doesn't explicitly define...

stack heap memory performance optimization fundamentals

Ep 495: Custom Formatters for std::Format

2025-08-25 3:45 3,951 16 std links

Jason provides a quick introduction to creating custom formatters for std::format and std::print in C++20/23. He demonstrates the simplest possible...

c++20 c++23 std::format std::print custom formatters constexpr

Ep 494: Tool Spotlight: Modern Safe scanf: scnlib

2025-08-18 4:57 4,425 2 std links

Jason showcases scnlib, a modern and safe replacement for scanf that provides format-based parsing similar to how lib{fmt} provides formatting. The...

scnlib parsing type safety scanf standard library P1729

Jason demonstrates how to quickly get started with GUI development in C++ using the FLTK (Fast Light Toolkit) library and his cmake_template project....

fltk gui cmake cpm cross-platform sanitizers +1 more

Ep 492: initializer_list Constructors

2025-08-04 8:21 8,826 3 std links

Jason explains the subtle but important differences between braced and parenthesized initialization when initializer_list constructors are present....

c++11 initializer_list constructors uniform initialization best practices

Jason demonstrates C++17's node handle feature that allows efficient transfer of elements between associative containers (map, set, and their...

c++17 node handles extract merge performance containers +1 more

Ep 490: std::ignore vs _ vs [[maybe_unused]]

2025-07-21 7:04 13,029 3 std links

Jason compares three approaches for explicitly ignoring return values from [[nodiscard]] functions: std::ignore (C++11), [[maybe_unused]] attribute...

c++11 c++17 c++26 std::ignore maybe_unused structured bindings +1 more

Ep 489: C++11's User Defined Literals

2025-07-14 7:23 10,003 2 std links

Jason explores C++11's user-defined literals feature, explaining their constraints and best practices. User-defined literals must accept specific...

c++11 user-defined literals consteval type safety compile-time best practices

Jason takes viewers on a personal journey through 35 years of game development projects, from a 1990 animal name game in Commodore 64 BASIC to his...

game development personal projects c++23 scripting career advice learning

Ep 487: AI: Not Just Autocomplete

2025-06-30 18:49 10,958 1 std links

This episode is an unscripted demonstration of using the Anthropic Claude AI agent to refactor a C++ codebase from using exceptions to std::expected....

ai refactoring expected exceptions error handling testing +1 more

This episode explores the fascinating behavior where lambdas can access constexpr local variables without capturing them, effectively creating...

lambdas constexpr static lifetime captures compiler behavior +1 more

Ep 485: Variadic Structured Bindings in C++26

2025-06-16 5:53 11,172 4 std links

This episode introduces C++26's variadic structured bindings feature, which allows structured bindings to create parameter packs from destructurable...

c++26 structured bindings parameter pack fold expressions metaprogramming reflection

Ep 484: Infinite Loops, UB, and C++26

2025-06-09 4:34 9,074 1 std links

This episode reveals a surprising aspect of C++ where infinite loops were undefined behavior before C++26, allowing compilers to make aggressive...

c++26 undefined behavior infinite loops compiler optimization language evolution

Ep 483: Stop Using rand, Start Using Random

2025-06-02 6:04 9,736 5 std links

This episode provides a practical introduction to the C++ header, which offers superior random number generation compared to the old C...

random random_device mersenne twister distributions c++11 best practices

Ep 482: Safely Wrapping C APIs

2025-05-26 12:25 13,505 4 std links

This episode demonstrates how to create type-safe, RAII-compliant wrappers around C library functions like fopen and fread. Jason shows that most...

c api raii unique_ptr custom deleter type safety resource management +2 more

This episode explains tail call elimination, a compiler optimization where returning the result of a function call can be transformed into a jump...

optimization tail call recursion assembly compiler optimization performance

This episode reveals a subtle but important issue where calling unqualified abs() on floating-point values in C++ can silently truncate to integer...

cmath abs standard library best practices

Ep 479: final (and when to use it)

2025-05-05 10:03 10,480 3 std links

This episode explores C++'s 'final' keyword, which can be applied to classes to prevent inheritance or to virtual functions to prevent further...

final override virtual inheritance performance vtable +4 more

Ep 478: Lambdas on the Heap (2)

2025-04-28 6:29 5,778 1 std links

This episode is a follow-up to a previous exploration of lambdas on the heap, correcting a mistake from the earlier video. Jason demonstrates how to...

lambdas heap allocation new auto type deduction non-movable objects smart pointers +2 more

This episode introduces Empty Base Optimization (EBO), a compiler technique that optimizes memory layout when inheriting from empty classes. Jason...

empty base optimization EBO memory layout optimization inheritance object size +3 more

Ep 476: C++23's Fold Algorithms

2025-04-14 6:17 9,465 3 std links

This episode introduces C++23's new fold algorithms: fold_left, fold_left_first, fold_right, fold_right_first, fold_left_with_iter, and...

C++23 fold algorithms ranges fold_left_first accumulate reduce +2 more

Ep 475: Lambdas On The Heap?

2025-04-07 6:27 10,860

This episode explores the concept of creating C++ lambdas on the heap rather than on the stack. Jason explains how lambdas are closure objects...

lambdas heap allocation closures default constructor captures memory management +1 more

Ep 474: What Can LEA Do For You?

2025-03-31 8:50 11,195

This episode demystifies the Load Effective Address (LEA) instruction commonly seen in Compiler Explorer outputs. Jason demonstrates how compilers...

assembly optimization LEA instruction compiler output x86 ARM +2 more

Ep 473: continue and break Statements

2025-03-24 5:03 9,012 1 std links

This episode explains how continue and break statements work in C++ loops, including their behavior in range-based for loops. Jason demonstrates that...

control flow break continue loops range-based for algorithms +3 more

Ep 472: C++23's static lambdas?!

2025-03-17 6:32 10,846 1 std links

This episode explores C++23's new feature that allows declaring static call operators for lambdas. Jason demonstrates how this feature can...

c++23 lambdas static optimization function call call operator

Ep 471: C++26's =delete With a Reason

2025-03-10 4:25 10,086 8 std links

This episode explores C++26's enhancement to the `=delete` functionality, which now allows adding a reason that appears in compiler error messages....

c++26 delete function overloading compiler errors API design implicit conversions

Ep 470: requires Clause vs requires Expression?

2025-03-03 7:00 7,283 28 std links

This episode clarifies the distinction between 'requires clauses' and 'requires expressions' in C++20. Jason explains that a requires clause expects...

c++20 requires clause requires expression concepts templates metaprogramming

Ep 469: How to Print in C++23

2025-02-24 3:13 12,369 4 std links

This episode presents a concise overview of the best approaches for printing output in C++23. Jason recommends using puts() for simple...

c++23 std::print std::println fmt output iostream +1 more

Ep 468: Use -fvisibility=hidden!

2025-02-17 9:08 15,013

This episode explores the significant benefits of using the -fvisibility=hidden compiler flag when creating shared libraries. Jason demonstrates how...

compiler flags optimization shared libraries visibility CMake cross-platform

This episode discusses the syntactic equivalence between 'enum class' and 'enum struct' in C++, both of which create scoped enumerations with...

enum class enum struct scoped enumerations C++11 code style best practices

This episode critiques the C++23 std::invoke_r function, highlighting two major issues with its design. Jason demonstrates that invoke_r only works...

c++23 std::invoke_r type conversion compiler warnings best practices

This episode discusses a new C++26 feature that allows constructing a std::span from an initializer list, addressing a common pain point in C++...

c++26 std::span initializer_list language features code optimization

Ep 464: Easily Printing std::variant

2025-01-20 7:17 10,150 1 std links

This episode demonstrates a simple yet powerful technique for printing std::variant values using generic lambdas and std::visit. Jason shows how to...

std::variant generic lambdas std::visit std::print C++20 C++23

Ep 463: C++26's Safer Returns

2025-01-13 2:59 12,260

This episode highlights a safety improvement in C++26 where returning a reference to a temporary value is now a hard compilation error, rather than...

c++26 compiler warnings references undefined behavior best practices

Ep 462: C++23's Amazing New Range Formatters

2025-01-06 7:23 9,875 3 std links

This episode explores C++23's powerful new range formatting capabilities, which enable easy printing of various container types and nested data...

C++23 formatters ranges containers std::format std::print +4 more

Ep 461: C++26's std::views::concat

2024-12-30 7:27 8,870 4 std links

This episode explores C++26's new std::views::concat feature, which allows multiple ranges to be treated as a single concatenated range. Jason...

C++26 ranges views concat iterators containers +3 more

In this episode, Jason investigates performance differences between GCC and Clang compilers using his Game of Life simulation code. He shares data...

compiler optimization GCC Clang performance comparison optimization flags integer types +3 more

Ep 459: C++26's Saturating Math Operations

2024-12-16 5:49 11,977 10 std links

This episode introduces C++26's new saturating math operations, which prevent overflow by clamping results to the maximum or minimum representable...

C++26 saturating math numeric overflow prevention safety-critical embedded +4 more

Ep 458: array of bool? No! constexpr std::bitset!

2024-12-09 4:40 10,681 1 std links

This episode explores the advantages of std::bitset over alternatives like std::array or std::vector for efficient bit manipulation....

std::bitset C++23 constexpr bit manipulation optimization vector +3 more

In this episode, Jason reviews two C++ beginner magazines purchased five years apart from different publishers but with remarkably similar content....

learning resources beginner mistakes code review best practices constexpr variable initialization +3 more

This episode examines how Return Value Optimization (RVO) applies to trivial types like arrays, showing significant performance impacts. Jason...

optimization RVO NRVO performance function design copy elision +3 more

This episode introduces mutation testing with the Mull tool, which helps evaluate test suite quality by modifying source code to create 'mutants' and...

testing mutation testing Mull LLVM Clang test quality +2 more

This episode explains the differences between std::invoke and std::apply, two powerful standard library utilities for calling functions. Jason...

std::invoke std::apply tuples callable templates functional programming +3 more

Ep 453: Valgrind + GDB Together!

2024-11-04 6:01 12,235

This episode demonstrates how to use Valgrind and GDB together to debug memory issues in C++ programs. Jason shows how Valgrind can act as a remote...

debugging valgrind gdb memory errors use-after-free tools

This episode explores a confusing aspect of C++ move semantics: how defining a custom destructor silently disables move operations without making...

move semantics rule of five rule of zero destructors copy constructor move constructor +1 more

This episode examines the claim that std::bad_alloc exceptions are obsolete due to modern operating systems' memory overcommitment. Through practical...

bad_alloc memory management exception handling 32-bit 64-bit address space +2 more

Ep 450: C++ is a Functional Programming Language

2024-10-14 7:49 19,144 2 std links

This episode responds to criticisms about functional programming features in C++, with Jason demonstrating that C++ has supported functional...

functional programming callable objects lambdas c++98 c++11 c++14 +2 more

Ep 449: More constexpr Math!

2024-10-07 9:07 9,542

This episode discusses the availability of constexpr math functions in C++. Jason explains how many standard functions only became constexpr...

constexpr cmath compile-time c++11 c++14 c++23 +4 more

Ep 448: C++23's forward_like

2024-09-30 6:51 9,731 3 std links

This episode explores C++23's std::forward_like utility in conjunction with C++23's "deducing this" feature. Jason demonstrates how these features...

c++23 forward_like deducing this perfect forwarding reference qualifiers lvalue +2 more

Ep 447: What Are Reference Qualified Members?

2024-09-23 10:28 12,006 3 std links

This episode explains reference-qualified member functions in C++, which allow different function implementations based on whether the object is an...

reference qualifiers lvalue rvalue member functions overloading move semantics +2 more

Ep 446: ImHex: An Awesome Hex Editor

2024-09-16 6:07 21,516 1 std links

This episode highlights ImHex, an open-source, cross-platform hex editor written in C++. Jason demonstrates the tool's extensive feature set,...

hex editor binary analysis ImHex open source Dear ImGui tools +1 more

Ep 445: C++11's thread_local

2024-09-09 10:31 11,012 7 std links

This episode explores C++11's thread_local storage duration specifier, which creates variables that are global to individual threads. Jason...

thread_local c++11 threading concurrency jthread c++17

Ep 444: GCC's Implicit constexpr

2024-09-02 3:39 8,578 1 std links

This episode explores GCC's compiler-specific -fimplicit-constexpr flag, which automatically makes inline functions constexpr if they satisfy the...

constexpr gcc compiler extensions inline functions c++17 cross-platform

Ep 443: Stupid constexpr Tricks

2024-08-26 5:40 15,228 2 std links

This episode explores several surprising and lesser-known constexpr behaviors in C++. Jason demonstrates how const integral values initialized with...

constexpr lambdas c++17 const compile-time programming

Ep 442: Stop Using .h For C++ Header Files!

2024-08-19 6:06 33,268 2 std links

In this episode, Jason makes a case against using the .h extension for C++ header files, arguing that it creates confusion about whether a file is...

coding standards header files file extensions C++ tooling mixed language +1 more

In this episode, Jason explores the concept of multiple dispatch (also known as multimethods), which allows function calls to be dynamically...

multiple dispatch multimethods std::variant std::visit virtual functions polymorphism +1 more

Ep 440: Revisiting Visitors for std::visit

2024-08-05 9:07 14,720 3 std links

In this episode, Jason revisits the implementation of visitors for std::visit when working with std::variant. He demonstrates three approaches: using...

std::variant std::visit visitors lambdas C++20 variadic templates +2 more

Ep 439: mutable (And Why To Avoid It)

2024-07-29 8:48 12,944 3 std links

In this episode, Jason explores the mutable keyword in C++ and explains why it should generally be avoided. He demonstrates how mutable allows member...

mutable const thread safety data races caching multithreading +1 more

Ep 438: C++23's ranged-for Fixes

2024-07-22 7:43 10,558 1 std links

In this episode, Jason explores a significant improvement in C++23 that fixes lifetime issues with range-based for loops. He demonstrates how C++20...

c++23 range-based for object lifetime temporaries lifetime extension undefined behavior

Ep 437: Pointers To Overloaded Functions

2024-07-15 7:55 12,154 2 std links

In this episode, Jason explores the challenges of obtaining and passing pointers to overloaded functions in C++. He demonstrates that when working...

function pointers overloaded functions templates static_cast lambdas function overloads

Ep 436: Transforming Lambda Captures

2024-07-08 4:32 10,755 1 std links

In this episode, Jason explores a technique for transforming values as they are captured by lambdas using C++20's pack expansion in lambda...

c++20 lambdas pack expansion init-captures parameter packs string_view

In this episode, Jason explores AdaptiveCpp (formerly Open SYCL), a tool that enables C++ developers to easily offload parallel algorithms to GPUs...

gpu parallel programming AdaptiveCpp SYCL game of life C++17 +2 more

In this episode, Jason explores GCC's new -Wnrvo warning flag which detects when Named Return Value Optimization (NRVO) cannot be applied in...

gcc optimization return value optimization NRVO compiler warnings C++17

In this episode, Jason explores the new floating point types introduced in C++23, which are the first new floating point types added to the C++...

c++23 floating point stdfloat bfloat16 machine learning

Ep 432: Why constexpr Matters

2024-06-10 6:21 16,648 1 std links

This episode addresses common misconceptions about constexpr, explaining that its value extends beyond solving entire problems at compile time. Jason...

constexpr compile-time evaluation optimization consteval immediate functions metaprogramming +2 more

Ep 431: CTAD for NTTP

2024-06-03 7:34 8,767 27 std links

This episode explores the combination of Class Template Argument Deduction (CTAD) with Non-Type Template Parameters (NTTP) in C++. Jason explains how...

CTAD non-type template parameters NTTP templates C++17 C++20 +2 more

Ep 430: How Short String Optimizations Work

2024-05-27 12:02 16,397 1 std links

This episode explains the Small String Optimization (SSO) technique used in standard library classes like std::string, std::any, and std::function to...

small string optimization SSO small object optimization unions constexpr memory allocation +2 more

Ep 429: C++26's Parameter Pack Indexing

2024-05-20 3:53 10,176 9 std links

This episode introduces parameter pack indexing, a new feature coming in C++26 that simplifies working with template parameter packs. Jason...

c++26 parameter packs templates metaprogramming variadic templates pack indexing

Ep 428: C++23's Coroutine Support: std::generator

2024-05-13 3:21 9,556 2 std links

This episode introduces std::generator, a key addition in C++23 that provides the first standard library support for coroutines. Jason demonstrates...

c++23 coroutines std::generator co_yield fibonacci ranges +2 more

Ep 427: Simple Generators Without Coroutines

2024-05-06 5:27 11,362 1 std links

This episode demonstrates how to create Python-like generators in C++ without using coroutines or std::generate. Jason shows a clever technique using...

generators lambdas ranges views std::views::iota fibonacci +2 more

Ep 426: Lambdas As State Machines

2024-04-29 6:53 16,259 3 std links

This episode explores how mutable lambdas with captures can function as self-contained state machines. Jason demonstrates this concept first with a...

lambdas state machines mutable lambdas functional programming generators parsing +2 more

This episode addresses the potential dangers of using std::string_view, std::span, and other non-owning reference types in C++. Jason demonstrates...

string_view span undefined behavior lifetime issues AddressSanitizer constexpr +3 more

Ep 424: .reset vs →reset()

2024-04-15 3:55 11,806 3 std links

This episode addresses a subtle but potentially serious API design issue with nested types that both provide similar methods. Jason demonstrates how...

api design smart pointers std::any method ambiguity interface design best practices

Ep 423: Complete Guide to Attributes Through C++23

2024-04-08 13:13 11,004 1 std links

This episode provides a comprehensive overview of all C++ attributes from C++11 through C++23. Jason covers the functionality, purpose, and potential...

attributes c++11 c++17 c++20 c++23 noreturn +2 more

Ep 422: Moving from C++20 to C++23

2024-04-01 13:38 12,366 5 std links

In this episode, Jason continues his series on modernizing legacy code by upgrading his infix math expression evaluator to C++23. He focuses on...

C++23 lambda attributes noreturn constexpr error handling exceptions +3 more

This episode discusses a common performance issue with wrapper types like std::optional, std::variant, std::pair, std::tuple, std::any, and...

std::optional std::expected std::variant std::tuple std::pair return value optimization +4 more

In this episode, Jason continues his series on modernizing code by migrating from C++17 to C++20. He focuses on C++20's enhanced constexpr...

C++20 constexpr consteval user-defined literals spaceship operator concepts +4 more

In this episode, Jason highlights what he considers the most important features of C++23. He showcases 13 key additions including std::print/println...

C++23 std::print import std stacktrace flat_map multi-dimensional subscript +8 more

Ep 418: Moving From C++14 to C++17

2024-03-04 19:32 7,913 3 std links

This episode continues Jason's series on modernizing C++ code, focusing on migrating from C++14 to C++17. He demonstrates powerful C++17 features...

C++17 modernization string_view nodiscard from_chars constexpr +3 more

This episode explores the Mold linker, a high-performance alternative to traditional linkers for C++ projects. Jason shares his experiments with...

build performance linker mold compilation gcc clang +3 more

Ep 416: Moving From C++11 to C++14

2024-02-19 16:04 7,283 1 std links

In this episode, Jason Turner continues his series on C++ modernization by migrating code from C++11 to C++14. He demonstrates key C++14 improvements...

C++14 constexpr Catch2 modernization trailing return types auto return type deduction +1 more

Ep 415: Moving From C++98 to C++11

2024-02-12 17:20 9,205 2 std links

In this episode, Jason Turner demonstrates the process of modernizing legacy C++98 code to C++11. He shows various C++11 features like enum class,...

C++11 modernization auto nullptr constexpr enum class +3 more

Ep 414: C++26's Placeholder Variables With No Name

2024-02-05 5:22 13,684 1 std links

This episode explores C++26's new placeholder variable feature, which allows developers to use an underscore (_) as a variable name when the value is...

C++26 structured bindings placeholder variables underscore language features GCC

This episode explores Unity builds, a compilation technique where multiple C++ source files are concatenated into a single file before compilation....

build performance unity builds cmake ODR link time optimization compilation +1 more

This episode explores C++23's new [[assume]] attribute, which allows developers to give the compiler hints about guaranteed conditions in their code....

C++23 compiler optimizations assume attribute null pointer checks performance

Ep 411: Intro to C++ Exceptions

2024-01-15 9:06 11,860 8 std links

This episode provides a fundamental introduction to C++ exceptions. Jason demonstrates basic exception mechanics including throwing and catching...

exceptions error handling try-catch rethrow RTTI polymorphism

This episode explains the critical concepts of alignment and padding in C++ data structures. Jason demonstrates how different data types require...

data structures memory layout alignment padding optimization ABI

In this career-focused episode, Jason shares proven strategies for significantly increasing your developer salary through community involvement and...

career development salary negotiation tech interviews community involvement speaking job hunting

This episode demonstrates how straightforward it is to implement a constexpr version of std::unique_ptr in C++20, despite it only being officially...

constexpr unique_ptr C++20 C++23 compile-time programming smart pointers

Ep 407: C++98 Code Restoration

2023-12-18 40:23 13,446

In this extended episode, Jason demonstrates a comprehensive renovation of legacy C++98 code, transforming it into high-quality, maintainable...

legacy code C++98 code restoration RAII best practices testing +1 more

This episode explains why pointer arithmetic should be avoided in modern C++ code. Jason demonstrates how easy it is to introduce undefined behavior...

pointer arithmetic undefined behavior memory safety string_view span best practices

This episode introduces Dogbolt, a free online service similar to Compiler Explorer (Godbolt) but for decompilation rather than compilation. Jason...

decompilation reverse engineering dogbolt constexpr binary analysis

This episode explains why developers should prefer writing code that avoids explicit std::move calls. Using a simple example with a custom 'Lifetime'...

move semantics optimization copy elision value semantics best practices

Ep 403: Easier Coroutines with CppCoro

2023-11-20 13:09 11,854 1 std links

This episode introduces CppCoro, a library that simplifies working with C++20 coroutines by providing essential utilities and abstractions that the...

coroutines cppcoro c++20 asynchronous generators

In this entertaining episode, Jason reviews his own C++ code from 1997-1998 university projects, critiquing it from a modern C++ perspective. He...

code review legacy code memory management best practices C++ evolution pointers

Ep 401: C++23's chunk view and stride view

2023-11-06 4:12 6,827 12 std links

This episode concludes Jason's mini-series on C++23's new ranges views, focusing on chunk_view and stride_view. The chunk_view divides a range into...

C++23 ranges chunk_view stride_view data processing containers +1 more

Ep 400: C++ is 40... Is C++ DYING?

2023-10-30 20:51 31,534 1 std links

In this milestone 400th episode, Jason addresses the popular question of whether C++ is dying. He presents evidence of C++'s continued relevance by...

C++23 language trends programming languages industry adoption standard evolution memory safety

This episode continues Jason's mini-series on C++23 ranges by comparing two easily confused views: adjacent_view and slide_view. While both create...

C++23 ranges slide_view adjacent_view structured bindings compile-time vs runtime

Ep 398: C++23's zip_view #cpp23 #cplusplus

2023-10-16 3:49 7,451 4 std links

This episode introduces C++23's new zip_view from the ranges library, the first in a mini-series covering new view types. Jason demonstrates how...

C++23 ranges zip_view structured bindings tuples views

This episode provides a quick introduction to the std::chrono library, highlighting its evolution from C++11 to C++20's calendar and formatting...

C++20 std::chrono calendars time date duration +2 more

This episode explores the various 'emplace' functions available in C++ standard containers and their purpose of constructing objects directly...

emplace emplace_hint standard library containers optimization map +2 more

In this special milestone episode celebrating 100,000 subscribers, Jason provides a transparent look at the financial reality of running a...

YouTube channel growth C++ community content creation monetization tech education

This episode explores delegating constructors, a feature introduced in C++11 that allows one constructor to call another constructor of the same...

C++11 constructors delegating constructors object lifetime best practices code duplication

Ep 393: C++23's std::unreachable

2023-09-11 9:58 13,929 1 std links

This episode explores std::unreachable, a new feature in C++23 that explicitly invokes undefined behavior to optimize impossible code paths. Jason...

C++23 std::unreachable undefined behavior optimization switch statements error handling

This episode introduces Bloaty McBloatface, Google's binary size profiler tool. Jason demonstrates how this utility helps developers understand what...

binary size profiling optimization tooling performance Bloaty McBloatface +1 more

Ep 391: Finally! C++23's std::views::enumerate

2023-08-28 2:52 11,505 2 std links

This episode celebrates the long-awaited addition of std::views::enumerate to C++23, a feature that many other programming languages have had for...

C++23 ranges views enumerate standard library containers +1 more

Ep 390: constexpr + mutable ?!

2023-08-21 7:36 8,963 3 std links

This episode explores the seemingly contradictory combination of 'constexpr' and 'mutable' keywords in C++. Jason demonstrates that a lambda marked...

constexpr mutable const lambdas compile-time programming optimization +1 more

Ep 389: Avoiding Pointer Arithmetic

2023-08-14 4:47 12,594 2 std links

This episode discusses modern C++ alternatives to traditional pointer arithmetic when working with C-style interfaces like main's argc/argv...

pointer arithmetic std::span std::next C++20 ranges views +2 more

This episode introduces cons_expr, Jason's compile-time friendly embedded scripting language for C++ inspired by Lisp/Scheme. Jason explains how this...

constexpr compile-time scripting embedded language lisp scheme +2 more

Ep 387: My Customized C++ Programming Keyboard!

2023-07-31 7:29 6,763 1 std links

In this episode, Jason demonstrates his customized Adafruit MacroPad configured specifically for C++ programming. He shows how he mapped frequently...

keyboard hardware productivity tools macros programming

This episode explores C++23's new feature allowing attributes to be applied to lambda expressions. Jason demonstrates how attributes like...

C++23 lambda attributes nodiscard noinline function attributes

This episode provides a concise overview of the most significant C++20 features, including designated initializers that allow specifying struct/class...

C++20 designated initializers spaceship operator modules concepts ranges +5 more

Ep 384: Lambda-Only Programming

2023-07-10 6:46 12,815 3 std links

This episode explores the unusual concept of using lambdas for everything in C++, presented as a fun thought experiment rather than a best practice....

lambdas C++17 generalized capture flat map fold expressions

Ep 383: C++ Cross Training

2023-07-03 5:25 5,951 3 std links

This episode discusses the importance of learning programming languages beyond C++ to become a better C++ developer, drawing an analogy with athletic...

cross-training python programming languages learning best practices

Jason explores the Static Initialization Order Fiasco in C++ (where interdependent global objects may be initialized in an unpredictable order) and...

constinit c++20 static initialization global objects initialization order fiasco constexpr

Jason explores C++23's new basic_string::resize_and_overwrite function, which improves performance when initializing strings that will be immediately...

c++23 std::string optimization resize_and_overwrite performance memset +1 more

In this episode, Jason explores std::ref and std::cref, useful utilities for creating reference wrappers. He demonstrates three key use cases: with...

std::ref std::cref reference_wrapper std::bind class design standard algorithms

Jason explores clang-tidy's "bugprone-easily-swappable-parameters" warning, which flags when functions have multiple adjacent parameters of the same...

clang-tidy parameter design code safety strong typing API design struct parameters

In this episode, Jason discusses whether it's beneficial to use std::move with std::array. While an array itself cannot be moved (as it's a...

std::move std::array move semantics optimization copy elision element propagation

In this episode, Jason shares his perspective on the top features C++ needs in its future evolution. He prioritizes five key improvements: completing...

c++26 future features pattern matching contracts reflection constexpr +1 more

Jason introduces his updated CMake template for C++ projects in 2023, consolidating his previous templates into a single, streamlined repository...

cmake template project setup security hardening cpm +3 more

Jason demonstrates how Interprocedural Optimization (IPO) and Link Time Optimization (LTO) can detect One Definition Rule (ODR) violations that...

IPO LTO ODR ABI optimization build system +2 more

Ep 374: C++23's out_ptr and inout_ptr

2023-05-01 13:38 18,506 5 std links

This episode explores C++23's new std::out_ptr and std::inout_ptr utilities, designed to simplify interaction between C++ smart pointers and C APIs...

c++23 out_ptr inout_ptr smart pointers c api memory management

Ep 373: Design Patterns in "Modern" C++ (2023)

2023-04-24 16:49 35,777 1 std links

In this episode, Jason discusses design patterns in modern C++, focusing particularly on the Observer pattern (similar to signals and slots in Qt)....

design patterns observer pattern object lifetime signals and slots modern c++

This episode explores CPM (CMake Package Manager), a dependency management solution that integrates seamlessly with CMake. Jason demonstrates his...

CPM CMake dependency management build systems package management C++ +4 more

This episode outlines best practices for effectively using AI code generation tools like ChatGPT and GitHub Copilot. Jason emphasizes that users must...

AI ChatGPT GitHub Copilot code generation best practices pair programming +4 more

Ep 370: Do Constructors Exist?

2023-04-03 8:42 12,203 1 std links

This episode challenges the conceptual understanding of C++ constructors by arguing they aren't actually functions that can be called directly, but...

constructors type conversion function pointers language semantics casts destructors +1 more

This episode explores llvm-mos, a modern compiler toolchain that enables C++23 programming for 6502-based 8-bit computers like the Commodore 64,...

llvm-mos 6502 Commodore 64 retro computing embedded programming LLVM +4 more

This episode explores template-template parameters in C++, which allow functions or classes to accept template types (like std::vector) rather than...

templates template-template parameters C++20 concepts design by introspection containers +2 more

Ep 367: Forgotten C++: std::valarray

2023-03-13 9:16 17,339 5 std links

This episode explores std::valarray, a largely forgotten part of the C++ Standard Library that was introduced in C++98 and has received minimal...

std::valarray vectorization SIMD numeric computing optimization element-wise operations +2 more

This episode compares the performance of C++, regular Python, PyPy JIT, and Codon (a Python-to-native compiler) implementations of Conway's Game of...

python codon performance comparison game of life modulo compiled python +2 more

This episode explores the surprising complexity of the modulo operation in various programming languages. Jason demonstrates that different languages...

modulo remainder integer division cross-language differences array indexing truncated division +2 more

Ep 364: Python-Inspired Function Cache for C++

2023-02-20 11:52 11,372 1 std links

This episode explores implementing a Python-inspired function memoization cache in C++. Jason builds a generic caching wrapper that can store the...

memoization template metaprogramming performance optimization recursion functional programming Python

Ep 363: A (Complete?) Guide To C++ Unions

2023-02-13 16:14 15,540 2 std links

This episode provides a comprehensive guide to C++ unions, explaining their core properties and evolution since C++98. Jason demonstrates how unions...

unions undefined behavior constexpr optional C++11 C++20 +1 more

Jason compares performance between C++, standard Python (CPython), JIT-compiled Python (PyPy), and Python with embedded C++ (via cppyy) using...

performance comparison Python C++ PyPy cppyy Conway's Game of Life +2 more

Jason explores ways to create a more modern, type-safe version of the main() function in C++. He demonstrates a pattern that forward-declares a...

main function command-line arguments string_view span modern C++ type safety +2 more

Ep 360: Scripting C++ Inside Python With cppyy

2023-01-23 6:48 12,050 1 std links

Jason explores cppyy, a Python library that enables C++ code to be compiled and executed within Python scripts. He demonstrates how cppyy dynamically...

cppyy Python C++ integration template instantiation dynamic compilation language interoperability

Jason explores the internal implementation of std::array by creating a simplified version from scratch. He reveals that std::array is essentially a...

std::array container implementation structured bindings standard library compile-time arrays reserved identifiers

Jason explores two new preprocessor directives coming in C23 and C++23. First, he demonstrates the #embed directive, developed by JeanHeyd Meneide...

C++23 C23 preprocessor #embed #warning compile-time +2 more

Ep 357: typename VS class In Templates

2023-01-02 5:38 22,473 10 std links

Jason explores the difference between using 'typename' and 'class' keywords in C++ templates. He explains that for most template parameters, these...

templates typename class C++17 template templates C++ syntax

Jason explores Python-enabled graphing calculators as accessible tools for learning programming without needing internet connectivity or complex...

Python calculators educational tools programming education cross-language learning TI-83 +3 more

Ep 355: 3 Steps For Safer C++

2022-12-19 9:04 16,442

Jason presents a simplified three-step approach to safer C++ development. He starts with a prerequisite (step 0) of having a continuous...

static analysis warnings fuzzing sanitizers code safety clang-tidy +2 more

Jason explores the capabilities of ChatGPT as a tool for programming in C++, demonstrating its ability to convert code between different language...

AI ChatGPT code modernization programming tools C++17 productivity

Ep 353: Implicit Conversions Are Evil

2022-12-05 9:02 14,008 4 std links

Jason argues that implicit conversions are a dangerous C++ feature that should be removed from the language. Through multiple code examples, he...

implicit conversions safety bugs best practices static analysis clang-tidy

In this episode, Jason advocates for the essential practice of fuzz testing in C++ development. He demonstrates how fuzz testing — a technique that...

fuzzing security sanitizers testing undefined behavior buffer overflow +4 more

Ep 351: Your 5 Step Plan For Deeper C++ Knowledge

2022-11-21 11:22 22,844 1 std links

This episode provides a structured approach to deepen C++ knowledge through hands-on experimentation. Jason outlines a five-step plan: 1) Create an...

object lifetime lambdas std::function type erasure learning C++ RVO +3 more

This episode outlines a comprehensive approach to modern C++ development, emphasizing that we're in a 'golden age' of C++ tooling. Jason covers...

best practices static analysis sanitizers compiler warnings security testing +5 more

Ep 349: C++23's move_only_function

2022-11-07 7:37 8,672 2 std links

This episode introduces C++23's std::move_only_function, a new feature designed for working with non-copyable callables. Jason demonstrates how...

C++23 move_only_function std::function move semantics lambdas unique_ptr +2 more

This comprehensive episode serves as a rapid-fire introduction to modern C++ by demonstrating how understanding lambdas provides insight into nearly...

lambdas C++11 C++14 C++17 C++20 C++23 +6 more

This episode examines a serious security vulnerability in the PlayStation 5 that led to a jailbreak exploit. Jason explains how the vulnerability...

security compiler warnings -Wconversion buffer overflow PlayStation type conversion +2 more

Ep 346: C++23's bind_back

2022-10-17 10:28 8,568 4 std links

This episode explores C++23's bind_back function, a utility that binds arguments to the end of a callable object's parameter list. Jason demonstrates...

C++23 bind_back functional programming partial application algorithms ranges +2 more

This episode addresses the absence of networking in the C++20 and C++23 standards, providing a comprehensive overview of available third-party...

networking C++20 C++23 package managers ASIO REST +4 more

This episode explains decltype(auto), a powerful C++11 feature that deduces the exact type of an expression, including reference and const...

decltype(auto) type deduction auto C++11 perfect forwarding function return types +1 more

Ep 343: Digging Into Type Erasure

2022-09-26 15:16 21,602

This episode explores different approaches to type erasure in C++, showcasing techniques to hide exact types at runtime. Jason demonstrates three...

type erasure polymorphism interfaces std::function lambdas view pattern

Ep 342: C++20's Ranges: A Quick Start

2022-09-19 10:13 21,123 21 std links

This episode provides a quick introduction to C++20's Ranges library. Jason presents four key benefits: simplified algorithm calls without manually...

ranges views C++20 algorithms lazy evaluation functional programming +1 more

Ep 341: std format vs lib {fmt}

2022-09-12 9:32 15,665 3 std links

This episode compares the C++20 standard format library with the standalone {fmt} library it's based on. Jason highlights key differences including...

std::format fmt string formatting C++20 constexpr compile-time +1 more

Ep 340: Finally! A Simple String Split in C++!

2022-09-05 8:41 24,437 13 std links

This episode demonstrates how C++20 Ranges provide an elegant solution to the long-standing challenge of string splitting in C++. Jason shows how...

C++20 ranges string_view split algorithms C++23

Ep 339: `static constexpr` vs `inline constexpr`

2022-08-29 6:52 20,726 1 std links

This episode provides a crucial follow-up to Episode 312, clarifying when to use 'static constexpr' versus 'inline constexpr'. Jason demonstrates...

constexpr static inline compilation binary size optimization +1 more

Ep 338: Analyzing and Improving Build Times

2022-08-22 19:18 16,008 1 std links

This episode demonstrates how to analyze and optimize C++ build times using Clang's time-trace feature. Jason examines his ChaiScript project,...

compilation optimization time-trace templates build performance Clang

Ep 337: C23 Features That Affect C++ Programmers

2022-08-15 10:54 16,354 1 std links

This episode explores key features coming in C23 that impact C++ programmers, particularly focusing on interoperability between the languages. Jason...

C23 interoperability #embed constexpr attributes enumerations +1 more

Ep 336: C++23's Awesome std::stacktrace Library

2022-08-08 13:36 17,988 2 std links

This episode explores the new std::stacktrace library coming in C++23, which provides runtime access to the current call stack. Jason demonstrates...

C++23 std::stacktrace debugging error handling exceptions runtime information

In this channel news update, Jason discusses his various ongoing projects and ways viewers can get involved. He highlights his books (including his...

community open source C++ education game development C++ Best Practices

This episode explores different approaches to storing lambdas in containers in C++. Jason demonstrates three methods: using std::function (with...

lambda containers std::function function pointers factory function decltype +1 more

This episode demonstrates how to create a simplified implementation of std::function in C++20. Jason builds a type-erased function wrapper...

std::function type erasure templates virtual functions C++20 performance +1 more

This episode clarifies the key differences between lambdas, std::function, and function pointers in C++. Jason demonstrates that lambdas are language...

lambda std::function function pointer performance type erasure optimization

Ep 331: This Game Teaches C++!

2022-07-04 17:31 18,690

In this episode, Jason introduces a new educational project he's been developing: a game designed to teach C++ programming. The project combines...

C++ education game development interactive learning code safety sanitizers modern C++

This episode explores the 'extern template' feature added in C++11 and how it can significantly reduce compilation times. Jason demonstrates how...

extern template templates compilation build performance LTO IPO +1 more

This episode examines Link Time Optimization (LTO), also known as Inter-Procedural Optimization (IPO), and its significant performance benefits....

link time optimization LTO IPO compiler optimization CMake performance

Ep 328: Recursive Lambdas in C++23

2022-06-13 4:08 10,341 1 std links

This episode demonstrates how C++23's 'deducing this' feature enables a clean implementation of recursive lambdas, a capability that was awkward to...

C++23 lambdas recursive lambdas deducing this templates functional programming

This episode explores C++23's new multidimensional subscript operator support, which allows for a more intuitive syntax when working with matrix-like...

C++23 operator[] multidimensional subscript matrices language features

Ep 326: C++23's Deducing `this`

2022-05-30 7:04 12,374 6 std links

This episode explores C++23's 'deducing this' feature, which solves the common problem of duplicating code when implementing both const and non-const...

C++23 deducing this member functions const correctness templates code duplication

Ep 325: Why vector of bool is Weird

2022-05-23 12:14 25,078 5 std links

This episode explores why std::vector behaves differently from other vector specializations in C++. Jason explains that vector uses a...

vector proxy objects bit packing optimization forwarding references range-based for loops

Ep 324: C++20's Feature Test Macros

2022-05-16 7:49 8,920 1 std links

This episode explores C++20's standardized feature test macros, which provide a compile-time way to check if specific C++ features are supported by...

C++20 feature test macros compiler compatibility preprocessor constexpr portability

Ep 323: C++23's auto{} and auto()

2022-05-09 6:49 18,039 3 std links

This episode introduces a seemingly small but important new feature in C++23: the auto{} and auto() syntax for creating explicit copies of objects....

C++23 auto copy semantics algorithms containers std::erase

This episode explores four scenarios where using 'const' can have unexpected negative performance implications in C++. Jason demonstrates how 'const'...

const move semantics optimization best practices object lifetime return value optimization

Jason reviews the results of his first C++ Best Practices Game Jam, where participants created console games following the theme "round" using the...

game jam FTXUI best practices console games community code quality +4 more

Ep 320: Using `inline namespace` To Save Your ABI

2022-04-18 7:40 13,855 1 std links

Jason explores how to use inline namespaces to handle ABI compatibility in C++ libraries. Introduced in C++11, inline namespaces allow library...

inline namespace ABI binary compatibility library versioning C++11 name mangling +4 more

Ep 319: A JSON To C++ Converter

2022-04-10 15:49 20,169 4 std links

Jason introduces his json2cpp tool that converts JSON data into compiled C++ code with zero runtime overhead. Unlike constexpr JSON parsing, this...

JSON constexpr compile-time optimization code generation configuration +4 more

Jason shares how his C++ meetup group tackled the challenge of creating a currying function in C++. Starting with a basic implementation that could...

curry functional programming templates lambdas variadic templates C++20 +4 more

Jason examines how member functions are internally implemented by C++ compilers. Using assembly code analysis, he reveals that member functions...

member functions const this pointer assembly calling conventions compiler implementation +4 more

Ep 316: What Are `const` Member Functions?

2022-03-21 14:05 13,159 1 std links

This episode provides a fundamental introduction to const member functions in C++. Jason explains how const member functions indicate that a method...

const member functions const correctness C++ fundamentals iterators overloading +3 more

Jason investigates the performance differences between regular constexpr and static constexpr variables through detailed benchmarks across GCC,...

constexpr static optimization compiler behavior GCC Clang +4 more

Jason comprehensively explores all possible techniques to force C++ compilers to perform calculations at compile time. He explains that simply...

constexpr consteval constinit compile-time C++20 static +2 more

Jason explores a five-year journey to solve a challenging constexpr problem: how to efficiently transfer compile-time string data to runtime without...

constexpr consteval C++20 template metaprogramming string string_view +2 more

This episode clarifies common misconceptions about constexpr variables in C++. Jason demonstrates that constexpr variables alone don't guarantee...

constexpr static optimization object lifetime storage duration best practices +1 more

Ep 311: ++i vs i++

2022-02-14 12:32 17,252 3 std links

This episode examines the differences between pre-increment (++i) and post-increment (i++) operators in C++. Jason explains that these operators have...

pre-increment post-increment operator overloading performance iterators best practices +1 more

This episode highlights a significant but often overlooked issue with small integer operations in C++. Jason demonstrates how operations with...

integer promotion uint8_t bit manipulation arithmetic shifts logical shifts C++ warnings +2 more

In this episode, Jason explores whether code comments should be considered a 'code smell' - a characteristic that might indicate deeper problems in...

code comments code smell clean code code quality self-documenting code best practices +1 more

This episode builds on the previous discussion of C++23's 'if consteval' feature (episode 304), correcting and expanding on its primary motivation....

C++23 if consteval constexpr consteval compile-time programming immediate functions +1 more

In this episode, Jason discusses his initiative to make C++ more fun and accessible, particularly for beginners and non-programmers. He introduces...

learning education puzzles object lifetime beginners C++ concepts +1 more

This episode explores the concept of local functions in C++ and explains why true local function definitions are not possible in the language. Jason...

lambdas local functions C++11 C++98 templates functors +2 more

This episode makes a compelling case against the use of 'using namespace' directives in C++ code. Jason explains how these directives can create...

using namespace namespaces best practices coding standards name resolution C++ style

Ep 304: C++23's 'if consteval'

2021-12-27 11:44 10,978 1 std links

This episode explores C++23's new 'if consteval' feature, comparing it to C++17's 'if constexpr' and C++20's 'std::is_constant_evaluated()'. Jason...

C++23 if consteval std::is_constant_evaluated if constexpr constexpr C++20 +2 more

This episode presents a programming exercise that challenges viewers to replace traditional functions with lambdas in their C++ code. Jason explains...

lambdas const constexpr best practices C++20 code exercise

Ep 302: It's Not Complicated, It's std::complex

2021-12-13 6:13 8,533 2 std links

This episode explores std::complex, a template class in the C++ Standard Library for representing complex numbers with real and imaginary parts....

std::complex C++14 C++20 complex numbers standard library constexpr +1 more

Ep 301: C++ Homework: `constexpr` All The Things

2021-12-06 8:36 9,249 1 std links

Jason presents the third in his series of C++ homework assignments, challenging viewers to maximize the use of constexpr in their code. Using the...

constexpr compile-time programming C++ educational exercises performance optimization ray tracing +3 more

Jason presents the second in his series of C++ homework assignments, challenging viewers to take an existing C++ project and make everything const...

const immutability C++ educational exercises refactoring code design +3 more

Ep 298: Detecting ABI Changes With abidiff

2021-11-15 10:10 8,633 1 std links

Jason explores the libabigail toolset, focusing on the abidiff utility which helps detect Application Binary Interface (ABI) changes between...

ABI abidiff libabigail binary compatibility library development continuous integration +2 more

Jason challenges viewers with a coding exercise: take an existing C++ program and convert as many variable, parameter, and return types as possible...

auto C++20 concepts type deduction educational exercises ray tracing +2 more

Ep 296: Constraining `auto` in C++20

2021-11-01 8:25 13,065 1 std links

Jason addresses common criticisms of the `auto` keyword in C++ by demonstrating how C++20 concepts can be used to constrain automatic type deduction....

C++20 auto concepts type safety type constraints best practices +1 more

Ep 295: API Design: Principle of Least Surprise

2021-10-25 11:23 15,380 2 std links

Jason responds to feedback on his implementation of the xoroshiro128 random number generator from Episode 285, focusing on API design considerations...

API design random number generators naming conventions copy constructors principle of least surprise best practices +1 more

Ep 294: Hello Commander X16

2021-10-18 11:05 9,757

Jason explores programming for the Commander X16, a new retro computer project led by the 8-Bit Guy (David Murray). Using his C++ for 6502 toolchain,...

C++20 retro computing 6502 commander x16 vera memory-mapped io +1 more

Ep 293: RPG in C++20 Project: Major Updates!

2021-10-11 16:47 12,686 1 std links

In this episode, Jason provides an update on his C++20 RPG game project, which is now running on a Commodore 64 emulator using 6502 assembly. He...

C++20 game development 6502 retro computing cross-compilation optimization +1 more

This episode examines the safety aspects of using goto statements in C++. Jason explains that while goto is generally discouraged, the C++ compiler...

goto control flow compiler safety c++ features undefined behavior language safeguards

Ep 291: Start Using `as_const`

2021-09-27 8:40 26,395 1 std links

This episode explains how to safely treat non-const objects as const when you need to call const-qualified member functions. Jason addresses feedback...

as_const const const_cast static_cast member functions c++17 +3 more

This episode explores two lesser-known C++14 features that enhance code readability. Jason demonstrates binary literals, which allow directly...

c++14 binary literals digit separators numeric literals readability best practices

Ep 289: Returning From The `void`

2021-09-13 6:06 13,671 1 std links

This episode examines a lesser-known C++ feature: the ability to return a void expression from a void function. Jason explores how this capability,...

void return type auto decltype(auto) function wrappers c++14 +2 more

Ep 288: Quick Perf Tip: Prefer `auto`

2021-09-06 10:18 16,397 2 std links

This episode demonstrates the performance benefits of using auto over explicit type declarations in C++. Jason explains that auto prevents unintended...

auto performance implicit conversions type deduction best practices range-based for loop +1 more

Ep 287: Understanding `auto`

2021-08-30 11:15 23,614 9 std links

This episode clarifies common misconceptions about C++'s auto keyword, explaining that it follows the same type deduction rules as template...

auto type deduction templates references pointers c++11 +1 more

This episode explores the fascinating history of dual-monitor support in DOS-era computing, specifically how games like Command and Conquer could...

DOS memory mapping Command and Conquer dual monitor retro gaming assembly +2 more

This episode explores techniques for creating stably random content in games, inspired by classics like Elite that used procedural generation to...

random number generation procedural generation game development constexpr deterministic algorithms

Ep 284: C++20's Safe Integer Comparisons

2021-08-09 7:29 13,606 1 std links

This episode addresses the problems that arise when comparing signed and unsigned integers in C++. Jason demonstrates how comparing a negative value...

C++20 integer comparisons std::cmp_less signed vs unsigned utility header type safety +2 more

Ep 283: Stop Using const_cast!

2021-08-02 16:40 18,076

This episode explains why using const_cast in C++ is dangerous and should be avoided. Jason demonstrates that modifying const objects leads to...

const_cast undefined behavior const correctness C++14 decltype(auto) templates +2 more

This episode examines a performance optimization opportunity found in Dave Plummer's 'Prime Number Sieve' comparison code. Jason identifies that a...

performance optimization constexpr static const compile-time Meyer's singleton +2 more

Ep 281: N Times Faster Code With Parallel Algorithms

2021-07-19 10:45 18,465 3 std links

This episode demonstrates the remarkable performance improvements possible with C++17's parallel algorithms library. Jason showcases a Mandelbrot set...

C++17 parallel algorithms execution policies std::transform performance optimization Mandelbrot +2 more

In this episode, Jason explores Amazon's newly open-sourced O3DE (Open 3D Engine) codebase, examining it from a C++ perspective. Using tools like...

code review game engine O3DE constexpr destructors rule of five +3 more

This episode continues the performance analysis of a quicksort implementation, focusing on a subtle but significant optimization in iterator...

iterators performance optimization loops compiler explorer quicksort +1 more

This episode explores the differences between emplace_back() and push_back() in C++ standard containers, examining both their semantic differences...

emplace_back push_back performance containers C++11 std::vector +2 more

This episode examines how using the wrong integer type can significantly impact performance. Jason demonstrates a quick sort implementation that was...

performance integer conversions optimization compiler explorer std::size_t quicksort

Jason Turner explores C++20's new conditionally explicit specifier, which allows constructors and conversion operators to be explicitly marked based...

c++20 explicit constructors conversion operators templates type traits +2 more

Following up on his previous episode comparing std::pair to a custom implementation, Jason Turner outlines three steps for effectively trusting the...

c++ standard library optimization memory allocation documentation testing +3 more

Ep 274: Why Is My Pair 310x Faster Than `std::pair`?

2021-05-31 19:56 48,345 1 std links

Jason Turner investigates why a simple custom pair implementation outperforms std::pair in benchmarks by up to 310x in some compiler configurations....

c++ optimization std::pair template forwarding constructor compiler optimizations +5 more

Jason Turner explores a new C++23 feature that simplifies lambda syntax by making parameter lists optional when using lambda specifiers like...

c++23 lambda expressions simplification mutable fibonacci commodore 64 +2 more

Jason Turner revisits and updates his Commodore 64 C++ project, now renamed "6502 for C++". He compares different 'Hello World' implementations in...

c++ hello world commodore 64 6502 retro computing memory manipulation +4 more

Ep 271: string.clear() vs string = ""

2021-05-10 11:32 20,966 4 std links

Jason Turner compares two methods of emptying a std::string: using the clear() member function versus assigning an empty string literal (string =...

c++ string clear optimization assignment performance +2 more

Ep 270: Break ABI to Save C++

2021-05-03 35:49 40,799 1 std links

This episode discusses the importance of breaking ABI (Application Binary Interface) stability to allow C++ to evolve and improve. Jason explains...

abi language evolution best practices library design binary compatibility

Jason explores the newly available constexpr support for std::vector and std::string in C++20, showing how to use these containers in constexpr...

c++20 constexpr std::vector std::string compile-time programming constexpr allocation

Jason Turner presents his top 10 essential C++ resources, compiled with input from his Twitter followers. The list includes online communities like...

c++ resources learning reference compiler explorer cppreference +3 more

Ep 267: C++20's starts_with and ends_with

2021-04-12 5:42 8,794 13 std links

This episode covers the C++20 additions of starts_with and ends_with methods to std::string and std::string_view. Jason explains how these handy...

c++20 string string_view starts_with ends_with constexpr

This episode explores C++20's new std::shift_left and std::shift_right algorithms, which provide a standardized way to shift elements within...

C++20 algorithms std::shift_left std::shift_right move semantics unspecified state

Ep 265: C++20's std::bit_cast

2021-03-29 8:38 14,363 1 std links

This episode explores C++20's std::bit_cast, a new function that provides a safe and well-defined way to reinterpret the bit pattern of one type as...

C++20 std::bit_cast bit manipulation type conversion constexpr strict aliasing

This episode explores covariant return types in C++, which allow a derived class to override a virtual method with a more specific return type. Jason...

covariant return types polymorphism inheritance smart pointers C++ language features

This episode explains virtual inheritance in C++, a feature that many programmers misunderstand. Jason demonstrates how virtual inheritance solves...

virtual inheritance diamond problem multiple inheritance C++ inheritance base classes object layout

Ep 262: std::string's 11 Confusing Constructors

2021-03-08 8:17 11,442 1 std links

This episode explores the confusing behavior and inconsistent semantics of std::string's eleven different constructors. Jason demonstrates how two...

std::string constructors API design string handling overloading C++ gotchas

Ep 261: C++20's New consteval Keyword

2021-03-01 4:13 11,129 5 std links

This episode introduces C++20's consteval keyword, which enforces that a function must be evaluated at compile time. Jason explains that consteval is...

C++20 consteval compile-time programming constexpr immediate functions

This episode explains C++'s "most vexing parse" problem, a parsing ambiguity that occurs when trying to default-construct an object with empty...

most vexing parse parsing ambiguity initialization C++ gotchas braced initialization function declaration

This episode explores the Curiously Recurring Template Pattern (CRTP), a C++ design pattern where a class inherits from a template instantiated with...

CRTP templates static polymorphism mixin C++ idioms comparison operators

This episode explores C++20's std::source_location, a powerful new feature for compile-time source code introspection. Jason demonstrates how this...

C++20 std::source_location reflection logging introspection compile-time

This episode demonstrates why uninitialized variables in C++ lead to undefined behavior and unpredictable program outcomes. Jason shows how different...

initialization undefined behavior best practices optimization compiler warnings

Jason explores C++11's little-known garbage collection specification, a feature that was standardized but never implemented by any compiler. The...

C++11 garbage collection memory management reachability declare_reachable pointer_safety +2 more

Jason surveys C++11, C++14, and C++17 features that still lack cross-platform compiler support as of January 2021. The most notable omission is...

C++11 C++14 C++17 compiler support cross-platform garbage collection +3 more

Ep 254: C++23's signed / unsigned size_t Literals

2021-01-11 4:29 18,813 2 std links

Jason discusses the first core language feature to be accepted into C++23: literal suffixes for signed and unsigned size_t types. Though not yet...

C++23 literals size_t ptrdiff_t core language suffixes +1 more

Jason announces that C++20 has been officially released as ISO/IEC 14882:2020 and explains the various ways to access the C++ standard documentation....

C++20 standard documentation ISO working draft reference

Jason demonstrates how Polymorphic Memory Resources (PMR) can dramatically improve JSON parsing performance through practical benchmarks. Using...

PMR memory allocation JSON performance optimization Boost.JSON RapidJSON +2 more

Ep 251: constexpr Parameters With C++20's CNTTP

2020-12-21 7:15 9,974 10 std links

Jason explores C++20's Class Non-Type Template Parameters (CNTTP), showing how they enable the use of compile-time known values in contexts where...

C++20 CNTTP templates constexpr compile-time programming non-type template parameters

Jason explores the practical benefits of custom memory allocation strategies in C++, particularly using PMR (Polymorphic Memory Resources). He...

C++ PMR memory allocation performance multithreading monotonic_buffer_resource +3 more

Jason explores three categories of types in C++ that cannot be directly named by the programmer: lambda types (which have compiler-generated unique...

C++ lambdas local classes private inner classes encapsulation pimpl +1 more

Jason provides a comprehensive overview of C++17's Polymorphic Memory Resources (PMR), explaining the different standard memory resources including...

C++17 PMR memory management allocators memory_resource monotonic_buffer_resource +1 more

Ep 247: -O3, -Os, -Og, -Oz, Oh My!

2020-11-23 11:01 11,472

Jason explores the various compiler optimization flags available in GCC and Clang, explaining the differences between -O0 (no optimization), -O1/2/3...

optimization compiler flags GCC Clang binary size performance

In this short and entertaining episode, Jason deconstructs the cryptic C++ expression (+[](){})(), which he spotted on a t-shirt at the Code Dive...

lambdas function pointers operator overloading c++11 language quirks immediately invoked functions

Ep 245: PMR: Mistakes Were Made (By Me)

2020-11-09 18:44 12,196 16 std links

In this follow-up to previous PMR episodes, Jason addresses mistakes in his earlier allocator discussions. He clarifies terminology (memory resource...

pmr allocators memory resources c++17 c++20 initializer lists +2 more

In this special update episode, Jason Turner shares news about his YouTube channel and related projects. He discusses switching to DaVinci Resolve...

channel update C++ Weekly YouTube C++ Best Practices GitHub sponsors cpp_starter_project

In this foundational computer science episode, Jason explores the two's complement representation used for signed integers in computers, now...

binary two's complement computer science signed integers c++20 number representation +1 more

In this episode, Jason Turner introduces the 'Design by Introspection' pattern, which combines C++20's concepts with C++17's if constexpr to create...

c++20 concepts if constexpr templates design patterns compile-time programming +1 more

In this episode, Jason Turner explores an unconventional debugging technique: using the `explicit` keyword on copy constructors to identify...

explicit copy constructors performance optimization c++11 debugging +1 more

Ep 240: Start Using [[nodiscard]]!

2020-10-05 6:06 15,377 3 std links

In this episode, Jason Turner explores the [[nodiscard]] attribute introduced in C++17 and enhanced in C++20. He demonstrates how it can help prevent...

attributes nodiscard c++17 c++20 best practices compiler warnings +2 more

Ep 239: std::mem_fun vs std::mem_fn Fight!

2020-09-28 10:21 12,447 1 std links

This episode explores the difference between std::mem_fun (deprecated in C++11, removed in C++17) and its replacement std::mem_fn (introduced in...

functional std::mem_fn std::mem_fun deprecated c++11 c++17 +2 more

Ep 238: const mutable Lambdas?

2020-09-21 6:54 10,329 1 std links

In this episode, Jason explores the seemingly contradictory concept of 'const mutable lambdas' in C++. He demonstrates why this combination is...

lambdas const mutable c++17 operator overloading compiler insights

This episode shares Jason's personal journey and methodology for learning C++ through experimentation and hands-on investigation. He demonstrates how...

learning education experimentation debugging special member functions rvo +1 more

Ep 236: Creating Allocator-Aware Types

2020-09-07 23:48 16,379 17 std links

This episode explores how to create custom allocator-aware types in C++ that can properly work with the Polymorphic Memory Resource (PMR) library....

pmr allocators memory-management c++17 rule-of-five custom-types

Ep 235: PMR: Amazing, Fast, But, Not Quite Magic

2020-08-31 22:37 21,931 2 std links

This episode explores C++17's Polymorphic Memory Resources (PMR) in-depth, following up on a previous introduction. Jason demonstrates how PMR can...

PMR memory management C++17 allocators performance optimization monotonic_buffer_resource +2 more

Ep 234: map[] vs map.at()

2020-08-24 11:38 18,293 2 std links

This episode compares the square bracket operator (map[key]) with the at() method (map.at(key)) for accessing std::map elements. Jason examines the...

std::map operator[] at() const correctness exception handling performance +2 more

This episode compares the performance of std::map with a simple hand-crafted constexpr map implementation. Jason demonstrates how using a...

constexpr std::map optimization compile-time lookup tables performance +2 more

Ep 232: C++20's `using enum`

2020-08-10 7:04 18,063

This episode explores the C++20 'using enum' feature, which allows enum class values to be used without full qualification in local scopes. Jason...

C++20 enum class using enum scoped enumerations using declaration switch statements

Ep 231: Multiple Destructors in C++20?! How and Why

2020-08-03 12:46 30,089 1 std links

This episode explores C++20's ability to define multiple conditional destructors using concepts. Using a template-like 'optional' class, Jason...

C++20 destructors concepts requires templates optimization +2 more

This episode demonstrates how to build a high-performance domain-specific language (DSL) for matching bit patterns in C++. Jason implements a...

bit manipulation DSL consteval compile-time programming operator overloading C++20 +2 more

This episode explores why C++20 has deprecated the use of the comma operator in array subscripts. Jason demonstrates how the comma operator can be...

C++20 comma operator array subscript deprecation multidimensional arrays language evolution

This episode introduces the new mathematical constants provided in C++20 through the header. Jason demonstrates the new std::numbers...

C++20 numbers constants mathematical-constants pi constexpr +1 more

This episode continues the RPG game engine series, focusing on building a testable event system that can replay game events deterministically. Jason...

C++20 game-development event-handling variant visitor-pattern sfml +3 more

This episode explores the special behavior of the arrow operator (->) in C++, explaining how it uniquely handles operator overloading. Jason...

operator overloading arrow operator smart pointers C++ standard

Ep 225: Understanding Operator Overloading

2020-06-22 11:56 20,722 1 std links

Jason provides a comprehensive introduction to operator overloading in C++, demonstrating three different approaches for binary operators: free...

operator overloading binary operators unary operators friend functions member functions complex numbers +2 more

In this fifth part of the RPG in C++20 series, Jason continues developing his game engine by improving input handling. He refines the joystick input...

c++20 game development sfml input handling joystick keyboard +4 more

Ep 223: Know Your Standard Library: std::nextafter

2020-06-08 6:49 22,515 2 std links

Jason highlights the often overlooked std::nextafter function from the C++ standard library, which returns the next representable floating-point...

floating-point std::nextafter cmath standard library IEEE 754 numeric

Ep 222: 3.5x Faster Standard Containers With PMR!

2020-06-01 10:37 45,209 4 std links

Jason explores C++17's Polymorphic Memory Resources (PMR) to significantly improve container performance. He demonstrates how to use...

c++17 pmr memory resources allocators performance containers +4 more

Jason explores tools for automatically generating a .clang-format configuration file for his C++ Doom project. He demonstrates using two tools -...

clang-format code formatting code style tooling doom legacy code +2 more

Jason examines C++20's new [[likely]] and [[unlikely]] attributes, which provide branch prediction hints to the compiler. These attributes allow...

c++20 optimization attributes likely unlikely branch prediction +1 more

In this fourth part of the RPG in C++20 series, Jason focuses on handling user input through joysticks/gamepads using the SFML library. He explores...

c++20 sfml game development input handling joystick rpg +2 more

Ep 218: C++20's std::to_array

2020-05-04 3:35 21,250 1 std links

This episode explores C++20's std::to_array utility function, which allows converting C-style arrays to std::array. Jason demonstrates how this...

c++20 std::array std::to_array arrays utility functions pointers

Ep 217: Doom vs C++: Round 1: Initial Results

2020-04-27 12:39 21,983 1 std links

Jason compares performance metrics between the original Crispy Doom (C code) and his C++ port. Surprisingly, the C++ version produces a slightly...

doom performance c vs c++ optimization memory model aliasing +2 more

This episode introduces two new C++20 standard library functions: std::lerp (linear interpolation) and std::midpoint. Jason demonstrates why these...

c++20 numeric standard library lerp midpoint overflow +1 more

In this episode of the C++20 RPG series, Jason implements command-line parameter handling using the docopt library. He upgrades the project to C++20,...

c++20 game development command-line arguments docopt parameter validation error handling +1 more

Ep 213: CTRE: Compile Time Regular Expressions

2020-03-30 8:36 14,545 4 std links

Jason introduces CTRE (Compile Time Regular Expressions), a library by Hana Dusíková that processes regular expressions at compile time rather than...

c++20 regular expressions compile-time optimization CTRE template metaprogramming

In this episode of his C++20 RPG series, Jason demonstrates how to establish a robust development environment that catches errors early. He enables...

c++20 game development sanitizers static analysis error detection clang-tidy +1 more

Ep 211: C++20's Bit Manipulation Functions

2020-03-16 6:13 19,229 3 std links

Jason explores the new bit manipulation utilities in C++20's header, highlighting several useful functions for low-level bit operations. The...

c++20 bit manipulation standard library constexpr bitwise operations popcount +2 more

Jason sets up the initial project structure for his C++20 RPG game series using the C++ Starter Project template as a foundation. He walks through...

c++20 game development SFML Dear ImGui immediate mode GUI project setup +1 more

In this introductory episode, Jason Turner outlines his upcoming series about building a 2D top-down RPG game using C++20. He discusses the project's...

c++20 game development best practices project planning SFML SDL

In this extensive episode, Jason tours his `cpp_starter_project` GitHub repository, which serves as a comprehensive modern CMake template for C++...

cmake c++17 conan static analysis clang-tidy cppcheck +7 more

Ep 207: C++20's jthread and stop_token

2020-02-17 8:21 16,445 8 std links

This episode introduces C++20's new thread management features: std::jthread and std::stop_token. Jason demonstrates how std::jthread enhances the...

c++20 jthread stop_token threading concurrency RAII +1 more

Ep 206: Surprising Conversions with CTAD

2020-02-10 5:43 7,836 2 std links

In this episode, Jason explores a potential pitfall with Class Template Argument Deduction (CTAD) in C++17, specifically related to implicit...

CTAD class template argument deduction implicit conversions std::tuple std::pair optimization +2 more

This final episode of Jason's five-part Christmas class series provides answers to the questions posed in Chapter 5. Jason explains that lambdas...

lambdas C++17 return value optimization const initialization template bloat lambda types +2 more

This episode concludes Jason's five-part Christmas class series on lambdas with 'Lambdas To The Limits', focusing on advanced and sometimes unusual...

lambdas destructors RAII recursive lambdas std::bind_front closure types +2 more

This episode is the fourth chapter in Jason's special five-part Christmas class series on lambdas. Jason first explains the solution to Chapter 3's...

lambdas c++17 c++20 fold expressions constexpr lambdas template lambdas +2 more

This episode is the third chapter in Jason's five-part Christmas class series on lambdas, focusing on practical applications. First, Jason reviews...

lambdas fold expressions c++17 object lifetime comparators higher-order functions +3 more

This episode serves as the second chapter in Jason's special five-part series on lambdas, focusing on practical applications and advanced techniques....

lambdas c++98 c++11 c++14 c++17 higher-order functions +4 more

In this landmark 200th episode, Jason kicks off a special five-part educational series on C++ lambdas. This first chapter provides an introduction to...

lambdas c++11 c++98 function objects compiler transformations stateful lambdas +1 more

Ep 199: [[nodiscard]] Constructors And Their Uses

2019-12-23 4:44 13,197 2 std links

This episode explores how to apply the [[nodiscard]] attribute to constructors in C++20, which warns when constructor results are ignored. Jason...

c++20 nodiscard constructors resource management RAII

Ep 197: 25 Years of Best Practices

2019-12-09 12:18 13,209

This episode examines how certain C++ best practices have remained unchanged for 25 years by testing them in Borland C++ for OS/2 from 1994. Jason...

return value optimization RVO object lifetime C++ history Borland C++ OS/2 +2 more

Ep 196: What is `requires requires`?

2019-12-02 4:12 13,544 22 std links

This episode explores the curious `requires requires` syntax in C++20 concepts. Jason explains that this pattern appears when making ad-hoc...

C++20 concepts requires templates constraints function objects +1 more

Ep 195: C++20's `constinit`

2019-11-25 5:59 13,419 4 std links

This episode explains C++20's new constinit keyword, which forces variables to be initialized at compile time without making them constant. Jason...

C++20 constinit static initialization const constexpr mutexes +1 more

Ep 194: From SFINAE To Concepts With C++20

2019-11-18 12:56 41,457 1 std links

This episode explores the evolution from SFINAE (Substitution Failure Is Not An Error) to C++20's Concepts feature. Jason demonstrates how...

C++20 Concepts SFINAE templates constraints metaprogramming +1 more

Ep 193: C++20's `contains` Members

2019-11-11 3:13 10,753 26 std links

This episode introduces the new contains() member function coming in C++20 for associative containers (set, multiset, map, multimap, unordered_set,...

C++20 containers set map contains associative containers +1 more

In this episode, Jason explains why using double underscores or leading underscores in C++ identifiers invokes undefined behavior. The C++ standard...

C++ naming conventions undefined behavior reserved identifiers double underscores leading underscores +1 more

This episode explores Cevelop, a free and open-source Eclipse-based C++ IDE with powerful refactoring and code analysis capabilities. Jason...

IDE Cevelop CMake Eclipse C++ project setup +2 more

Ep 190: The Important Parts of C++17 in 10 Minutes

2019-10-21 10:53 44,858 1 std links

This episode presents a concise overview of the most important features in C++17. Jason highlights guaranteed copy elision, constexpr additions to...

C++17 structured bindings fold expressions constexpr guaranteed copy elision string_view +2 more

Ep 189: C++14's Variable Templates

2019-10-14 8:34 14,759 8 std links

This episode explores C++14's variable templates, a feature that Jason admits he didn't fully appreciate until years after its introduction. He...

C++14 variable templates templates type traits metaprogramming constexpr +1 more

Ep 188: C++20's `constexpr` `new` Support

2019-10-07 8:36 14,172 3 std links

This episode introduces C++20's new capability to perform dynamic memory allocation in compile-time constexpr contexts. Jason demonstrates how you...

C++20 constexpr dynamic memory compile-time new delete

Ep 187: C++20's `constexpr` Algorithms

2019-09-30 6:23 8,796 4 std links

This episode explores one of C++20's significant improvements: the addition of constexpr qualifiers to most standard algorithms. Jason demonstrates...

c++20 constexpr algorithms std::sort compile-time programming static_assert

Ep 186: What Are Callables?

2019-09-23 10:32 12,172 1 std links

This episode explains what callable objects are in C++, defining them as anything that can be treated like a function (called with parentheses)....

callables lambdas function pointers member function pointers member object pointers std::invoke +2 more

Ep 185: Stop Using reinterpret_cast!

2019-09-16 10:32 32,079 2 std links

This episode focuses on why using reinterpret_cast in C++ is problematic and should be avoided. Jason explains that reinterpret_cast typically...

reinterpret_cast undefined behavior type punning memcpy bit_cast object lifetime +2 more

This episode explains the concept of higher-order functions in C++, defined as functions that either take functions as parameters or return functions...

higher-order functions functional programming lambda expressions lazy evaluation function composition c++14 +1 more

This episode introduces raw string literals, a feature added in C++11 that simplifies working with complex strings. Jason demonstrates how raw string...

string literals raw strings c++11 escape sequences multiline strings code snippets

Ep 182: Overloading In C and C++

2019-08-26 9:31 13,089 8 std links

This episode explores the differences between function overloading in C and C++. Jason demonstrates how C++ naturally supports function overloading...

function overloading C++ C C11 _Generic templates +2 more

Ep 181: Fixing Our bind_front with std::invoke

2019-08-19 13:16 6,530 1 std links

This episode revisits Jason's previous implementation of std::bind_front from C++20 using lambdas, but addresses a critical limitation: the inability...

c++20 lambdas std::invoke function adapters bind_front templates +1 more

Ep 180: Whitespace Is Meaningless

2019-08-12 4:00 7,667 2 std links

This episode explores how whitespace is largely insignificant in C++ syntax, a trait inherited from C. Jason demonstrates how the preprocessor...

whitespace syntax code formatting clang-format code readability best practices

In this unique episode, Jason demonstrates Power C, a C compiler for the Commodore 64 that was his first introduction to compiled languages. The...

vintage computing Commodore 64 retro development C compilers programming history

Ep 178: The Important Parts of C++14 In 9 Minutes

2019-07-29 9:16 33,910 1 std links

This episode provides a concise overview of the most important features added in C++14, which Jason describes as essentially a 'bug fix' to C++11...

c++14 auto lambda make_unique constexpr language features

This episode demonstrates how to implement C++20's std::bind_front functionality using modern C++ features. Jason shows a concise implementation...

C++20 std::bind_front lambda expressions parameter pack expansion perfect forwarding functional programming

Ep 176: Important Parts of C++11 in 12 Minutes

2019-07-15 11:52 42,854 2 std links

This episode provides a concise overview of the six most significant features introduced in C++11. Jason explains how auto type deduction,...

C++11 auto range-based for lambdas variadic templates unique_ptr +2 more

This episode introduces C++20's spaceship operator (operator<=>), a powerful new language feature that simplifies comparison operations. Jason...

C++20 spaceship operator three-way comparison operator<=> comparison operators language features

Ep 174: C++20's `std::bind_front`

2019-07-01 5:27 9,674 2 std links

This episode introduces std::bind_front, a new functional utility coming in C++20. Jason explains how bind_front is a simpler and more focused...

C++20 std::bind_front functional programming partial application parameter binding

This episode provides a comprehensive overview of the most important features that define C++98/03. Jason identifies four fundamental aspects that...

C++98 C++03 RAII templates destructors STL +2 more

This episode introduces a significant new feature in Compiler Explorer: execution support in the public web version. Jason announces that users can...

compiler explorer godbolt tools code execution C++ development

This episode explores a C++20 enhancement to lambda expressions: the ability to expand parameter packs in lambda captures. Jason demonstrates how...

C++20 lambda expressions parameter packs variadic templates generalized capture move semantics

Ep 170: C++17's `inline` Variables

2019-06-03 5:40 19,902 1 std links

This episode examines C++17's inline variables feature, which simplifies the declaration and definition of static class members. Jason demonstrates...

C++17 inline variables static members string_view constexpr optimization

This episode examines a subtle language change in C++20 that affects aggregate initialization. Jason demonstrates how in C++17, structures with...

C++20 aggregates constructors initialization language changes

This episode explores how to discover and leverage useful compiler warnings in C++. Jason demonstrates using -Wall in Visual Studio and -Weverything...

compiler warnings clang visual studio best practices debugging

This episode explains variable shadowing in C++, which occurs when a variable declared in an inner scope has the same name as a variable in an outer...

variable shadowing compiler warnings debugging best practices code quality -Wshadow +1 more

Ep 166: C++20's Uniform Container Erasure

2019-05-06 5:33 9,865 13 std links

This episode explores a new feature in C++20 called uniform container erasure that simplifies removing elements from standard containers. Jason...

C++20 containers erase algorithms standard library remove-erase idiom +1 more

Ep 165: C++20's is_constant_evaluated()

2019-04-29 6:18 8,185 1 std links

This episode explores the C++20 feature `std::is_constant_evaluated()` from the header. Jason demonstrates how this function allows...

C++20 constexpr compile-time programming std::is_constant_evaluated type_traits metaprogramming +1 more

Ep 164: Adding a Random Device To The C++ Box

2019-04-22 7:08 5,156 3 std links

This episode continues exploring the C++ Box project by implementing a random number generator device. Jason demonstrates how to add a memory-mapped...

C++ Box emulator memory-mapped I/O random number generation ARM virtual devices +1 more

Ep 163: Practicing ARM Assembly

2019-04-15 7:33 7,162

This episode explores writing ARM assembly language using the C++ Box project. Jason demonstrates how to use inline assembly within C++ to manipulate...

ARM assembly inline assembly C++ Box low-level programming emulator memory manipulation +1 more

Ep 162: Recursive Lambdas

2019-04-08 9:14 16,497

This episode demonstrates how to implement recursive lambda functions in C++. Jason shows how to create a Fibonacci implementation using lambdas that...

lambda functions recursion functional programming Fibonacci mutually recursive functions C++11 +1 more

Ep 161: The C++ Box Project

2019-04-01 9:18 8,540

This episode introduces C++ Box, Jason's open-source ARMv4 emulator project written in 100% portable C++. The project provides an integrated...

emulator ARMv4 educational tools graphics programming C++ project cross-platform

Ep 160: Argument Dependent Lookup (ADL)

2019-03-25 5:26 12,924 1 std links

This episode explains Argument Dependent Lookup (ADL), a C++ language feature that enables calling functions without fully qualifying their namespace...

ADL Argument Dependent Lookup namespaces function resolution C++ language feature standard library

Ep 159: `constexpr` `virtual` Members In C++20

2019-03-18 5:55 10,950 2 std links

This episode explores a new C++20 feature allowing virtual functions to be constexpr, which was previously disallowed in C++17 and earlier. Jason...

C++20 constexpr virtual functions polymorphism compile-time optimization

This episode demonstrates how to instruct compilers to leverage CPU-specific optimizations through compiler flags. Jason shows how to enable advanced...

compiler optimization CPU architecture SIMD vectorization performance compiler flags +2 more

In this episode, Jason explains why you should never overload the logical operators && and || in C++. Using a simple example with Compiler Explorer,...

operator overloading logical operators short-circuit evaluation best practices C++ pitfalls

In this informational episode, Jason provides an overview of C++ conferences taking place around the world in 2019. He highlights several events...

conferences community events networking C++ community

This episode examines potential dangers when using GNU's function attributes `pure` and `const`. Using Compiler Explorer, Jason demonstrates how...

function attributes GNU extensions compiler optimizations pure functions const functions optimization pitfalls

Ep 154: One Simple Trick For Reducing Code Bloat

2019-02-11 7:51 45,581 4 std links

In this episode, Jason reveals a common but often overlooked C++ optimization: not defining destructors when they aren't needed. Using Compiler...

optimization destructors rule of zero move semantics compiler optimizations code bloat +1 more

In this practical episode, Jason demonstrates how to use icecream (a fork of distcc) to create a distributed build environment that utilizes multiple...

build systems distributed computing icecream distcc ninja CMake +3 more

In this episode, Jason makes a compelling case that understanding lambdas is a gateway to mastering the most important aspects of C++. He...

lambdas learning C++ C++ concepts language features modern C++ templates +1 more

Ep 151: C++20's Lambdas As Custom Comparators

2019-01-21 4:33 21,409 1 std links

This episode demonstrates how C++20's lambda improvements simplify custom comparators in container classes. Jason revisits his previous Episode 94 on...

c++20 lambdas comparators std::set templates default constructible

This episode explores how C++20's lambda enhancements significantly improve resource management patterns. Jason demonstrates a practical application...

c++20 lambdas unique_ptr custom deleters resource management RAII

In this episode, Jason explores three important lambda enhancements introduced in C++20: default constructible stateless lambdas, assignable...

c++20 lambdas default constructible unevaluated contexts function objects

In this episode, Jason discusses important considerations when using clang-tidy, specifically addressing which checks to avoid. He cautions against...

clang-tidy static analysis code quality best practices tooling

Ep 147: C++ And Python Tooling

2018-12-24 5:48 7,945

This episode explores several Python-based tools that can be installed via pip to enhance C++ development workflows. Jason introduces Lizard for...

python tools build systems code analysis cmake ninja +3 more

Ep 146: C++20's std::to_address

2018-12-17 9:09 22,774 3 std links

This episode explores std::to_address, a new utility coming in C++20 that extracts the underlying raw pointer from smart pointers and pointer-like...

c++20 std::to_address smart pointers iterators generic programming memory

This episode demonstrates Visual Studio 2017's built-in static analysis capabilities for automatically detecting when functions can be marked as...

constexpr noexcept static analysis visual studio optimization nodiscard

Ep 144: Pure Functions in C++

2018-12-03 4:36 14,802

This episode explores GNU's 'pure' and 'const' function attributes which allow developers to communicate that functions have no external side effects...

pure functions function attributes compiler optimization gcc const function side effects

Ep 143: GNU Function Attributes

2018-11-26 5:46 9,311

This episode explores GNU function attributes focusing on the 'always_inline' attribute as an example. Jason demonstrates how to use this...

gnu attributes inline always_inline compiler extensions portability

Ep 142: Short Circuiting With Logical Operators

2018-11-19 6:48 7,746 1 std links

Jason Turner shares a subtle bug he encountered related to short-circuiting with the logical OR operator. He describes how in his ARM emulator, he...

short-circuit evaluation logical operators OR operator debugging side effects control flow +1 more

Jason Turner explores C++20's designated initializers, clarifying the correct syntax (.member = value) and demonstrating that they enforce type...

C++20 designated initializers lambdas IIFE type safety initialization +1 more

Ep 140: Use `cout`, `cerr`, and `clog` Correctly

2018-11-05 4:58 22,309 1 std links

Jason Turner explains the proper use of C++'s standard output streams: cout, cerr, and clog. He argues against the common practice of using...

iostream cout cerr clog endl performance +2 more

Ep 139: References To Pointers

2018-10-29 8:07 15,060 2 std links

Jason Turner explores the complex topic of references to pointers in C++, demonstrating how they differ from regular references and pointers. He...

pointers references const correctness type declarations cdecl

Jason Turner explores modern C++ capabilities on the MIPS architecture, a RISC processor design from 1985 that remains widely used in networking...

MIPS embedded systems cross-compilation routers RISC historical architectures +1 more

Jason Turner challenges the common misconception that C++ is strictly an object-oriented programming language. He demonstrates that C++ supports...

programming paradigms object-oriented functional programming procedural programming generic programming multi-paradigm

Jason Turner explores how the 'inline' keyword affects compiler optimization decisions, using Clang's optimization viewer to demonstrate its impact....

inline optimization compiler behavior clang linking function inlining +1 more

Ep 135: {fmt} is Addictive! Using {fmt} and spdlog

2018-10-01 6:15 20,526 2 std links

Jason Turner explores the {fmt} library and spdlog, demonstrating how they provide a cleaner, more intuitive alternative to C++'s iostream for string...

fmt formatting logging spdlog stdlib alternatives string formatting +1 more

Ep 134: The Best Possible Way To Create A Visitor?

2018-09-24 6:09 18,002 1 std links

Jason Turner revisits his approach to creating visitors by inheriting from lambdas, demonstrating significant improvements using C++17 features. He...

lambdas visitor pattern C++17 aggregate initialization inheritance constexpr +1 more

In this episode, Jason Turner breaks down what a C++ lambda is by demonstrating its equivalent implementation if written manually. He explains that a...

lambdas c++17 function objects mutable generic lambdas templates

This episode explores a creative technique using lambdas within C++17 fold expressions. Jason demonstrates how to capture variadic template...

C++17 fold expressions lambdas variadic templates metaprogramming parameter packs

Ep 131: Literals in ARM Assembly

2018-09-03 12:01 5,467

This episode explores how integer literals are handled in ARM assembly compared to x86-64. Jason demonstrates that while Intel processors can...

ARM assembly immediate values constants embedded programming instruction encoding compiler optimizations +1 more

Ep 130: C++20's for init-statements

2018-08-27 5:54 9,567 1 std links

This episode explores C++20's new for loop init-statements, an extension to range-based for loops that allows variable declarations before the loop...

C++20 for loops range-based for init-statement object lifetime dangling references +1 more

In this episode, Jason identifies the implicit conversion of C-style arrays to pointers as the most dangerous feature he would remove from C++....

C++ pitfalls array decay C-style arrays pointers std::array language design +1 more

Ep 128: C++20's Template Syntax For Lambdas

2018-08-13 6:31 15,695 24 std links

This episode explores C++20's new template syntax for lambdas, which extends C++14's generic lambdas with explicit template parameters. Jason...

C++20 lambdas templates generic programming type constraints template syntax

Ep 127: C++20's Designated Initializers

2018-08-06 8:36 16,640 1 std links

This episode introduces designated initializers, a new feature in C++20 that allows explicitly naming structure members during initialization. Jason...

C++20 designated initializers struct initialization named parameters language features brace initialization

Ep 126: Lambdas With Destructors

2018-07-30 5:44 14,897

This episode explores how to create lambdas with destruction behavior by capturing objects with custom destructors. Jason demonstrates how lambdas...

lambdas destructors RAII object lifetime C++ resource management +1 more

This episode examines various approaches to returning values from functions and their performance implications. Jason demonstrates how different...

functions return value optimization RVO optimization C++17 performance +2 more

This episode explores the Advanced Bit Manipulation (ABM) and Bit Manipulation Instruction (BMI) sets available in modern CPUs. Jason demonstrates...

optimization bit manipulation BMI ABM compiler flags instruction sets

Ep 123: Using in_place_t

2018-07-09 5:58 15,336 3 std links

This episode explores the in_place_t constructor parameter used with std::optional, std::variant, and std::any for efficient in-place object...

c++17 optional variant any in_place_t optimization +1 more

Ep 122: `constexpr` With `optional` And `variant`

2018-07-02 8:25 9,347 5 std links

This episode explores the capabilities and limitations of using std::optional and std::variant in constexpr contexts in C++17. Jason clarifies that...

c++17 constexpr std::optional std::variant algebraic data types

Ep 121: Strict Aliasing In The Real world

2018-06-25 6:19 12,342 1 std links

This episode demonstrates a real-world example of how strict aliasing rules can affect code performance and optimization. Jason shows how the...

strict aliasing optimization undefined behavior type safety SIMD

This episode explores whether modern C++ code can run on the Tandy 1000 SL 2 from 1984, which featured an 8086 processor running at 8 MHz with 512KB...

16-bit vintage computing compiler explorer tandy 1000 memory model DOS

Ep 119: Negative Cost Structs

2018-06-11 7:54 23,969

This episode explores how using structs to group related data can lead to more efficient code, particularly on the 64-bit Intel ABI. Jason...

optimization structs register usage function calls ABI best practices

This episode explores the vcpkg package manager from Microsoft, completing Jason's three-part series on C++ package managers. He demonstrates how to...

vcpkg package manager fmt cmake microsoft dependencies

In this episode, Jason explores the Hunter package manager for C++, continuing his mini-series on C++ package managers. He demonstrates how to set up...

package manager hunter cmake fmt dependencies build systems

This episode begins a mini-series on C++ package managers, starting with Conan. Jason documents his first-time experience setting up and using Conan...

package manager conan dependency management fmt CMake build system +1 more

This episode demonstrates a completely compile-time ARM emulator that can execute ARM instructions and verify their results during compilation. Jason...

constexpr compile-time ARM emulator C++17 noexcept +1 more

This episode showcases additions to the CPP Starter Project that introduce examples for four different GUI toolkits: FLTK, GTKMM, Dear ImGui, and...

GUI FLTK GTKMM ImGui Nana CMake +1 more

This episode explores whether it's possible to compile C++ code for the PIC16 microcontroller used in the Atari Touch Me handheld game from 1978....

embedded systems PIC16 LLVM retro computing compiler targets microcontrollers +1 more

Ep 112: GCC's Leaky Abstractions

2018-04-23 6:31 7,920 1 std links

This episode explores how GCC's implementation details sometimes 'leak' into the C++ code through compiler warnings and error messages, exposing...

GCC implementation details undefined behavior lambdas range-based for loops reserved identifiers +1 more

Ep 111: kcov

2018-04-16 3:42 6,413

This episode introduces kcov, a user-friendly code coverage tool for C++ on Linux systems. Jason demonstrates how kcov significantly simplifies the...

code coverage testing tools kcov debugging Linux +1 more

Ep 110: gdbgui

2018-04-09 6:17 12,564

This episode introduces gdbgui, a browser-based frontend for GDB that provides a modern graphical debugging experience for C++ on Unix systems. Jason...

debugging gdb gdbgui tools unix visualization +1 more

Ep 109: When noexcept Really Matters

2018-04-02 4:55 30,837 2 std links

This episode demonstrates the practical importance of the noexcept specifier in C++ by showing how it affects std::vector's reallocation behavior....

c++11 noexcept optimization move semantics std::vector exception safety +1 more

This episode explains how emplace_back works in C++11 compared to push_back by demonstrating the difference in object construction and move...

c++11 emplace_back push_back optimization containers std::vector +1 more

Ep 107: The Power of =delete

2018-03-19 4:32 14,776 8 std links

Building on his previous episode about disabling moves from const objects, Jason explores the power of the =delete specifier in C++11. He...

=delete function overloading templates type safety implicit conversions C++11

Ep 106: Disabling Move From const

2018-03-12 5:05 8,004 5 std links

Jason explores how to explicitly disable moving from const objects in C++. Following up on his previous episodes about why you cannot move from const...

move semantics const correctness special member functions C++11 deleted functions

In this final episode of the Learning Modern C++ series, Jason demonstrates how static analysis tools can help transform traditional C++ code into...

algorithms range-based for loops nullptr std::accumulate static analysis +1 more

In this fourth episode of the Learning Modern C++ series, Jason explores how static analysis tools can guide you toward proper use of const and...

const constexpr if constexpr static functions static analysis cppcheck +2 more

In this third episode of the Learning Modern C++ series, Jason demonstrates how static analysis tools can help identify and fix common...

inheritance polymorphism override rule of five virtual destructor memory management +2 more

Ep 102: Learning "Modern C++" - 2: Hello World

2018-02-12 12:36 32,569 1 std links

In this second episode of the "Learning Modern C++" series, Jason demonstrates how to set up a proper Hello World project with modern C++ practices....

modern C++ hello world static analysis clang-tidy cppcheck Visual Studio +2 more

This episode begins a series on learning modern C++, focusing first on setting up the right development environment. Jason demonstrates how to set up...

modern C++ development tools Visual Studio static analysis code formatting best practices +1 more

Ep 100: All The Assignment Operators

2018-01-29 8:07 9,634 4 std links

Jason explores the complete set of possible assignment operator variants in C++. He explains how the canonical copy and move assignment operators are...

assignment operators reference qualifiers operator overloading c++11 best practices

Jason explores one of the first available C++20 features: default initialization for bit-field members. He demonstrates how C++20 allows in-class...

c++20 bit fields initialization language features clang

Ep 98: Precision Loss with Accumulate

2018-01-15 6:33 6,116 2 std links

This episode highlights a subtle but significant issue when using std::accumulate with floating-point values but an integer accumulator. Jason...

std::accumulate floating-point precision loss compiler warnings Visual Studio numeric algorithms

This episode explores the often-overlooked capability of converting non-capturing lambdas to function pointers in C++. Jason demonstrates how this...

lambda function pointer type erasure std::function optimization comparators

Ep 96: Transparent Lambda Comparators

2018-01-01 9:27 8,682 13 std links

This episode combines concepts from prior episodes about lambda comparators and transparent comparators, demonstrating how to create efficient...

C++17 lambdas transparent comparators variadic templates inheritance associative containers +2 more

Ep 95: Transparent Comparators

2017-12-25 6:07 6,871 20 std links

This episode explores transparent comparators, a C++14 feature that enables more efficient lookups in associative containers like std::set and...

C++14 transparent comparators associative containers optimization std::set std::map +2 more

Ep 94: Lambdas as Comparators

2017-12-18 7:28 10,028 1 std links

This episode builds on the previous one about custom comparators for containers, exploring how to use lambdas as comparators for associative...

lambdas comparators associative containers C++17 class template argument deduction std::set +1 more

Ep 93: Custom Comparators for Containers

2017-12-11 4:54 14,710 3 std links

This episode explains how to use custom comparators with C++ standard library associative containers like std::set and std::map. Jason demonstrates...

STL containers associative containers comparators std::set std::map +1 more

Ep 92: function-try-blocks

2017-12-04 7:36 10,449 2 std links

This episode explores function-try-blocks, a rarely used C++ feature that allows wrapping an entire function body in a try-catch block. Jason...

exception handling constructors initialization function-try-block error handling

Ep 91: Using Lippincott Functions

2017-11-27 7:55 14,128 7 std links

This episode explores the concept of Lippincott functions, named after Lisa Lippincott, as a technique for centralizing exception handling code....

exceptions templates Lippincott function code size optimization error handling

Ep 89: Overusing Lambdas

2017-11-13 5:41 11,680

This episode discusses a potential pitfall of overusing lambda expressions in C++. Jason shares a real-world example from his work on ChaiScript...

lambda optimization binary size template metaprogramming perfect forwarding c++17

Ep 88: Don't Forget About puts

2017-11-07 6:49 13,353

This episode highlights the often-overlooked puts() function from the C standard library, which remains available in C++. Jason compares different...

optimization c functions output iostream puts printf +1 more

Ep 87: std::optional

2017-10-30 7:36 25,290 2 std links

This episode explores std::optional, a C++17 feature that provides a way to represent optional values without dynamic memory allocation. Jason...

c++17 std::optional move semantics value semantics error handling

Ep 86: Valgrind

2017-10-23 7:38 32,448

This episode examines Valgrind, a powerful dynamic analysis tool for detecting memory errors in C++ programs without requiring source code...

valgrind debugging memory errors profiling dynamic analysis callgrind +2 more

Ep 85: Fuzz Testing

2017-10-16 9:50 17,117 1 std links

This episode explores fuzz testing in C++, a powerful technique for discovering bugs by generating random or mutated inputs. Jason demonstrates...

fuzzing testing libfuzzer sanitizers security quality assurance +2 more

Ep 84: C++ Sanitizers

2017-10-09 11:41 29,815 1 std links

This episode explores C++ sanitizers, powerful runtime analysis tools available in Clang and GCC. Jason demonstrates the Address Sanitizer that...

sanitizers debugging memory safety address sanitizer memory sanitizer undefined behavior +2 more

This episode demonstrates how to set up a local installation of Compiler Explorer (Godbolt) on Linux. Jason walks through the process of cloning the...

compiler explorer godbolt c++ tools development environment node.js compilation +1 more

Ep 82: Intro To CTest

2017-09-25 6:51 21,284

This episode demonstrates how to add automated testing to a CMake-based C++ project using CTest. Jason builds on his previous episodes about CMake,...

ctest cmake continuous integration testing travis ci appveyor +1 more

This episode provides a high-level overview of computer architecture, explaining how computers fundamentally operate according to the von Neumann...

computer architecture von neumann cpu memory commodore 64 hardware +1 more

Ep 80: Intro to AppVeyor

2017-09-11 7:33 9,837

This episode demonstrates how to add AppVeyor continuous integration to a C++ project, complementing the Travis CI setup from the previous episode....

appveyor continuous integration cmake visual studio windows devops +1 more

Ep 79: Intro To Travis CI

2017-09-04 6:30 16,547

This episode demonstrates how to add Travis CI continuous integration to a CMake-based C++ project. Jason explains the process of creating a...

travis ci continuous integration cmake devops github build automation

This episode provides an introduction to CMake, showing how to set up a basic cross-platform C++ project. Jason demonstrates creating a simple...

cmake build systems cross-platform c++14 visual studio gcc +1 more

Ep 77: G++ 7.1 for DOS

2017-08-21 9:22 6,563

This episode explores using modern C++ compilers in the DOS operating system. Jason demonstrates how to install and use DJGPP (DJ's GNU Programming...

dos djgpp cross-compilation legacy gcc c++11 +1 more

Ep 76: static_print

2017-08-14 6:09 11,345 1 std links

This episode explores the concept of printing information at compile time using a proposal called 'static_print'. Jason demonstrates a patched...

constexpr metaprogramming templates debugging compile-time c++17

Ep 75: Why You Cannot Move From Const

2017-08-07 6:08 10,373 1 std links

This episode explains why attempting to move from a const object in C++ silently falls back to copying instead. Jason demonstrates that using...

move semantics const correctness r-value references optimization c++11

Ep 74: std::regex optimize

2017-07-31 5:22 9,291 5 std links

This episode examines the performance impact of the std::regex_constants::optimize flag and common regex usage patterns. Jason conducts several...

std::regex optimization performance benchmarking c++11

Ep 73: std::string_view

2017-07-24 7:42 30,716 3 std links

This episode explores std::string_view, a new C++17 feature that provides a non-owning reference to a sequence of characters. Jason demonstrates how...

c++17 std::string_view optimization strings memory allocation constexpr

Ep 72: Hidden C++17 - Part 2

2017-07-17 4:39 5,666 6 std links

This episode continues Jason's exploration of lesser-known C++17 features, focusing on std::shared_mutex and mathematical special functions. Jason...

c++17 std::shared_mutex mathematical functions concurrency standard library

Ep 71: Hidden C++ 17 - Part 1

2017-07-10 7:27 4,444 3 std links

This episode explores lesser-known features added to the C++17 standard library. Jason covers several additions including multi-line support in...

c++17 std::to_chars std::from_chars std::as_const shared_ptr regex +1 more

This episode explores using Immediately Invoked Function Expressions (IIFE) in C++ for initializing constant values conditionally. Jason compares two...

IIFE lambda optimization const quick-bench performance +1 more

Ep 69: C++17's Searchers

2017-06-26 8:34 8,602 3 std links

In this episode, Jason explores C++17's additions to the standard search algorithms: the Boyer-Moore searcher and Boyer-Moore-Horspool searcher....

C++17 algorithms string searching boyer-moore boyer-moore-horspool optimization +1 more

Ep 68: std::iota

2017-06-19 4:12 11,270 3 std links

In this episode, Jason introduces std::iota, a C++11 algorithm from the header that initializes a range with sequential increasing values....

C++11 algorithms std::iota std::generate stateful lambdas containers +1 more

Ep 67: C++17's std::gcd and std::lcm

2017-06-12 3:26 9,735 2 std links

In this episode, Jason introduces two useful mathematical functions added to the C++17 standard library: std::gcd for finding the greatest common...

C++17 std::gcd std::lcm constexpr compile-time evaluation number theory +2 more

Ep 66: Variadic fmin for C++11

2017-06-05 3:49 5,021 1 std links

In this episode, Jason demonstrates how to implement a variadic version of std::fmin in C++11, revisiting his previous episodes on custom variadic...

C++11 variadic templates template metaprogramming initializer_list fold expressions parameter pack expansion

Ep 65: C++11's std::fmin

2017-05-29 4:48 8,220 3 std links

In this episode, Jason explores C++11's std::fmin function, which provides special handling for floating-point comparisons involving NaN (Not a...

floating-point NaN std::fmin C++11 variadic templates numerical computing

Ep 64: C++11's std::min (and my version)

2017-05-22 7:13 10,614 1 std links

In this episode, Jason explores C++11's enhancement to std::min that allows finding the minimum value from an initializer list. He demonstrates how...

C++11 std::min variadic templates fold expressions optimization algorithms +1 more

Ep 63: What is Negative Zero?

2017-05-15 6:49 7,777

In this episode, Jason explores the concept of negative zero in floating-point arithmetic. He demonstrates how -0.0 is a distinct value from +0.0 in...

floating-point IEEE 754 negative zero sign bit std::signbit std::copysign +1 more

Ep 62: std::regex

2017-05-08 8:26 19,054 9 std links

In this episode, Jason provides a concise introduction to std::regex, a feature added in C++11 that he considers underappreciated due to its delayed...

regex C++11 string processing raw string literals capture groups pattern matching

Ep 61: Storage Duration with Lambdas

2017-05-01 5:37 9,782 5 std links

In this episode, Jason explores an unusual but interesting aspect of C++ lambdas: manipulating their state's storage duration. He demonstrates how to...

lambdas static variables thread_local concurrency storage duration state management

Ep 60: std::quoted

2017-04-24 2:56 11,590 6 std links

In this short episode, Jason introduces std::quoted, an underappreciated utility function added in C++14 that handles the proper quoting and escaping...

C++14 strings IO manipulators std::quoted string escaping input/output

This episode continues the 'Negative Cost Embedded C++' series, focusing on further optimizing embedded code by consolidating multiple register...

embedded optimization fold expressions C++17 volatile MSP430 +1 more

Ep 58: Negative Cost Embedded C++ - Part 1

2017-04-10 13:12 11,992 1 std links

This episode demonstrates how modern C++ features can be used to optimize embedded systems code for the MSP430 microcontroller, reducing program size...

embedded MSP430 constexpr templates compile-time optimization +2 more

Ep 57: Dissecting An Optimization

2017-04-03 8:18 10,477 1 std links

In this episode, Jason explores why Clang's simple optimization approach for summing integers can outperform GCC's complex SSE-based implementation....

optimization compiler differences assembly mathematical formulas Clang GCC +1 more

Ep 56: Zero Cost Embedded C++ - Part 3

2017-03-27 5:36 7,321 1 std links

In this third episode on zero-cost embedded C++, Jason demonstrates how to use modern C++ features to improve interrupt handling on the TI MSP430...

embedded C++14 lambdas function pointers interrupt handlers MSP430 +1 more

This episode continues Jason's exploration of C++14 on the TI MSP430 microcontroller with only 2KB of flash and 128 bytes of RAM. He expands on the...

embedded C++14 microcontroller interrupts zero-cost abstraction MSP430

In this first part of a series on embedded C++ programming, Jason demonstrates how to use modern C++ (C++14/17) on extremely resource-constrained...

embedded microcontroller MSP430 Texas Instruments bare metal GCC +7 more

Ep 53: Gotos Are Everywhere

2017-03-06 7:14 11,383

In this episode, Jason challenges the notion that 'goto' statements are universally evil by demonstrating how many C++ control structures are...

goto control structures C++ standard compiler optimization language design

Ep 52: C++ To C Compilation

2017-02-27 5:21 7,876

In this episode, Jason explores LLVM's C backend which compiles C++ code to C instead of machine code. He demonstrates how various C++ constructs...

llvm compilation c-backend cross-platform interoperability

Ep 51: Advanced Stateful Lambdas

2017-02-20 6:03 14,154

This episode explores advanced techniques for creating interactive stateful lambdas in C++. Building on a previous episode about basic stateful...

lambdas stateful lambdas C++14 Fibonacci operator overloading interface design +2 more

Ep 50: Inheriting Lambdas vs Generic Lambdas

2017-02-13 4:42 9,557 2 std links

This episode compares two techniques for handling multiple types in a callable object: inheriting from multiple lambdas (as shown in previous...

lambdas generic lambdas inheritance C++14 C++17 visitor pattern +3 more

Ep 49: Why Inherit From Lambdas?

2017-02-06 4:17 15,069 1 std links

This episode answers viewer questions about the practical applications of inheriting from lambdas, a technique previously demonstrated in episodes 40...

lambdas inheritance C++17 visitor pattern std::variant class template argument deduction +1 more

Ep 48: C++17's Variadic `using`

2017-01-30 5:16 14,704 5 std links

This episode explores C++17's variadic 'using' declarations by extending the example from Episode 40 on inheriting from lambdas. Jason demonstrates...

C++17 variadic using lambdas inheritance function objects overload resolution +5 more

Ep 47: My Visual C++ Pet Peeve

2017-01-23 3:35 6,533

This episode highlights one of Jason's major pet peeves with Microsoft's Visual C++ compiler: its non-standard handling of non-const references to...

MSVC Visual C++ compiler warnings non-const references temporaries rvalues +4 more

Ep 46: Start Using Visual C++

2017-01-17 6:21 11,946 1 std links

This episode makes a compelling case for using Microsoft's Visual C++ compiler (MSVC) as part of your automated build chain. Jason demonstrates how...

MSVC Visual C++ compiler warnings binary search size_t type conversion +5 more

This episode demonstrates how to create a compile-time maze generator and solver using constexpr in C++14/17. Building on the constexpr random number...

constexpr maze generation compile-time computation metaprogramming data structures algorithms +4 more

Ep 44: constexpr Compile Time Random

2017-01-02 5:21 14,529 4 std links

This episode demonstrates how to implement a compile-time random number generator using constexpr in C++. Jason presents a pseudorandom number...

constexpr compile-time computation random numbers metaprogramming PCG __TIME__ +1 more

Ep 43: Stack Elision?

2016-12-26 5:14 9,184

This episode introduces the concept of 'stack elision', a term Jason coined to describe compiler optimizations that eliminate stack-allocated...

optimization compiler behavior stack allocation elision Clang GCC +2 more

Ep 42: Clang's Heap Elision

2016-12-19 4:50 9,583 1 std links

This episode examines a powerful optimization capability specific to the Clang compiler called heap elision. Jason demonstrates how Clang can...

Clang optimization heap elision memory management compiler differences C++14

Ep 41: C++17's constexpr Lambda Support

2016-12-12 4:38 11,599 1 std links

This episode explores C++17's new constexpr lambda support and its practical impact on compile-time programming. Jason demonstrates how this feature,...

C++17 constexpr lambdas compile-time computation metaprogramming algorithms +1 more

Ep 40: Inheriting From Lambdas

2016-12-05 4:26 16,186

This episode explores the technique of inheriting from lambdas in C++, a powerful but rarely used feature. Jason demonstrates how lambdas are...

lambdas inheritance C++17 class template argument deduction function composition overloading +1 more

Ep 39: C++17's Deduction Guides

2016-11-28 4:29 12,676 16 std links

This episode continues the exploration of C++17's class template argument deduction by focusing on deduction guides, a feature that enables template...

C++17 templates class template argument deduction deduction guides std::function type deduction

This episode explores C++17's class template argument type deduction, a feature that eliminates the need for explicit template arguments or maker...

C++17 templates class template argument deduction type deduction std::tuple maker functions

Ep 37: Stateful Lambdas

2016-11-14 5:17 18,471 2 std links

This episode explores stateful lambdas in C++11 and C++14, demonstrating how to create lambdas that maintain internal state between invocations....

lambdas C++14 capture lists functional programming init capture stateful functions +1 more

This episode concludes the assembly language series by exploring how the same C++ code gets compiled to different instruction set architectures....

assembly language cross-platform x86 arm mips avr +4 more

This episode continues the assembly language primer series, focusing on how compilers optimize arithmetic operations. Jason demonstrates the LEA...

assembly language x86 compiler optimizations LEA instruction load effective address arithmetic optimization +3 more

This episode provides a primer on reading x86 assembly language, which is essential for understanding compiler optimizations. Jason demonstrates how...

assembly language x86 compiler optimizations intel syntax att syntax registers +4 more

This episode continues the discussion on the cost of C++ constructs in debug builds by examining default member initializers introduced in C++11....

C++11 best practices member initialization class design debug performance readability

Ep 32: Lambdas For Free

2016-10-10 6:35 19,718 2 std links

This episode examines the performance impact of using lambdas in C++. Jason demonstrates that while lambdas generate additional assembly code in...

lambdas performance optimization compiler debug builds Og flag +4 more

Ep 31: IncludeOS

2016-10-03 12:01 14,267

This episode explores IncludeOS, a novel C++ framework that allows developers to compile C++ applications into standalone, bootable operating...

includeos operating systems unikernels bare metal c++14 security +4 more

This episode covers C++17's new [[nodiscard]] attribute, which addresses a common criticism of return-value error codes by ensuring developers don't...

c++17 attributes nodiscard error handling api design compiler warnings +2 more

This episode introduces C++17's new [[maybe_unused]] attribute, which allows developers to explicitly mark entities that might not be used in certain...

c++17 attributes maybe_unused warnings code clarity debug code +2 more

This episode explains C++17's new [[fallthrough]] attribute, which explicitly indicates when a case in a switch statement is meant to fall through to...

c++17 attributes fallthrough switch statement compiler warnings code clarity +2 more

Ep 27: C++17 Changes To Sequence Containers

2016-09-06 7:04 10,700 8 std links

This episode explains key changes to sequence containers (std::array, std::vector, std::deque, std::forward_list, and std::list) in C++17. The most...

c++17 containers std::vector std::list emplace_back emplace_front +2 more

Ep 26: Language Features Removed in C++17

2016-08-29 7:53 15,620 3 std links

This episode explores several language features and standard library components that are being removed in C++17. Jason demonstrates core language...

c++17 deprecated features register keyword auto_ptr random_shuffle boolean increment +1 more

Ep 25: C++17's Aggregate Initializations

2016-08-22 4:47 13,151 2 std links

This episode explores C++17's enhanced aggregate initialization features that now support initialization of base classes. Jason demonstrates the...

c++17 aggregate initialization compiler explorer inheritance uniform initialization brace initialization

Ep 24: C++17's Structured Bindings

2016-08-15 7:30 15,989 1 std links

This episode demonstrates structured bindings, a powerful new feature in C++17 that simplifies working with compound data structures. Jason shows the...

c++17 structured bindings compiler explorer if-initializer statement tuples pairs +1 more

Ep 23: C++17's __has_include

2016-08-08 6:11 11,765

This episode explores `__has_include`, a new feature in C++17 that allows developers to check if a specific header file is available before...

c++17 __has_include preprocessor cross-platform conditional compilation header files

Ep 22: C++17's Nested Namespaces and `std::clamp`

2016-08-01 6:01 12,942 2 std links

This episode covers two new features coming in C++17. First, Jason introduces nested namespace definitions, which allow developers to declare...

c++17 nested namespaces std::clamp code organization standard library algorithm

Ep 21: C++17's `if` and `switch` Init Statements

2016-07-25 8:52 22,314 1 std links

This episode introduces C++17's new feature that allows initialization statements within if and switch conditions. Jason demonstrates how this syntax...

c++17 if statements switch statements initialization statements scope variable lifetime

Ep 20: C++17's Fold Expressions - Introduction

2016-07-18 7:09 25,225 1 std links

This episode introduces fold expressions, a powerful new feature in C++17 that simplifies operations on parameter packs. Jason compares the verbose...

c++17 fold expressions variadic templates parameter packs meta-programming

Ep 19: C++14 For The Commodore 64

2016-07-11 17:13 24,726

This episode demonstrates how modern C++14 features can be used to write efficient code for the Commodore 64. Jason uses Compiler Explorer to show...

c++14 commodore 64 6502 embedded optimization retro computing +1 more

Ep 18: C++17's constexpr if

2016-07-05 12:39 28,462 6 std links

This episode explores C++17's newly approved 'constexpr if' feature, which allows for compile-time conditional branching. Jason demonstrates how the...

c++17 constexpr if templates metaprogramming compile-time SFINAE

Ep 17: C++17's `std::invoke`

2016-06-27 10:40 39,151 1 std links

This episode explores `std::invoke`, one of Jason's favorite new features in C++17. The feature provides a uniform interface for calling any callable...

c++17 std::invoke functional programming templates function pointers member function pointers

Ep 16: Avoiding `std::bind`

2016-06-20 13:53 25,475 2 std links

This episode builds on the previous one about std::bind by explaining why lambdas are almost always a better alternative in modern C++. Jason...

lambdas std::bind performance optimization templates c++11 +3 more

Ep 15: Using `std::bind`

2016-06-13 11:27 39,600 4 std links

This episode explores std::bind, a utility introduced in C++11 (originally from Boost) that creates function objects by binding arguments to callable...

std::bind std::ref function objects partial application callable c++11 +2 more

This episode highlights two useful but often overlooked functions in the C++ standard library: std::next and std::exchange. Jason demonstrates how...

std::next std::exchange iterators standard library utility functions c++11 +2 more

Ep 13: Fibonacci: You're Doing It Wrong

2016-05-30 25:02 40,394 2 std links

This episode explores multiple approaches to calculating Fibonacci numbers in C++, highlighting the trade-offs between different implementations....

fibonacci constexpr template metaprogramming compile-time computation algorithm optimization Binet's formula +1 more

Ep 12: C++17's std::any

2016-05-23 18:27 62,155

This episode introduces std::any, a new type-safe container from C++17 that can hold a single value of any type. Jason demonstrates how to create,...

std::any c++17 type erasure any_cast heterogeneous container small object optimization +2 more

Ep 11: std::future Part 2

2016-05-16 16:07 15,011 5 std links

This episode clarifies and expands upon the std::future concepts introduced in Episode 9. Jason explains the launch policies of std::async: the...

std::future std::async multithreading launch policies lazy evaluation concurrency +3 more

Ep 10: Variadic Expansion Wrap-Up

2016-05-08 15:06 14,084 3 std links

This episode builds on previous variadic template discussions, focusing on guaranteed execution order in parameter pack expansions. Jason...

variadic templates parameter packs initializer lists evaluation order c++11 template metaprogramming +1 more

Ep 9: std::future Quick-Start

2016-05-02 15:47 40,921 4 std links

This episode provides a quick introduction to C++11's std::future and std::async capabilities for multithreaded programming. Jason demonstrates how...

std::future std::async multithreading concurrency c++11 parallelism +1 more

Ep 8: C++ Name Demangling

2016-04-25 13:56 19,407 1 std links

This episode explains C++ name mangling, the process by which compilers encode function and variable names to support function overloading and other...

name mangling demangling typeid abi __cxa_demangle runtime type information +1 more

Ep 7: Stop Using std::endl

2016-04-18 11:20 73,227 1 std links

This episode explains why using std::endl for line breaks in C++ stream operations can significantly impact performance. Jason demonstrates that...

std::endl performance stream io buffering optimization file operations +1 more

Ep 6: Intro To Variadic Templates

2016-04-11 20:38 66,501 8 std links

This episode provides an introduction to variadic templates in C++11, showing how they allow functions to accept an arbitrary number of parameters of...

variadic templates c++11 template metaprogramming parameter packs initializer lists optimization +1 more

Ep 5: Intro To ChaiScript

2016-04-04 25:44 17,511

This episode introduces ChaiScript, a header-only scripting library for C++ that enables seamless integration of scripting capabilities into C++...

chaiscript scripting header-only error-handling function-callbacks type-safety

Ep 4: Variadic Template Refactor

2016-03-28 26:49 22,673 4 std links

This episode demonstrates the refactoring of legacy code in the ChaiScript project from multiple template function overloads to a single variadic...

variadic templates template metaprogramming C++11 C++14 code refactoring ChaiScript +2 more

Ep 3: Intro to clang-tidy

2016-03-21 16:52 48,390

This episode provides an introduction to clang-tidy, a powerful static analysis tool for C++ that consolidates functionality from other Clang tools...

clang-tidy static analysis code quality CMake compiler flags automatic refactoring +1 more

Ep 2: Cost of Using Statics

2016-03-14 20:02 61,808

This episode explores the hidden performance costs associated with accessing static variables in C++. Jason demonstrates how static variable access...

static variables performance optimization thread safety C++11 callgrind +2 more

Ep 1: ChaiScript_Parser Initialization Refactor

2016-03-08 36:25 140,899 4 std links

In this inaugural episode, Jason refactors the initialization code for the ChaiScript parser to improve performance and maintainability. The focus is...

optimization refactoring static initialization const ChaiScript parser +1 more