C++ CMake Tutorial: Build Your First Project
Learn modern CMake for C++ — targets, properties, and dependencies — and configure a small project that compiles cleanly across platforms.
30 posts · page 1 of 1
Learn modern CMake for C++ — targets, properties, and dependencies — and configure a small project that compiles cleanly across platforms.
Understand C++20 coroutines — co_await, co_yield, co_return — and how they enable async and generator-style code without blocking threads.
How constexpr, consteval, and constinit let you move computation from runtime to compile time, with practical patterns and the rules that govern them.
Tour the most useful design patterns in modern C++ — singleton, factory, observer, strategy, RAII — and learn when each one earns its keep.
Compare exceptions and error codes in C++ for handling failures — performance, ergonomics, and when each style fits real codebases.
A practical walk through C++ iterator categories, the ranges library, views, and how to compose pipelines that are both safe and zero-overhead.
Master C++ lambdas: syntax, capture modes by value and reference, mutable lambdas, generic lambdas, and lifetime pitfalls.
Understand the C++ memory model, memory orderings, and how std::atomic enables correct lock-free programming across threads.
How move semantics work in modern C++: rvalue references, std::move, perfect forwarding, and the rules that decide when your objects are copied versus moved.
Learn C++20 modules: what they replace, how to declare and import them, and how they speed up compilation and clean up the preprocessor.
Use C++ namespaces to organize code: nested namespaces, anonymous namespaces, using-declarations, and why using namespace std is dangerous in headers.
RAII is the central idea behind safe C++ code. Learn how scope-bound resource ownership eliminates leaks, simplifies error handling, and scales beyond memory.
A clear comparison of references and pointers in C++, when each is the right tool, and how their semantics interact with const, ownership, and APIs.
A practical guide to unique_ptr, shared_ptr, and weak_ptr in modern C++: ownership semantics, when to use each, and the pitfalls that lead to leaks and cycles.
A practical comparison of the C++ standard containers: vector, list, deque, map, unordered_map, set, and friends, with guidance on which to pick when.
Templates are how C++ does generic code. Concepts (C++20) make that code readable and debuggable. Here is how both work together in practice.
Learn how std::string_view gives you cheap, non-owning views into strings — when to use it, how it speeds up code, and how to avoid dangling references.
A guided tour of the most common undefined behavior traps in C++ and the habits, tools, and language features that help you avoid them in production code.
Set up GoogleTest in a CMake project and write clear unit tests with assertions, fixtures, and parameterized tests for confident C++ code.
Learn how C++ virtual dispatch works under the hood: vtables, vptrs, override, final, and the cost of polymorphism.
Design C++ classes with constructors, destructors, member initializer lists, and the Rule of Three and Five to manage resources safely.
Master C++ control flow with if-else, for and range-for loops, while, do-while, switch, and the modern init-statement syntax for conditions.
Set up a modern C++ toolchain on macOS, Linux, or Windows, then compile and run your first program with g++ or clang++ from the command line.
Write C++ functions that pass data correctly: by value, by reference, by const reference, with overloading, default arguments, and clear ownership.
Tour the modern C++ features that pay back every day: auto, range-for, structured bindings, if-init, std::optional, and string_view.
Learn C++ pointers, the stack vs the heap, new and delete, nullptr, pointer arithmetic, and why modern C++ pushes you toward smart pointers.
Use unique_ptr, shared_ptr, and weak_ptr to model ownership in modern C++ without manual new and delete or memory leaks.
Pick the right C++ STL container for the job: vector, deque, list, map, set, unordered_map, and unordered_set with their complexity guarantees.
Learn C++ templates from scratch: function templates, class templates, type deduction, specialization, and how the compiler stamps out concrete code.
Understand C++ fundamental types, fixed-width integers, floating point, char, bool, const, and how initialization actually works in modern C++.