Hello all,
Quick summary on a great Tuesday night on Jan 16 where we went over chapter 2 of Andrei’s A. book – Modern C++ design.
meetup-event link
Recording:
Here is the overall summary of what we went over in this session:
- Compile time assertions
- Partial template specialization.
- Local classes.
- Map integral constants to types. Compile time dispatch based on numeric values. Boolean conditions.
- Type to type mapping. For overloading and function template partial specialization.
- Type selection, based on compile time boolean conditions.
- Detect convertibilities and inheritance at compile time.
- TypeInfo wrapper over type_info. Value semantic and ordering comparisons.
- NullType, EmptyType placeholders classes.
- The last part – “TypeTraits template to offer multiple general purpose traits to help us tailor the code to specific categories of types” – as I expected – we did not have time since we were already overtime (around 1hr and 10 mins) but feel free to go over the last 4-5 slides with the type_info and the overall type traits class.
Overall, in the past 2 sessions (Dec 2023, Jan 2024) we showed the power of Templates with the great help of Andrei’s book. As I mentioned, the book is unique and even after 20+ years, still ranked top IMO. The first 2 chapters are the basic building blocks, the pillars for a better understanding of Generic programming. Worth investing time and reading it.
Thank you!
Kobi