Loading…
CppCon 2021 has ended
Back To Schedule
Wednesday, October 27 • 9:00am - 10:00am
++namedtuple - Python-style Named Tuples in C++20

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
In this workshop, we will take a look into how Python-style named tuples can be implemented in C++20.
The goal will be to test and implement the following snippet from scratch with modern C++ features.

01 const auto tuple = namedtuple{"price"_t = 42, "size"_t = 1'000};
02 static_assert(42 == tuple["price"_t]);
03 static_assert(1'000 == tuple["size"_t]);
04 static_assert(not [](auto tuple) { return requires { tuple["quantity"_t];}(tuple))

At the end of this session, the audience will have a better understanding of C++20 features such as:
- Concepts
- User-Defined Literals
- New additions to lambdas
- std::fixed_string

Additionally, attendees will get familiar with an expressive way of writing modern C++.

Let's get ready to named all tuples at CppCon 2021!

[1] https://docs.python.org/3/library/collections.html

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

Speakers
avatar for Kris Jusiak

Kris Jusiak

Software Architect, Quantlab Financial
Kris is a Software Architect passionate about programming and who has worked in different industries over the years including telecommunications, games and most recently finance for Quantlab Financial, LLC. He has an interest in modern C++ development with a focus on performance and... Read More →


Wednesday October 27, 2021 9:00am - 10:00am MDT