Make Classes Great Again! (Using Concepts for Customization Points)
summary
Builds a reusable HTTP message class that lets callers swap body and header implementations and allocators, demonstrating static write/read customization for bodies (string, vector, file, empty) and zero-cost storage via the empty-base optimization. Shows a concrete metafunction that checks the body concept — is_body trait using void_t and SFINAE — and how fields become a customizable base type with forwarding constructors for allocator/stateful types. Code compiles, integrates into Boost.Beast, and yields clearer errors and extensible serialization/parsing.
AI-written summary · about
chapters (18)
- 0:00Intro
- 0:23Boost C++ Libraries
- 1:43Outline
- 3:27HTTP Request
- 4:06HTTP Response
- 5:06HTTP Message
- 6:11Message Model
- 9:17Message Class
- 10:34Allocator Aware
- 12:48Body Customization
- 17:15Body Type
- 22:42Concept . For a given template type, a Concept defines
- 23:24Documentation
- 26:05Metafunctions
- 30:25Generic Programming
- 30:59Parsing
- 32:56Fields
- 37:59Summary
related talks
01h 02mAdvanced Levelization Techniques (part 2 of 3)
01h 07mDesign Patterns in Modern C++
01h 30mRethinking the Way We Do Templates in C++
54mWriting C++ to Be Read
42mThe Nightmare of Move Semantics for Trivial C++ Classes
01h 28mC++ Concepts "Lite" in Practice
01h 01mRethinking the Way We Do Templates in C++
01h 04m“Sane and Safe C++ Classes”
