C++Now 2017: Vittorio Romeo “Implementing `variant` visitation using lambdas"
Channel: CppNow
Date: 06/06/2017

http://cppnow.org
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/boostcon/cppnow_presentations_2017
—
The addition of `std::variant` to the upcoming C++17 standard will introduce a "type-safe sum type" to the Standard Library. 
Variants model a "choice between types" - they essentially are type-safe "tagged unions".

The interface they expose, however, is often more cumbersome to use than it needs to be: defining exhaustive visitors requires the user to create a class with several `operator()` overloads, or to create a chain of `if constexpr(...)` calls. Both solutions are not very elegant.

After a brief overview of `std::variant` and its usefulness, this talk will focus on the implementation of a "lambda-based in-place visitation" approach, where the user can visit a variant by simply providing a set of lambdas on the spot. This will require implementing a way of overloading arbitrary function objects.

Recursive variant types will then be covered and the "lambda-based" visitation techniques will be applied to them. This will require implementing the "Y combinator" higher-order function to achieve zero-runtime-overhead lambda recursion.

This talk is intended for developers familiar with C++11 and C++14 core language features (lambdas, variadic templates, `auto`, etc...). Prior knowledge of `std::variant` or sum types is not required.
— 
Vittorio Romeo is an Italian 22 year old Software Engineer at Bloomberg LP. He completed his Bachelor's degree in Computer Science at "Università degli Studi di Messina". 

He began programming at a very young age and is now a C++ enthusiast. While following the evolution of the C++ standard and embracing the newest features, he worked on several open-source projects, including modern general-purpose libraries and free cross-platform games. 

Vittorio is an active member of the C++ community: he participated as a speaker at CppCon 2014/2015/2016, ++it Florence 2015 and at his local Linux Day 2013/2014 events, as a Student/Volunteer at C++Now 2015/2016, at Meeting C++ 2015/2016.

He currently maintains a C++-related blog and a YouTube channel featuring well-received modern C++11 and C++14 tutorials. 

When he's not writing code, Vittorio enjoys weightlifting and fitness-related activities, competitive/challenging computer gaming and good scifi movies/TV-series.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
---

*--*

---