Loading…
CppNorth 2025, The Canadian C++ Conference
July 20-23, 2025 • Toronto, Canada
Type: Design clear filter
arrow_back View All Dates
Monday, July 21
 

14:30 EDT

Unveiling Type Erasure in C++: From std::function to std::any
Monday July 21, 2025 14:30 - 15:30 EDT
Type erasure is a powerful concept in C++ that allows us to work with heterogeneous types while hiding their concrete details behind a generic interface. In this talk, we will explore how the C++ Standard Library employs type erasure in constructs like std::function, std::shared_ptr, and std::any to provide flexible and efficient solutions for managing types at runtime. Further, we will unveil the hidden cost of using these constructs.
We will start by building our own version of std::function, which will help demystify how it can store and call any callable object, regardless of its type. Then, we'll look at how std::shared_ptr uses type erasure to maintain type safety via dynamic dispatch of the deleter. Finally, we will delve into std::any, some times claimed the modern void*, and explore a different technique of type erasure.
Speakers
avatar for Sarthak Sehgal

Sarthak Sehgal

Sarthak Sehgal is an early-career C++ Software Engineer at a high frequency options market making firm. His interests lie in low level programming, performance optimization, and finance. Blog: sartech.substack.com... Read More →
Monday July 21, 2025 14:30 - 15:30 EDT
TBA-B

16:00 EDT

Should I Check for Null Here?
Monday July 21, 2025 16:00 - 17:00 EDT
Two years ago a junior developer, doing her very first "introductory" task, asked the seemingly simple question "should I check for null here?".

This, of course, resulted in a multi page response from me, starting with:

"It depends"

and ending with:

"And that's the short version. For the long version, see my hour/day presentation on whether to check for null (which is actually not about null at all, but Contracts...)"

Aha! Two years later...

This is a talk about Error Handling - but in particular those errors you didn't expect - bugs.

And yes, this is really a talk about Contracts, in particular C++26 (and beyond) Contracts. What are they, What AREN'T they, how to use them and WHY.
Speakers
avatar for Tony Van Eerd

Tony Van Eerd

Stunt-double for C++ Expert, Christie Digital
Tony has been coding for well over 25 years, and hopefully coding well for most of that. Previously at Inscriber, Adobe, and BlackBerry, he now enables painting with light at Christie Digital. He is on the C++ Committee. He is a Ninja and a Jedi.
Monday July 21, 2025 16:00 - 17:00 EDT
TBA-A
 
  • Filter By Date
  • Filter By Venue
  • Filter By Type
  • Timezone

Recently active attendees

Share Modal

Share this link via

Or copy link

Filter sessions
Apply filters to sessions.
Filtered by Date -