Please rotate your tablet to be horizontal.

You can dismiss this notice but please note that this experience has not been designed for mobile devices and so will be less than optimal

Back To Schedule

Nth Pack Element

A Case Study

16:45 - 17:45 Wednesday 14th September 2022 MDT Summit 2 & 3 / Online D
Intermediate
Advanced
Templates & Metaprogramming

Varadic packs have been with us since C++11, however getting the nth element efficiently out of a variadic pack still remains not optimal/difficult.
During the years, with new standards emerging, more and more approaches have been discovered but no silver bullet has been found yet or has it?
If understanding of how std::get<N>(tuple) works sounds compeling then this session is for you!

In this case study we will explore different techniques of accessing the nth element of a variadic pack... starting from naive aproaches, through template meta-programming tricks, to compiler intrinsics. We will also focus and deep dive into C++20 features which enables new techniques in order to understand modern ways of dealing with varadic packs...

Comparison against different solutions also will be conducted including compilation times as well as readability including comparison between different languages such as Rust, Nim, D, Circle and C++.

At the end of this session, the audience will have a better understanding of C++20 features and how to deal with variadic packs... and how it compares to different system languages.

Let's get ready to get nth element at CppCon 2022!

Kris Jusiak

Quantlab Financial

Kris is a Senior 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 quality. He is an open-source enthusiast with multiple open-source libraries where he uses template meta-programming techniques to support the C++ rule - "Don't pay for what you don't use" whilst trying to be as declarative as possible with a help of domain-specific languages. Kris is also a keen advocate of extreme programming techniques, Test/Behavior Driven Development and truly believes that 'the only way to go fast is to go well!'.