A hands-on workshop repository for modern C++ topics, from CMake basics to C++23 modules.
- CMake 3.28+
- A C++23-capable compiler/toolchain
- Ninja (recommended generator in this repo)
From the repository root:
cmake -S . -B build -G Ninja
cmake --build buildThen run any module target executable from build/<module-folder>/.
- Focus: CMake fundamentals and dependency management with
FetchContent - Demonstrates fetching and linking
spdlog - Target:
00IntroToCMake(built from that module's own CMake project)
- Focus:
std::unique_ptrownership, borrowing, and move semantics - Demonstrates ownership transfer vs borrowing APIs and mutation through references
- Target:
01SmartPtrs
- Focus: modern standard-library vocabulary types and formatting/printing APIs
- Demonstrates
optional,variant,filesystem,tuple,any,expected,format, andprint/println - Includes
std::expectedmonadic flow withand_thenandtransform - Target:
02ModernStd
- Focus: shortcomings of SFINAE and modern constraints with concepts
- Demonstrates concept definitions, constrained templates, concept-based overloads, and compile-time polymorphism
- Target:
03Concepts
- Focus: modern language syntax and compile-time features
- Demonstrates trailing return types, constrained
auto, structured bindings,constexpr,if constexpr,consteval - Includes variant visitation with overloaded constrained handlers and notes on pack expansion/fold syntax
- Target:
04ModernLang
- Focus: ranges, views, constrained algorithms, and pipeline composition
- Demonstrates
drop,filter,transform(map),for_each,fold_left, and pipe syntax - Target:
05RangesViews
- Focus: C++ modules architecture and dependency hygiene
- Demonstrates primary module interface, partitions, implementation unit, global/private fragments, and forward declarations for cross-references
- Explains avoiding cyclic module imports with acyclic module structure
- Target:
06CppModules
Examples:
./build/01-smart-ptrs/01SmartPtrs
./build/02-modern-std/02ModernStd
./build/03-concepts/03Concepts
./build/04-modern-lang/04ModernLang
./build/05-ranges-views/05RangesViews
./build/06-cpp-modules/06CppModules