Category Modern C++

Constructing views in Modern C++. A Practical Guide.

C++20 views are not limited to the adaptors provided by the standard library. When an operation cannot be expressed through their composition, you can implement a custom view.

This article demonstrates the process by building a lazy, SAX-like XML parser. Along the way, it explains how views, iterators, and sentinels work together, which standard concepts they must satisfy, and how to make a custom view compatible with range-based loops and standard views.

How to Make Coroutines Practical for C++ Projects

C++20 coroutines provide the low-level machinery for suspendable functions, but not a complete async runtime. This article explains what coroutines are, how std::generator makes lazy value generation practical, and how libraries such as libcoro provide tasks, schedulers, and thread pools for real projects.

How C++20 Concepts Simplify Generic Programming

C++20 concepts make template requirements explicit, reusable, and easier to diagnose. This article explains how concepts improve generic code, participate in overload resolution, simplify class template specialization, and help build a clear vocabulary for type requirements.

How C++ Ranges Make Iteration Less Error-Prone

C++ ranges and views make traversal code safer and more expressive by replacing manual iterator pairs with higher-level sequence abstractions. This article explains where iterator-based APIs become error-prone, how ranges reduce those risks, and why lifetime still matters.