There are two popular exercises in C++ template meta-programming: implementing std::tuple and std::variant. However, when it comes to std::visit (an absolute must utility for variant), usually people show a very limited implementation that does not support multiple dispatch or return type deduction. They don't do it for a good reason - it tends to get messy. However, with C++17 I managed to write one that is pretty clean (for meta-programming) and supports all of the requirements. The talk is about how to do that
YOU MAY ALSO LIKE:
- Between linear and binary search (SkillsCast recorded in September 2018)
- What's in a Functional Compiler? (in Online Event on 30th July 2020)
- Intro to OCaml (SkillsCast recorded in June 2020)
- Designing embodied human-computer interactions with audio processing parameters (SkillsCast recorded in October 2019)
std::visit in All of It's Glory
Denis worked on Yandex browser for a few years, and was an active contributor to Chromium, including pushing through and implementing Chromium's version of flat_set container. Active C++ enthusiast and passive C++ content consumer. Denis currently works for Bloomberg in London and is quite pleased with that.