The C++ Type System Is Your Friend

The C++ Type System Is Your Friend

ACCU Conference via YouTube Direct link

Templates and policies

15 of 24

15 of 24

Templates and policies

Class Central Classrooms beta

YouTube videos curated by Class Central.

Classroom Contents

The C++ Type System Is Your Friend

Automatically move to the next video in the Classroom when playback concludes

  1. 1 Intro
  2. 2 Safe, performant, reusable code
  3. 3 (Mostly) typeless programming
  4. 4 Machine-typed programming
  5. 5 Type-rich programming
  6. 6 The miracle of compilation Runtime
  7. 7 Physical types
  8. 8 Whole Value pattern
  9. 9 Templates to the rescue
  10. 10 Adding checking of values
  11. 11 Reuse through client libraries
  12. 12 Physical quantities and dimensions
  13. 13 Tailoring operations - library code
  14. 14 Tailoring operations - client code
  15. 15 Templates and policies
  16. 16 Implementing policies • Let's use a policy on overflow
  17. 17 Constructor validation logic • Let's use a policy to enforce that quantities are non-negative
  18. 18 Effect of constructor validation logic . So, what about the generated code?
  19. 19 Starting to define a domain type . We have now restricted both the operations and the range of allowed values
  20. 20 Domain types vs primitives • Business rules still exist when using primitives: they are just distributed
  21. 21 Compile-time range calculation
  22. 22 Scaling and errors • As systems get larger the number of possible combinations of types (and therefore incompatibilities) grows even faster
  23. 23 Templates and "concepts lite"
  24. 24 Concepts code - first attempt

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.