Track 02 · C++
The C++ track
Objects, RAII, move semantics, containers and vtables — as memory, not rules.
42 concepts mapped · 8 interactive now · 52 steps · free, no login
01Beyond C
2 of 4 liveWhat C++ adds before you touch a class.
- 01
References vs pointers
A pointer is a box holding an address. A reference is not a box at all.
intro8 min7 steps0% - 02
auto & type deduction
upcomingWhat auto actually deduces, and when it drops const and references.
- 03
Namespaces
Scoping names, and why `using namespace std` belongs in no header.
intro7 min6 steps0% - 04
Overloading & default arguments
upcomingHow the compiler picks between candidates, and when it refuses.
02Objects
2 of 4 liveClasses as memory with rules attached.
- 05
Class layout & this
Members laid out like a struct; methods take a hidden `this` pointer.
core8 min6 steps0% - 06
RAII: constructors, destructors & scope
The closing brace is the cleanup code. That is the whole idea.
core9 min6 steps0% - 07
Member initialisation
upcomingInit lists vs assignment, and why declaration order wins.
- 08
static members & lifetime
upcomingOne copy per class, initialised once, destroyed last.
03Value semantics
1 of 3 liveWhat happens when an object is copied.
- 09
Copy vs move semantics
A copy duplicates the data. A move just changes who owns it.
core10 min6 steps0% - 10
The rule of five
upcomingIf you write one of them, you probably need all five.
- 11
Operator overloading
upcomingGiving your type built-in syntax, and when that is a mistake.
04Memory & ownership
1 of 3 liveWho deletes what, and when.
- 12
new & delete
upcomingManual heap allocation, and why you should rarely write it.
- 13
unique_ptr & shared_ptr
Ownership written into the type, so the compiler enforces what a comment used to.
core10 min7 steps0% - 14
weak_ptr & reference cycles
upcomingTwo shared_ptrs pointing at each other never reach zero.
05Containers & the STL
1 of 4 liveWhat the standard library is doing underneath.
- 15
How std::vector grows
Contiguous, dynamic, and occasionally it moves everything you own.
core10 min7 steps0% - 16
std::string & small-string optimisation
upcomingShort strings live inside the object; long ones do not.
- 17
map vs unordered_map
upcomingA balanced tree against a hash table — ordering versus speed.
- 18
Iterators & ranges
upcomingA generalised pointer, and the invalidation rules that bite.
06Polymorphism
1 of 3 liveOne interface, many implementations.
- 19
Inheritance & object layout
upcomingThe base class sits at the front of the derived object.
- 20
Virtual functions & the vtable
The object carries a hidden pointer that decides which function runs.
deep11 min7 steps0% - 21
Abstract classes & interfaces
upcomingPure virtual functions, and designing to an interface.
07Templates & generics
0 of 3 liveCode written once, compiled per type.
- 22
Templates & instantiation
upcomingOne template, one generated function per type you use.
- 23
Specialisation
upcomingOverriding the generic version for a specific type.
- 24
Concepts & constraints
upcomingSaying what a template requires, and getting readable errors.
08Errors & modern C++
0 of 3 liveFailure handling and the features that changed the style.
- 25
Exceptions & stack unwinding
upcomingEvery destructor between throw and catch runs, in order.
- 26
Lambdas & captures
upcomingA generated class with the captured variables as members.
- 27
Structured bindings & std::optional
upcomingUnpacking values, and representing absence without a sentinel.
09Template metaprogramming
0 of 4 liveUsing the template system as a compile-time programming language.
- 28
SFINAE & tag dispatch
upcoming13 minSubstitution failure is not an error — the compiler just tries the next overload.
- Read enable_if declarations without flinching
- Choose between overloads with tag types
- Understand why concepts (C++20) replace most SFINAE
- 29
Variadic templates & parameter packs
upcoming12 minOne template that takes any number of arguments of any types.
- Write a template that recurses on Head, Tail...
- Use fold expressions to sum, join, or apply over packs
- Implement a simple make_tuple
- 30
CRTP (Curiously Recurring Template Pattern)
upcoming11 minA derived class passing itself back to the base — static polymorphism without vtables.
- Recognise the class Derived : public Base<Derived> shape
- Implement compile-time polymorphism with zero runtime cost
- Use CRTP to add operators (== implies !=) via mixin base
- 31
Type traits & <type_traits>
upcoming10 minAsk the compiler what a type is, at compile time.
- Use is_integral, is_pointer, remove_const, decay, etc.
- Write your own trait with template specialisation
- Combine traits with if constexpr for typed branches
10Concurrency (C++)
0 of 4 liveThe standard library primitives for concurrent code.
- 32
std::thread & joining
upcoming11 minLaunching a function on another core, and making sure it actually finishes.
- Start threads with std::thread and pass arguments
- Understand the difference between join() and detach()
- Use jthread (C++20) to auto-join on destruction
- 33
std::async, futures & promises
upcoming12 minShip a value from one thread to another without touching a mutex yourself.
- Return a value from an async task
- Chain work with then-continuations
- Recognise the launch::async vs launch::deferred trap
- 34
std::atomic & memory_order
upcoming13 minThe C++ version of C's atomics — with proper types and clear ordering.
- Use atomic<int> for counters
- Choose between memory_order_relaxed, acquire, release, seq_cst
- Implement a spinlock with atomic_flag
- 35
Coroutines in C++20
upcoming14 minco_await, co_yield, co_return — functions that can suspend and resume.
- Understand the promise_type / awaiter machinery
- Write a generator with co_yield
- Use a coroutine to unify sync and async code
11Modern C++ features
0 of 4 liveLanguage changes from C++17, 20, and 23 that shape modern style.
- 36
Ranges & views
upcoming12 minCompose transformations over sequences — filter, transform, take — without intermediate containers.
- Chain views::filter | views::transform | views::take
- Understand lazy evaluation and why views hold no state
- Convert between iterator pairs and ranges
- 37
Modules (C++20)
upcoming10 minThe replacement for #include, with proper encapsulation and faster compiles.
- Write a module interface and implementation partition
- Understand why modules compile faster than headers
- Migrate a small library from #include to import
- 38
Three-way comparison (<=>)
upcoming9 minDefine one operator and get ==, <, >, <=, >= for free.
- Return strong_ordering, weak_ordering, partial_ordering appropriately
- Default the spaceship for aggregate comparison
- Understand why float uses partial_ordering
- 39
constexpr & consteval
upcoming11 minForce computation at compile time — errors surface before the program runs.
- Mark functions constexpr and see what compiles at build time
- Use consteval to require compile-time evaluation
- Compute lookup tables at build time to shrink runtime cost
12Performance & customization
0 of 3 liveTuning allocation and layout when the profiler points at std::.
- 40
Writing a custom allocator
upcoming13 minGive std::vector its own memory pool — one call to malloc, thousands of pushes.
- Satisfy the Allocator concept with rebind and allocate
- Build an arena allocator for short-lived objects
- Measure the throughput win versus std::allocator
- 41
Polymorphic memory resources (PMR)
upcoming11 minRuntime-selectable allocators without changing the container's type.
- Use std::pmr::vector with monotonic_buffer_resource
- Understand why pmr avoids template code bloat
- Nest resources to build a fallback chain
- 42
Empty base optimisation (EBO)
upcoming8 minAn empty base class takes zero bytes — a plain empty member takes one.
- Explain why a stateless comparator as a base is free
- Use [[no_unique_address]] (C++20) to shrink members
- Recognise EBO in the standard library
The full syllabus is listed above in teaching order. Concepts marked upcoming are mapped but not yet built as visualizations. Progress is kept in this browser only.