Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the potential of composite arithmetic types in C++ through this conference talk from C++Now 2017. Delve into the challenges faced by C++'s arithmetic types in fields like heterogeneous computing and information security. Learn how modern language features can be leveraged to upgrade and enhance numeric types. Discover the compositional approach to building custom numeric types, resulting in a variety of efficient abstractions. Examine how features such as type deduction, compile-time evaluation, and user-defined literals can create arithmetic types that are faster, safer, and more user-friendly. Gain insights from John McFarlane's fixed-point library and his experience in standardizing fixed-point arithmetic. Understand key concepts like composability, transparent operators, and numeric traits, and their application in creating advanced arithmetic types such as safe_elastic_integer and precise_safe_elastic_fixed_point.
Syllabus
Intro
Background
Disclaimer
The Pitch
Composability is a GOOD THING
How can I tell if my type is composite?
Example Numeric Types
Telltale Sign #1
Telltale Sign #2
Writing Transparent Operators
Friendly Advice
The Prime Directive
Telltale Sign #3
safe_elastic_integer
precise_safe_elastic_fixed_poi
fixed_point + elastic_integer
The Small Print
numeric_traits
Taught by
CppNow