Stopping Buffer Overflows with C++20 std::span
Stop passing pointer-size pairs in C++. Learn how C++20's std::span provides a safer, non-owning view of contiguous memory to prevent buffer overflows.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop passing pointer-size pairs in C++. Learn how C++20's std::span provides a safer, non-owning view of contiguous memory to prevent buffer overflows.
A single std::atomic counter with relaxed increments is often enough for concurrent updates, but lock-free guarantees, memory ordering, and platform fallbacks decide whether the design holds in production.
Boost.Fiber lets you replace heavyweight OS threads with lightweight, user‑space fibers. Learn the core concepts, see a practical 10,000‑fiber counter example, and weigh the trade‑offs before adopting it in your C++ projects.
Template functions often emit cryptic errors. C++20 Concepts let you declare type requirements, producing clear diagnostics. This post shows a concrete example, compares errors, and gives practical steps to adopt concepts.
Older Clang reported only that a C++20 concept failed. Modern Sema walks the constraint tree and names the exact sub-expression that broke — here's what changed, with a worked example and the compile-time trade-offs.
Step‑by‑step guide to adopting C++20 modules in a medium‑sized codebase: pick a leaf library, write module interface and implementation files, update consumers to import, configure CMake 3.28+, verify encapsulation and incremental build speedups, and recover with header shims if needed.
Discover how Clang’s semantic analyzer evaluates C++20 concepts, integrates constraint expressions, and performs partial ordering for overload resolution. A step‑by‑step example shows the AST nodes, compile‑time diagnostics, and practical limits to watch for.
Learn how Clang’s Sema component diagnoses concept mismatches at compile time, giving clear messages that point to missing requirements and help you fix template errors faster.
Clang’s Sema now implements C++20 concepts, turning complex SFINAE into readable constraints. Learn how the semantic analyzer checks requirements, improves diagnostics, and what trade‑offs you should watch for.