CppCon 2018 has ended
Thursday, September 27 • 15:15 - 15:45
Co- and Contra-: Adding a Little Variance

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

C++ had support for covariance almost since the dawn of time, that is: since 1998. This support, however, is limited, and covariance is only limited for types that are fully understood by the compiler, without any way to influence that knowledge. While sometimes useful, it remains a - somewhat - forgotten tool, especially since the dawn of the new era of C++11, where raw owning pointers are frowned upon.

This talk tries to present a case for co- and contravariance: what they are, why they are useful, and how other languages do them. It'll also discuss them in the context of C++: what tools we already have, what tools we can build today without the interference with our compilers, and what a possible future of the feature could look like.

avatar for Michał Dominiak

Michał Dominiak

System Software Engineer, Nvidia

Thursday September 27, 2018 15:15 - 15:45 PDT
Keystone (404)
  • Type Design
  • Level Beginner, Intermediate, Advanced
  • Tags type system