Type-safe Programming

Description

C++ provides a really advanced type system. A prime example of its application is std::chrono: It uses the type system to create different types for different units and prevent programmer errors.

But the same principle can be applied to your everyday code - this talk is going to show you how. I’ll present simple techniques to leverage the C++ type system to detect and prevent possible bugs at compile-time. We’ll start with the bare minimum - minimize implicit conversions, and then quickly go to more advanced things like using types to express preconditions or general guidelines about type-safe class design.

This talk is in part based on ideas and concepts implemented in my type_safe library.

Video


Slides


See also