Six Ways for Implementing Math Expressions Calculator in C++
Talkat CppCon 2023 · on Wednesday, 2023-10-04· at 09:00· Cottonwood 2/3, 6700 North Gaylord Rockies Boulevard·
summary
Builder creates a Math Expression Calculator several times over and compares designs by concrete results: starts with pointer-based polymorphism then replaces raw new/delete with unique_ptr vs shared_ptr, measures when cloning is required and when shared ownership gives cheap copies, moves to templates and variadic templates to remove inheritance, uses constexpr, type traits and C++20 concepts to constrain greedy overloads, shows adapter/factory patterns that compile and run and reports which variants simplify code and which hurt flexibility.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:05About the speaker
- 3:11Math expression challenge
- 9:14Raw to smart pointers
- 13:16Hiding smart pointers
- 18:54Unique vs shared pointers
- 26:05Literals without types
- 33:17Constructor adapters
- 41:54Static polymorphism
- 48:22Variadic expressions
- 53:50Design choices summary
- 57:24Q&A








