CppNorth2022 has ended
CppNorth, The Canadian C++ Conference, July 17-20, 2022,
The Omni King Edward Hotel, Toronto, Ontario M5C 1 E9
Back To Schedule
Tuesday, July 19 • 11:00 - 12:00
Taking Static Type-safety to the Next Level

Log in to save this to your schedule, view media, leave feedback and see who's attending!

This talk will present a full-blown solution for a problem that has not been solved in C++ before: How can physical unit types (think Meters, Seconds, ...) be used inside vector / matrix types from a linear algebra library where each entry can have a different unit? The presented solution uses C++'s strong type system to provide physical unit annotations for each matrix element. Furthermore, it also enables coordinate frame and quantity kind annotations (think X- and Y-position in coordinate frame A or B which have identical units but refer to different things).

We will learn what is the best way to represent these annotations, how they propagate through linear algebra operations, how they determine the subset of valid operations on each type and of course and most importantly, how this can be implemented efficiently in C++ (with a special on how C++20 is a game-changer here). While developing the solution, we will also understand how this leads to code that is more expressive and less likely to contain errors because the majority of bugs can be caught at compile-time.

Applications that benefit from this include robotics, computer graphics, automated driving and any other domain that works with physical units, different coordinate frames and matrix operations.

avatar for Daniel Withopf

Daniel Withopf

Daniel Withopf has been working on solving real-world problems with C++ in robotics and related fields for over 20 years. He currently is a Software Engineer at the German car supplier Bosch where he wrote and maintains an object tracking framework for self-driving car projects. While... Read More →

Tuesday July 19, 2022 11:00 - 12:00 EDT
C - Kensington