“Evolving array_view and string_view for safe C++ code"
summary
Proposes concrete, tested GSL types (open‑source on GitHub) that replace pointer+length idioms with array_view and string_view, used in large Microsoft C++ codebases to eliminate annotation systems and feed static tools like /analyze. Fixed‑extent views give compile‑time size errors, dynamic views always do bounds checks and fail fast, conversions from bytes require standard‑layout/alignment checks, and common helpers (first/last/sub, insureZ) ease adoption. Compiler cooperation removes most bounds‑check cost, and the implementation already interoperates across major compilers.
AI-written summary · about
chapters (11)
- 0:00Introduction and background
- 1:47What are array_view and string_view
- 4:38Safety goals and design principles
- 9:13Key features of array_view
- 13:50Real-world code example with array_view
- 16:18How array_view improves safety
- 25:23Legacy code example with string_view
- 27:58Key features of string_view
- 34:57Differences from Library Fundamentals TS
- 46:56Performance and optimization
- 56:23Call to action and Q&A
related talks
01h 29mC++ Core Guidelines - Modernize your C++ Code Base
01h 33mSafe and Sane C++ Types
01h 31mWhat C++ Needs to be Safe
59mSoftware Engineering Is About Tradeoffs
01h 02mA Short Life span<> For a Regular Mess - std::span
58mOO Considered Harmful
01h 07mDesign Patterns in Modern C++
59mStrongly Typed Containers
