Expression Templates for Efficient, Generic Finance Code
summary
Shows a small expression-template library that replaces costly temporaries with cheap descriptor objects, using C++17 features like auto return type deduction and class template argument deduction, std::apply+tuple and lambdas to record operations (callable F_ and operand tuple) and evaluate into the destination via operator[]/subscript. Removes heap allocations (avoids runtime allocations during assignment), recovers the ~12x slowdown from naive temporaries, supports scalars and vectors uniformly, inserts a single loop to batch work and keeps changes local to existing code.
AI-written summary · about
chapters (12)
- 0:00Introduction to speaker
- 1:22Legacy code analysis
- 2:11Refactoring motivation
- 5:03Performance issues
- 6:55Expression template overview
- 8:48Implementation details
- 12:14Operator definitions
- 14:41Type constraint techniques
- 16:37Execution and calculations
- 18:40Recursive evaluation
- 21:09Summary of benefits
- 23:12Q&A session
related talks
58mSimplify and Secure Equation Systems with Type-Driven Development
59mHow and When To Write a C++ Template
55mI Wish I Could Use C++ 1x/y/z
55mBreaking Dependencies: Type Erasure - The Implementation Details
01h 28mModern C++ Design reloaded
01h 01mEasy to Use, Hard to Misuse: Declarative Style in C++
41m“Avoiding Disasters with Strongly Typed C++”
15mVerification of Templated Code in C++
