Beyond struct: Meta-programming a struct Replacement in C++20
summary
Claims a workable struct replacement implemented in standard C++20 using a fixed_string non-type template parameter for names, overload resolution and inheritance to implement get<Tag> overload plus object-slicing, and an arg= syntax that builds members by slicing a shared parms object. It adds default-init lambdas (including self-aware expressions), compile-time required fields, metastruct::apply reflection, subset conversions, attributes represented as metastructs, and an automatic soa vector with person_ref. It compiles and runs but gives atrocious compiler errors and nontrivial compile-time cost.
AI-written summary · about
chapters (16)
- 0:00Start
- 5:32Defining and accessing members
- 10:59Parms and member
- 12:59Construction
- 17:02Meta Struct Impl
- 17:15Default Init with Expression
- 21:54Meta Struct Apply Object version
- 22:23Meta Struct Apply Type Version
- 23:12Subset conversions
- 23:44Attributes
- 26:55Named arguments
- 31:06Soa Vector
- 32:35Duck Typing for Structs
- 32:51Duck Typing with Templates
- 33:35Duck Typing for meta struct
- 35:00Compile Time Regular Expressions
related talks
56m“Towards Heterogeneous Programming in C++"
01h 00mA totally constexpr standard library
23mExperience Report: Stack Switching in Wasm SpecTec
01h 32mHeterogeneous Programming in C++ today
40mParallelizing the Standard Algorithms Library
58mMDSPAN - A Deep Dive Spanning C++, Kokkos & SYCL
26mRib, a language that I built that could improve the ecosystem of WASM
22mRib, a language that I built that could improve the ecosystem of WASM (v1)
