do not click

Meeting C++ 2024   |  Online   |  Training   |  Books   |  Survey   |  Job fair   |  Advertising   |  Jobposting   |  Login

Meeting C++ 2024 - ++namedtuple - Python style named tuples in C++20

Conference | Live Schedule | Talks | Get your ticket | Set your timezone

Kris Jusiak

On Day 3 at 20:00 in Track A (Saphir Room)

In this case study, 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'000u};
02 static_assert(42 == tuple["price"_t]);
03 static_assert(1'000u == tuple["size"_t]);

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 Meeting C++ 2021!

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

Please login to comment

Copyright Meetingcpp GmbH Imprint Piwik Opt out Privacy Policy