Expression Templates - Past, Present, Future
summary
Expression templates implement expressions as types so evaluation defers until a compression point (assignment or conversion), avoiding elementwise temporaries for matrix algebra but shifting work to type-level transformation. The demo builds a CRTP-based expression types engine (terminals, unary/binary nodes) that compiles and runs, but deeply nested expressions create massively long mangled names and heavy compile-time memory use; storing children by value avoids dangling references but costs copies. The workflow moves to Boost.Proto and Boost.Hana and C++14 features to cut boilerplate and tame the compile-time costs.
AI-written summary · about
chapters (16)
- 0:00Introduction to speaker
- 1:06What are expression templates
- 8:12Why use expression templates
- 10:18History of expression templates
- 12:47Syntax trees and expression trees
- 20:37Building expression tree structure
- 26:40Operator overloading for expressions
- 30:32CRTP for expression types
- 36:36Live code demonstration
- 42:39Compile-time symbol size issues
- 45:14Compression points in evaluation
- 53:29Limitations of CRTP approach
- 56:13Multiple evaluation strategies
- 59:06Runtime value evaluation
- 1:02:20Memory and performance considerations
- 1:04:48Break and Q&A preview
related talks
01h 06mResolving Template MetaProgramming Challenges Using Type_expr
01h 20mUnit Testing an Expression Template Library in C++20
55mTemplates Made Easy With C++20
01h 30mRethinking the Way We Do Templates in C++
01h 37mRethinking the Way We Do Templates in C++ even more
01h 00mModern Template Metaprogramming: A Compendium, Part I
01h 00mConcepts in C++20: Revolution or Evolution
47mReducing Template Compilation Overhead, Using C++11, 14, 17, and 20.
